Ver código fonte

Merge branch 'master' of https://github.com/BabylonJS/Babylon.js

Dennis Dervisis 6 anos atrás
pai
commit
7eb5f6b968
37 arquivos alterados com 357 adições e 122 exclusões
  1. 23 1
      Playground/babylon.d.txt
  2. 2 1
      Viewer/src/helper/index.ts
  3. 24 1
      dist/preview release/babylon.d.ts
  4. 1 1
      dist/preview release/babylon.js
  5. 91 46
      dist/preview release/babylon.max.js
  6. 1 1
      dist/preview release/babylon.max.js.map
  7. 49 2
      dist/preview release/babylon.module.d.ts
  8. 1 1
      dist/preview release/glTF2Interface/package.json
  9. 2 2
      dist/preview release/gui/package.json
  10. 6 6
      dist/preview release/inspector/package.json
  11. 11 0
      dist/preview release/loaders/babylon.glTF1FileLoader.js
  12. 1 1
      dist/preview release/loaders/babylon.glTF1FileLoader.js.map
  13. 2 2
      dist/preview release/loaders/babylon.glTF1FileLoader.min.js
  14. 11 0
      dist/preview release/loaders/babylon.glTF2FileLoader.js
  15. 1 1
      dist/preview release/loaders/babylon.glTF2FileLoader.js.map
  16. 1 1
      dist/preview release/loaders/babylon.glTF2FileLoader.min.js
  17. 11 0
      dist/preview release/loaders/babylon.glTFFileLoader.js
  18. 1 1
      dist/preview release/loaders/babylon.glTFFileLoader.js.map
  19. 2 2
      dist/preview release/loaders/babylon.glTFFileLoader.min.js
  20. 11 0
      dist/preview release/loaders/babylonjs.loaders.js
  21. 1 1
      dist/preview release/loaders/babylonjs.loaders.js.map
  22. 2 2
      dist/preview release/loaders/babylonjs.loaders.min.js
  23. 3 3
      dist/preview release/loaders/package.json
  24. 2 2
      dist/preview release/materialsLibrary/package.json
  25. 1 1
      dist/preview release/package.json
  26. 1 1
      dist/preview release/packagesSizeBaseLine.json
  27. 2 2
      dist/preview release/postProcessesLibrary/package.json
  28. 2 2
      dist/preview release/proceduralTexturesLibrary/package.json
  29. 3 3
      dist/preview release/serializers/package.json
  30. 49 2
      dist/preview release/viewer/babylon.module.d.ts
  31. 14 14
      dist/preview release/viewer/babylon.viewer.js
  32. 3 3
      dist/preview release/viewer/babylon.viewer.max.js
  33. 1 1
      package.json
  34. 17 11
      src/Cameras/deviceOrientationCamera.ts
  35. 2 2
      src/Engines/engine.ts
  36. 1 1
      src/Materials/Textures/texture.ts
  37. 1 1
      src/Misc/assetsManager.ts

+ 23 - 1
Playground/babylon.d.txt

@@ -11918,6 +11918,17 @@ declare module BABYLON {
         private _observer;
         private previousPosition;
         /**
+         * Observable for when a pointer move event occurs containing the move offset
+         */
+        onPointerMovedObservable: Observable<{
+            offsetX: number;
+            offsetY: number;
+        }>;
+        /**
+         * @hidden
+         * If the camera should be rotated automatically based on pointer movement
+         */
allowCameraRotation: boolean;
+        /**
          * Manage the mouse inputs to control the movement of a free camera.
          * @see http://doc.babylonjs.com/how_to/customizing_camera_inputs
          * @param touchEnabled Defines if touch is enabled or not
@@ -36604,6 +36615,7 @@ declare module BABYLON {
     export class DeviceOrientationCamera extends FreeCamera {
         private _initialQuaternion;
         private _quaternionCache;
+        private _tmpDragQuaternion;
         /**
          * Creates a new device orientation camera
          * @param name The name of the camera
@@ -36612,6 +36624,16 @@ declare module BABYLON {
          */
         constructor(name: string, position: Vector3, scene: Scene);
         /**
+         * Disabled pointer input on first orientation sensor update (Default: true)
+         */
+        disablePointerInputWhenUsingDeviceOrientation: boolean;
+        private _dragFactor;
+        /**
+         * Enabled turning on the y axis when the orientation sensor is active
+         * @param dragFactor the factor that controls the turn speed (default: 1/300)
+         */
+        enableHorizontalDragging(dragFactor?: number): void;
+        /**
          * Gets the current instance class name ("DeviceOrientationCamera").
          * This helps avoiding instanceof at run time.
          * @returns the class name
@@ -53964,7 +53986,7 @@ declare module BABYLON {
          * @param onSuccess is a callback called when the task is successfully executed
          * @param onError is a callback called if an error occurs
          */
-        run(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void): void;
+        runTask(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void): void;
     }
     /**
      * This class can be used to easily import assets into a scene

+ 2 - 1
Viewer/src/helper/index.ts

@@ -45,7 +45,8 @@ export function extendClassWithConfig(object: any, config: any) {
         if (key in object && typeof object[key] !== 'function') {
             // if (typeof object[key] === 'function') return;
             // if it is an object, iterate internally until reaching basic types
-            if (typeof object[key] === 'object') {
+            // but null is an object so if its null and config[key] is not an object eg. number, the number should be set
+            if ((typeof object[key] === 'object') && (object[key] !== null || typeof config[key] === "object")) {
                 extendClassWithConfig(object[key], config[key]);
             } else {
                 if (config[key] !== undefined) {

+ 24 - 1
dist/preview release/babylon.d.ts

@@ -12081,6 +12081,18 @@ declare module BABYLON {
         private _observer;
         private previousPosition;
         /**
+         * Observable for when a pointer move event occurs containing the move offset
+         */
+        onPointerMovedObservable: Observable<{
+            offsetX: number;
+            offsetY: number;
+        }>;
+        /**
+         * @hidden
+         * If the camera should be rotated automatically based on pointer movement
+         */
+        _allowCameraRotation: boolean;
+        /**
          * Manage the mouse inputs to control the movement of a free camera.
          * @see http://doc.babylonjs.com/how_to/customizing_camera_inputs
          * @param touchEnabled Defines if touch is enabled or not
@@ -37217,6 +37229,7 @@ declare module BABYLON {
     export class DeviceOrientationCamera extends FreeCamera {
         private _initialQuaternion;
         private _quaternionCache;
+        private _tmpDragQuaternion;
         /**
          * Creates a new device orientation camera
          * @param name The name of the camera
@@ -37225,6 +37238,16 @@ declare module BABYLON {
          */
         constructor(name: string, position: Vector3, scene: Scene);
         /**
+         * Disabled pointer input on first orientation sensor update (Default: true)
+         */
+        disablePointerInputWhenUsingDeviceOrientation: boolean;
+        private _dragFactor;
+        /**
+         * Enabled turning on the y axis when the orientation sensor is active
+         * @param dragFactor the factor that controls the turn speed (default: 1/300)
+         */
+        enableHorizontalDragging(dragFactor?: number): void;
+        /**
          * Gets the current instance class name ("DeviceOrientationCamera").
          * This helps avoiding instanceof at run time.
          * @returns the class name
@@ -54695,7 +54718,7 @@ declare module BABYLON {
          * @param onSuccess is a callback called when the task is successfully executed
          * @param onError is a callback called if an error occurs
          */
-        run(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void): void;
+        runTask(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void): void;
     }
     /**
      * This class can be used to easily import assets into a scene

Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 1
dist/preview release/babylon.js


Diferenças do arquivo suprimidas por serem muito extensas
+ 91 - 46
dist/preview release/babylon.max.js


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 1
dist/preview release/babylon.max.js.map


+ 49 - 2
dist/preview release/babylon.module.d.ts

@@ -12258,6 +12258,7 @@ declare module "babylonjs/Events/pointerEvents" {
     }
 }
 declare module "babylonjs/Cameras/Inputs/freeCameraMouseInput" {
+    import { Observable } from "babylonjs/Misc/observable";
     import { Nullable } from "babylonjs/types";
     import { ICameraInput } from "babylonjs/Cameras/cameraInputsManager";
     import { FreeCamera } from "babylonjs/Cameras/freeCamera";
@@ -12287,6 +12288,18 @@ declare module "babylonjs/Cameras/Inputs/freeCameraMouseInput" {
         private _observer;
         private previousPosition;
         /**
+         * Observable for when a pointer move event occurs containing the move offset
+         */
+        onPointerMovedObservable: Observable<{
+            offsetX: number;
+            offsetY: number;
+        }>;
+        /**
+         * @hidden
+         * If the camera should be rotated automatically based on pointer movement
+         */
+        _allowCameraRotation: boolean;
+        /**
          * Manage the mouse inputs to control the movement of a free camera.
          * @see http://doc.babylonjs.com/how_to/customizing_camera_inputs
          * @param touchEnabled Defines if touch is enabled or not
@@ -38271,6 +38284,7 @@ declare module "babylonjs/Cameras/deviceOrientationCamera" {
     export class DeviceOrientationCamera extends FreeCamera {
         private _initialQuaternion;
         private _quaternionCache;
+        private _tmpDragQuaternion;
         /**
          * Creates a new device orientation camera
          * @param name The name of the camera
@@ -38279,6 +38293,16 @@ declare module "babylonjs/Cameras/deviceOrientationCamera" {
          */
         constructor(name: string, position: Vector3, scene: Scene);
         /**
+         * Disabled pointer input on first orientation sensor update (Default: true)
+         */
+        disablePointerInputWhenUsingDeviceOrientation: boolean;
+        private _dragFactor;
+        /**
+         * Enabled turning on the y axis when the orientation sensor is active
+         * @param dragFactor the factor that controls the turn speed (default: 1/300)
+         */
+        enableHorizontalDragging(dragFactor?: number): void;
+        /**
          * Gets the current instance class name ("DeviceOrientationCamera").
          * This helps avoiding instanceof at run time.
          * @returns the class name
@@ -57321,7 +57345,7 @@ declare module "babylonjs/Misc/assetsManager" {
          * @param onSuccess is a callback called when the task is successfully executed
          * @param onError is a callback called if an error occurs
          */
-        run(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void): void;
+        runTask(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void): void;
     }
     /**
      * This class can be used to easily import assets into a scene
@@ -71032,6 +71056,18 @@ declare module BABYLON {
         private _observer;
         private previousPosition;
         /**
+         * Observable for when a pointer move event occurs containing the move offset
+         */
+        onPointerMovedObservable: Observable<{
+            offsetX: number;
+            offsetY: number;
+        }>;
+        /**
+         * @hidden
+         * If the camera should be rotated automatically based on pointer movement
+         */
+        _allowCameraRotation: boolean;
+        /**
          * Manage the mouse inputs to control the movement of a free camera.
          * @see http://doc.babylonjs.com/how_to/customizing_camera_inputs
          * @param touchEnabled Defines if touch is enabled or not
@@ -96168,6 +96204,7 @@ declare module BABYLON {
     export class DeviceOrientationCamera extends FreeCamera {
         private _initialQuaternion;
         private _quaternionCache;
+        private _tmpDragQuaternion;
         /**
          * Creates a new device orientation camera
          * @param name The name of the camera
@@ -96176,6 +96213,16 @@ declare module BABYLON {
          */
         constructor(name: string, position: Vector3, scene: Scene);
         /**
+         * Disabled pointer input on first orientation sensor update (Default: true)
+         */
+        disablePointerInputWhenUsingDeviceOrientation: boolean;
+        private _dragFactor;
+        /**
+         * Enabled turning on the y axis when the orientation sensor is active
+         * @param dragFactor the factor that controls the turn speed (default: 1/300)
+         */
+        enableHorizontalDragging(dragFactor?: number): void;
+        /**
          * Gets the current instance class name ("DeviceOrientationCamera").
          * This helps avoiding instanceof at run time.
          * @returns the class name
@@ -113646,7 +113693,7 @@ declare module BABYLON {
          * @param onSuccess is a callback called when the task is successfully executed
          * @param onError is a callback called if an error occurs
          */
-        run(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void): void;
+        runTask(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void): void;
     }
     /**
      * This class can be used to easily import assets into a scene

+ 1 - 1
dist/preview release/glTF2Interface/package.json

@@ -1,7 +1,7 @@
 {
     "name": "babylonjs-gltf2interface",
     "description": "A typescript declaration of babylon's gltf2 inteface.",
-    "version": "4.0.0-alpha.32",
+    "version": "4.0.0-alpha.33",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

+ 2 - 2
dist/preview release/gui/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-gui",
     "description": "The Babylon.js GUI library is an extension you can use to generate interactive user interface. It is build on top of the DynamicTexture.",
-    "version": "4.0.0-alpha.32",
+    "version": "4.0.0-alpha.33",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -28,7 +28,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "4.0.0-alpha.32"
+        "babylonjs": "4.0.0-alpha.33"
     },
     "engines": {
         "node": "*"

+ 6 - 6
dist/preview release/inspector/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-inspector",
     "description": "The Babylon.js inspector.",
-    "version": "4.0.0-alpha.32",
+    "version": "4.0.0-alpha.33",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -31,11 +31,11 @@
     "dependencies": {
         "@types/react": "~16.7.3",
         "@types/react-dom": "~16.0.9",
-        "babylonjs": "4.0.0-alpha.32",
-        "babylonjs-gui": "4.0.0-alpha.32",
-        "babylonjs-loaders": "4.0.0-alpha.32",
-        "babylonjs-serializers": "4.0.0-alpha.32",
-        "babylonjs-gltf2interface": "4.0.0-alpha.32"
+        "babylonjs": "4.0.0-alpha.33",
+        "babylonjs-gui": "4.0.0-alpha.33",
+        "babylonjs-loaders": "4.0.0-alpha.33",
+        "babylonjs-serializers": "4.0.0-alpha.33",
+        "babylonjs-gltf2interface": "4.0.0-alpha.33"
     },
     "engines": {
         "node": "*"

+ 11 - 0
dist/preview release/loaders/babylon.glTF1FileLoader.js

@@ -3104,12 +3104,23 @@ var GLTFFileLoader = /** @class */ (function () {
         return this._parseAsync(scene, data, rootUrl, fileName).then(function (loaderData) {
             _this._log("Loading " + (fileName || ""));
             _this._loader = _this._getLoader(loaderData);
+            // Get materials/textures when loading to add to container
+            var materials = [];
+            _this.onMaterialLoadedObservable.add(function (material) {
+                materials.push(material);
+            });
+            var textures = [];
+            _this.onTextureLoadedObservable.add(function (texture) {
+                textures.push(texture);
+            });
             return _this._loader.importMeshAsync(null, scene, loaderData, rootUrl, onProgress, fileName).then(function (result) {
                 var container = new babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__["AssetContainer"](scene);
                 Array.prototype.push.apply(container.meshes, result.meshes);
                 Array.prototype.push.apply(container.particleSystems, result.particleSystems);
                 Array.prototype.push.apply(container.skeletons, result.skeletons);
                 Array.prototype.push.apply(container.animationGroups, result.animationGroups);
+                Array.prototype.push.apply(container.materials, materials);
+                Array.prototype.push.apply(container.textures, textures);
                 container.removeAllFromScene();
                 return container;
             });

Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 1
dist/preview release/loaders/babylon.glTF1FileLoader.js.map


Diferenças do arquivo suprimidas por serem muito extensas
+ 2 - 2
dist/preview release/loaders/babylon.glTF1FileLoader.min.js


+ 11 - 0
dist/preview release/loaders/babylon.glTF2FileLoader.js

@@ -3763,12 +3763,23 @@ var GLTFFileLoader = /** @class */ (function () {
         return this._parseAsync(scene, data, rootUrl, fileName).then(function (loaderData) {
             _this._log("Loading " + (fileName || ""));
             _this._loader = _this._getLoader(loaderData);
+            // Get materials/textures when loading to add to container
+            var materials = [];
+            _this.onMaterialLoadedObservable.add(function (material) {
+                materials.push(material);
+            });
+            var textures = [];
+            _this.onTextureLoadedObservable.add(function (texture) {
+                textures.push(texture);
+            });
             return _this._loader.importMeshAsync(null, scene, loaderData, rootUrl, onProgress, fileName).then(function (result) {
                 var container = new babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__["AssetContainer"](scene);
                 Array.prototype.push.apply(container.meshes, result.meshes);
                 Array.prototype.push.apply(container.particleSystems, result.particleSystems);
                 Array.prototype.push.apply(container.skeletons, result.skeletons);
                 Array.prototype.push.apply(container.animationGroups, result.animationGroups);
+                Array.prototype.push.apply(container.materials, materials);
+                Array.prototype.push.apply(container.textures, textures);
                 container.removeAllFromScene();
                 return container;
             });

Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 1
dist/preview release/loaders/babylon.glTF2FileLoader.js.map


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 1
dist/preview release/loaders/babylon.glTF2FileLoader.min.js


+ 11 - 0
dist/preview release/loaders/babylon.glTFFileLoader.js

@@ -6312,12 +6312,23 @@ var GLTFFileLoader = /** @class */ (function () {
         return this._parseAsync(scene, data, rootUrl, fileName).then(function (loaderData) {
             _this._log("Loading " + (fileName || ""));
             _this._loader = _this._getLoader(loaderData);
+            // Get materials/textures when loading to add to container
+            var materials = [];
+            _this.onMaterialLoadedObservable.add(function (material) {
+                materials.push(material);
+            });
+            var textures = [];
+            _this.onTextureLoadedObservable.add(function (texture) {
+                textures.push(texture);
+            });
             return _this._loader.importMeshAsync(null, scene, loaderData, rootUrl, onProgress, fileName).then(function (result) {
                 var container = new babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__["AssetContainer"](scene);
                 Array.prototype.push.apply(container.meshes, result.meshes);
                 Array.prototype.push.apply(container.particleSystems, result.particleSystems);
                 Array.prototype.push.apply(container.skeletons, result.skeletons);
                 Array.prototype.push.apply(container.animationGroups, result.animationGroups);
+                Array.prototype.push.apply(container.materials, materials);
+                Array.prototype.push.apply(container.textures, textures);
                 container.removeAllFromScene();
                 return container;
             });

Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 1
dist/preview release/loaders/babylon.glTFFileLoader.js.map


Diferenças do arquivo suprimidas por serem muito extensas
+ 2 - 2
dist/preview release/loaders/babylon.glTFFileLoader.min.js


+ 11 - 0
dist/preview release/loaders/babylonjs.loaders.js

@@ -7628,12 +7628,23 @@ var GLTFFileLoader = /** @class */ (function () {
         return this._parseAsync(scene, data, rootUrl, fileName).then(function (loaderData) {
             _this._log("Loading " + (fileName || ""));
             _this._loader = _this._getLoader(loaderData);
+            // Get materials/textures when loading to add to container
+            var materials = [];
+            _this.onMaterialLoadedObservable.add(function (material) {
+                materials.push(material);
+            });
+            var textures = [];
+            _this.onTextureLoadedObservable.add(function (texture) {
+                textures.push(texture);
+            });
             return _this._loader.importMeshAsync(null, scene, loaderData, rootUrl, onProgress, fileName).then(function (result) {
                 var container = new babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__["AssetContainer"](scene);
                 Array.prototype.push.apply(container.meshes, result.meshes);
                 Array.prototype.push.apply(container.particleSystems, result.particleSystems);
                 Array.prototype.push.apply(container.skeletons, result.skeletons);
                 Array.prototype.push.apply(container.animationGroups, result.animationGroups);
+                Array.prototype.push.apply(container.materials, materials);
+                Array.prototype.push.apply(container.textures, textures);
                 container.removeAllFromScene();
                 return container;
             });

Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 1
dist/preview release/loaders/babylonjs.loaders.js.map


Diferenças do arquivo suprimidas por serem muito extensas
+ 2 - 2
dist/preview release/loaders/babylonjs.loaders.min.js


+ 3 - 3
dist/preview release/loaders/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-loaders",
     "description": "The Babylon.js file loaders library is an extension you can use to load different 3D file types into a Babylon scene.",
-    "version": "4.0.0-alpha.32",
+    "version": "4.0.0-alpha.33",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -28,8 +28,8 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs-gltf2interface": "4.0.0-alpha.32",
-        "babylonjs": "4.0.0-alpha.32"
+        "babylonjs-gltf2interface": "4.0.0-alpha.33",
+        "babylonjs": "4.0.0-alpha.33"
     },
     "engines": {
         "node": "*"

+ 2 - 2
dist/preview release/materialsLibrary/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-materials",
     "description": "The Babylon.js materials library is a collection of advanced materials to be used in a Babylon.js scene.",
-    "version": "4.0.0-alpha.32",
+    "version": "4.0.0-alpha.33",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -28,7 +28,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "4.0.0-alpha.32"
+        "babylonjs": "4.0.0-alpha.33"
     },
     "engines": {
         "node": "*"

+ 1 - 1
dist/preview release/package.json

@@ -9,7 +9,7 @@
     ],
     "name": "babylonjs",
     "description": "Babylon.js is a JavaScript 3D engine based on webgl.",
-    "version": "4.0.0-alpha.32",
+    "version": "4.0.0-alpha.33",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

+ 1 - 1
dist/preview release/packagesSizeBaseLine.json

@@ -1 +1 @@
-{"engineOnly":309267,"sceneOnly":551634,"minGridMaterial":674636,"minStandardMaterial":773491}
+{"engineOnly":309267,"sceneOnly":551685,"minGridMaterial":674918,"minStandardMaterial":773773}

+ 2 - 2
dist/preview release/postProcessesLibrary/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-post-process",
     "description": "The Babylon.js materials library is a collection of advanced materials to be used in a Babylon.js scene.",
-    "version": "4.0.0-alpha.32",
+    "version": "4.0.0-alpha.33",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -28,7 +28,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "4.0.0-alpha.32"
+        "babylonjs": "4.0.0-alpha.33"
     },
     "engines": {
         "node": "*"

+ 2 - 2
dist/preview release/proceduralTexturesLibrary/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-procedural-textures",
     "description": "The Babylon.js materials library is a collection of advanced materials to be used in a Babylon.js scene.",
-    "version": "4.0.0-alpha.32",
+    "version": "4.0.0-alpha.33",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -28,7 +28,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "4.0.0-alpha.32"
+        "babylonjs": "4.0.0-alpha.33"
     },
     "engines": {
         "node": "*"

+ 3 - 3
dist/preview release/serializers/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-serializers",
     "description": "The Babylon.js serializers library is an extension you can use to serialize Babylon scenes.",
-    "version": "4.0.0-alpha.32",
+    "version": "4.0.0-alpha.33",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -28,8 +28,8 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "4.0.0-alpha.32",
-        "babylonjs-gltf2interface": "4.0.0-alpha.32"
+        "babylonjs": "4.0.0-alpha.33",
+        "babylonjs-gltf2interface": "4.0.0-alpha.33"
     },
     "engines": {
         "node": "*"

+ 49 - 2
dist/preview release/viewer/babylon.module.d.ts

@@ -12258,6 +12258,7 @@ declare module "babylonjs/Events/pointerEvents" {
     }
 }
 declare module "babylonjs/Cameras/Inputs/freeCameraMouseInput" {
+    import { Observable } from "babylonjs/Misc/observable";
     import { Nullable } from "babylonjs/types";
     import { ICameraInput } from "babylonjs/Cameras/cameraInputsManager";
     import { FreeCamera } from "babylonjs/Cameras/freeCamera";
@@ -12287,6 +12288,18 @@ declare module "babylonjs/Cameras/Inputs/freeCameraMouseInput" {
         private _observer;
         private previousPosition;
         /**
+         * Observable for when a pointer move event occurs containing the move offset
+         */
+        onPointerMovedObservable: Observable<{
+            offsetX: number;
+            offsetY: number;
+        }>;
+        /**
+         * @hidden
+         * If the camera should be rotated automatically based on pointer movement
+         */
+        _allowCameraRotation: boolean;
+        /**
          * Manage the mouse inputs to control the movement of a free camera.
          * @see http://doc.babylonjs.com/how_to/customizing_camera_inputs
          * @param touchEnabled Defines if touch is enabled or not
@@ -38271,6 +38284,7 @@ declare module "babylonjs/Cameras/deviceOrientationCamera" {
     export class DeviceOrientationCamera extends FreeCamera {
         private _initialQuaternion;
         private _quaternionCache;
+        private _tmpDragQuaternion;
         /**
          * Creates a new device orientation camera
          * @param name The name of the camera
@@ -38279,6 +38293,16 @@ declare module "babylonjs/Cameras/deviceOrientationCamera" {
          */
         constructor(name: string, position: Vector3, scene: Scene);
         /**
+         * Disabled pointer input on first orientation sensor update (Default: true)
+         */
+        disablePointerInputWhenUsingDeviceOrientation: boolean;
+        private _dragFactor;
+        /**
+         * Enabled turning on the y axis when the orientation sensor is active
+         * @param dragFactor the factor that controls the turn speed (default: 1/300)
+         */
+        enableHorizontalDragging(dragFactor?: number): void;
+        /**
          * Gets the current instance class name ("DeviceOrientationCamera").
          * This helps avoiding instanceof at run time.
          * @returns the class name
@@ -57321,7 +57345,7 @@ declare module "babylonjs/Misc/assetsManager" {
          * @param onSuccess is a callback called when the task is successfully executed
          * @param onError is a callback called if an error occurs
          */
-        run(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void): void;
+        runTask(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void): void;
     }
     /**
      * This class can be used to easily import assets into a scene
@@ -71032,6 +71056,18 @@ declare module BABYLON {
         private _observer;
         private previousPosition;
         /**
+         * Observable for when a pointer move event occurs containing the move offset
+         */
+        onPointerMovedObservable: Observable<{
+            offsetX: number;
+            offsetY: number;
+        }>;
+        /**
+         * @hidden
+         * If the camera should be rotated automatically based on pointer movement
+         */
+        _allowCameraRotation: boolean;
+        /**
          * Manage the mouse inputs to control the movement of a free camera.
          * @see http://doc.babylonjs.com/how_to/customizing_camera_inputs
          * @param touchEnabled Defines if touch is enabled or not
@@ -96168,6 +96204,7 @@ declare module BABYLON {
     export class DeviceOrientationCamera extends FreeCamera {
         private _initialQuaternion;
         private _quaternionCache;
+        private _tmpDragQuaternion;
         /**
          * Creates a new device orientation camera
          * @param name The name of the camera
@@ -96176,6 +96213,16 @@ declare module BABYLON {
          */
         constructor(name: string, position: Vector3, scene: Scene);
         /**
+         * Disabled pointer input on first orientation sensor update (Default: true)
+         */
+        disablePointerInputWhenUsingDeviceOrientation: boolean;
+        private _dragFactor;
+        /**
+         * Enabled turning on the y axis when the orientation sensor is active
+         * @param dragFactor the factor that controls the turn speed (default: 1/300)
+         */
+        enableHorizontalDragging(dragFactor?: number): void;
+        /**
          * Gets the current instance class name ("DeviceOrientationCamera").
          * This helps avoiding instanceof at run time.
          * @returns the class name
@@ -113646,7 +113693,7 @@ declare module BABYLON {
          * @param onSuccess is a callback called when the task is successfully executed
          * @param onError is a callback called if an error occurs
          */
-        run(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void): void;
+        runTask(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void): void;
     }
     /**
      * This class can be used to easily import assets into a scene

Diferenças do arquivo suprimidas por serem muito extensas
+ 14 - 14
dist/preview release/viewer/babylon.viewer.js


Diferenças do arquivo suprimidas por serem muito extensas
+ 3 - 3
dist/preview release/viewer/babylon.viewer.max.js


+ 1 - 1
package.json

@@ -9,7 +9,7 @@
     ],
     "name": "babylonjs",
     "description": "Babylon.js is a JavaScript 3D engine based on webgl.",
-    "version": "4.0.0-alpha.32",
+    "version": "4.0.0-alpha.33",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

+ 17 - 11
src/Cameras/deviceOrientationCamera.ts

@@ -34,23 +34,29 @@ export class DeviceOrientationCamera extends FreeCamera {
         // When the orientation sensor fires it's first event, disable mouse input
         if (this.inputs._deviceOrientationInput) {
             this.inputs._deviceOrientationInput._onDeviceOrientationChangedObservable.addOnce(() => {
-                if (this.inputs._mouseInput) {
-                    this.inputs._mouseInput._allowCameraRotation = false;
-                    this.inputs._mouseInput.onPointerMovedObservable.add((e) => {
-                        if (this._dragFactor != 0) {
-                            if (!this._initialQuaternion) {
-                                this._initialQuaternion = new Quaternion();
+                if (this.disablePointerInputWhenUsingDeviceOrientation) {
+                    if (this.inputs._mouseInput) {
+                        this.inputs._mouseInput._allowCameraRotation = false;
+                        this.inputs._mouseInput.onPointerMovedObservable.add((e) => {
+                            if (this._dragFactor != 0) {
+                                if (!this._initialQuaternion) {
+                                    this._initialQuaternion = new Quaternion();
+                                }
+                                // Rotate the initial space around the y axis to allow users to "turn around" via touch/mouse
+                                Quaternion.FromEulerAnglesToRef(0, e.offsetX * this._dragFactor, 0, this._tmpDragQuaternion);
+                                this._initialQuaternion.multiplyToRef(this._tmpDragQuaternion, this._initialQuaternion);
                             }
-                            // Rotate the initial space around the y axis to allow users to "turn around" via touch/mouse
-                            Quaternion.FromEulerAnglesToRef(0, e.offsetX * this._dragFactor, 0, this._tmpDragQuaternion);
-                            this._initialQuaternion.multiplyToRef(this._tmpDragQuaternion, this._initialQuaternion);
-                        }
-                    });
+                        });
+                    }
                 }
             });
         }
     }
 
+    /**
+     * Disabled pointer input on first orientation sensor update (Default: true)
+     */
+    public disablePointerInputWhenUsingDeviceOrientation = true;
     private _dragFactor = 0;
     /**
      * Enabled turning on the y axis when the orientation sensor is active

+ 2 - 2
src/Engines/engine.ts

@@ -497,14 +497,14 @@ export class Engine {
      */
     // Not mixed with Version for tooling purpose.
     public static get NpmPackage(): string {
-        return "babylonjs@4.0.0-alpha.32";
+        return "babylonjs@4.0.0-alpha.33";
     }
 
     /**
      * Returns the current version of the framework
      */
     public static get Version(): string {
-        return "4.0.0-alpha.32";
+        return "4.0.0-alpha.33";
     }
 
     /**

+ 1 - 1
src/Materials/Textures/texture.ts

@@ -548,7 +548,7 @@ export class Texture extends BaseTexture {
      */
     public clone(): Texture {
         return SerializationHelper.Clone(() => {
-            return new Texture(this._texture ? this._texture.url : null, this.getScene(), this._noMipmap, this._invertY, this.samplingMode);
+            return new Texture(this._texture ? this._texture.url : null, this.getScene(), this._noMipmap, this._invertY, this.samplingMode, undefined, undefined, this._texture ? this._texture._buffer : undefined);
         }, this);
     }
 

+ 1 - 1
src/Misc/assetsManager.ts

@@ -673,7 +673,7 @@ export class HDRCubeTextureAssetTask extends AbstractAssetTask implements ITextu
      * @param onSuccess is a callback called when the task is successfully executed
      * @param onError is a callback called if an error occurs
      */
-    public run(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void) {
+    public runTask(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void) {
 
         var onload = () => {
             onSuccess();