Просмотр исходного кода

Merge pull request #3524 from BabylonJS/master

Nightly
David Catuhe 8 лет назад
Родитель
Сommit
abf23f5afb
100 измененных файлов с 18806 добавлено и 17444 удалено
  1. 7415 7379
      Playground/babylon.d.txt
  2. 2 1
      Tools/Gulp/config.json
  3. 3 3
      Tools/Publisher/index.js
  4. 7645 7611
      dist/preview release/babylon.d.ts
  5. 14 14
      dist/preview release/babylon.js
  6. 73 4
      dist/preview release/babylon.max.js
  7. 14 14
      dist/preview release/babylon.worker.js
  8. 1214 1180
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts
  9. 14 14
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js
  10. 73 4
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js
  11. 2 0
      dist/preview release/gui/babylon.gui.d.ts
  12. 38 15
      dist/preview release/gui/babylon.gui.js
  13. 2 2
      dist/preview release/gui/babylon.gui.min.js
  14. 2 0
      dist/preview release/gui/babylon.gui.module.d.ts
  15. 2 2
      dist/preview release/gui/package.json
  16. 2 2
      dist/preview release/inspector/package.json
  17. 2 2
      dist/preview release/loaders/package.json
  18. 2 2
      dist/preview release/materialsLibrary/package.json
  19. 17 17
      dist/preview release/modules/actions/index.d.ts
  20. 17 17
      dist/preview release/modules/additionalCameras/index.d.ts
  21. 17 17
      dist/preview release/modules/additionalMeshes/index.d.ts
  22. 16 16
      dist/preview release/modules/additionalPostProcess_blur/index.d.ts
  23. 17 17
      dist/preview release/modules/additionalPostProcess_fxaa/index.d.ts
  24. 17 17
      dist/preview release/modules/additionalPostProcess_highlights/index.d.ts
  25. 17 17
      dist/preview release/modules/additionalPostProcess_imageProcessing/index.d.ts
  26. 17 17
      dist/preview release/modules/additionalPostProcesses/index.d.ts
  27. 17 17
      dist/preview release/modules/additionalRenderingPipeline/index.d.ts
  28. 16 16
      dist/preview release/modules/additionalTextures/index.d.ts
  29. 16 16
      dist/preview release/modules/animations/index.d.ts
  30. 16 16
      dist/preview release/modules/arcRotateCamera/index.d.ts
  31. 16 16
      dist/preview release/modules/assetsManager/index.d.ts
  32. 16 16
      dist/preview release/modules/audio/index.d.ts
  33. 17 17
      dist/preview release/modules/backgroundMaterial/index.d.ts
  34. 16 16
      dist/preview release/modules/bones/index.d.ts
  35. 16 16
      dist/preview release/modules/cameraBehaviors/index.d.ts
  36. 17 17
      dist/preview release/modules/collisions/index.d.ts
  37. 84 8
      dist/preview release/modules/core/es6.js
  38. 64 18
      dist/preview release/modules/core/index.d.ts
  39. 84 8
      dist/preview release/modules/core/index.js
  40. 17 17
      dist/preview release/modules/csg/index.d.ts
  41. 380 1
      dist/preview release/modules/debug/es6.js
  42. 96 16
      dist/preview release/modules/debug/index.d.ts
  43. 379 1
      dist/preview release/modules/debug/index.js
  44. 16 16
      dist/preview release/modules/defaultRenderingPipeline/index.d.ts
  45. 16 16
      dist/preview release/modules/depthRenderer/index.d.ts
  46. 17 17
      dist/preview release/modules/directionalLight/index.d.ts
  47. 17 17
      dist/preview release/modules/environmentHelper/index.d.ts
  48. 16 16
      dist/preview release/modules/freeCamera/index.d.ts
  49. 16 16
      dist/preview release/modules/fresnel/index.d.ts
  50. 17 17
      dist/preview release/modules/gamepad/index.d.ts
  51. 16 16
      dist/preview release/modules/geometryBufferRenderer/index.d.ts
  52. 17 17
      dist/preview release/modules/gpuParticles/index.d.ts
  53. 17 17
      dist/preview release/modules/hdr/index.d.ts
  54. 17 17
      dist/preview release/modules/hemisphericLight/index.d.ts
  55. 17 17
      dist/preview release/modules/highlights/index.d.ts
  56. 17 17
      dist/preview release/modules/instrumentation/index.d.ts
  57. 17 17
      dist/preview release/modules/layer/index.d.ts
  58. 16 16
      dist/preview release/modules/lensFlares/index.d.ts
  59. 16 16
      dist/preview release/modules/loader/index.d.ts
  60. 17 17
      dist/preview release/modules/meshBuilder/index.d.ts
  61. 16 16
      dist/preview release/modules/morphTargets/index.d.ts
  62. 16 16
      dist/preview release/modules/multiMaterial/index.d.ts
  63. 16 16
      dist/preview release/modules/nullEngine/index.d.ts
  64. 16 16
      dist/preview release/modules/octrees/index.d.ts
  65. 16 16
      dist/preview release/modules/offline/index.d.ts
  66. 17 17
      dist/preview release/modules/optimizations/index.d.ts
  67. 17 17
      dist/preview release/modules/particles/index.d.ts
  68. 6 1
      dist/preview release/modules/pbrMaterial/es6.js
  69. 21 17
      dist/preview release/modules/pbrMaterial/index.d.ts
  70. 6 1
      dist/preview release/modules/pbrMaterial/index.js
  71. 3 1
      dist/preview release/modules/physics/es6.js
  72. 16 16
      dist/preview release/modules/physics/index.d.ts
  73. 3 1
      dist/preview release/modules/physics/index.js
  74. 17 17
      dist/preview release/modules/picking/index.d.ts
  75. 17 17
      dist/preview release/modules/pointLight/index.d.ts
  76. 17 17
      dist/preview release/modules/polygonMesh/index.d.ts
  77. 17 17
      dist/preview release/modules/postProcesses/index.d.ts
  78. 17 17
      dist/preview release/modules/probes/index.d.ts
  79. 17 17
      dist/preview release/modules/procedural/index.d.ts
  80. 17 17
      dist/preview release/modules/renderingPipeline/index.d.ts
  81. 16 16
      dist/preview release/modules/serialization/index.d.ts
  82. 17 17
      dist/preview release/modules/shaderMaterial/index.d.ts
  83. 16 16
      dist/preview release/modules/shadows/index.d.ts
  84. 16 16
      dist/preview release/modules/simd/index.d.ts
  85. 16 16
      dist/preview release/modules/solidParticles/index.d.ts
  86. 17 17
      dist/preview release/modules/spotLight/index.d.ts
  87. 16 16
      dist/preview release/modules/sprites/index.d.ts
  88. 16 16
      dist/preview release/modules/stringDictionary/index.d.ts
  89. 17 17
      dist/preview release/modules/targetCamera/index.d.ts
  90. 17 17
      dist/preview release/modules/textureFormats/index.d.ts
  91. 17 17
      dist/preview release/modules/textureTools/index.d.ts
  92. 17 17
      dist/preview release/modules/touchCamera/index.d.ts
  93. 16 16
      dist/preview release/modules/userData/index.d.ts
  94. 17 17
      dist/preview release/modules/virtualJoystick/index.d.ts
  95. 26 12
      dist/preview release/modules/vr/es6.js
  96. 28 17
      dist/preview release/modules/vr/index.d.ts
  97. 26 12
      dist/preview release/modules/vr/index.js
  98. 2 2
      dist/preview release/postProcessesLibrary/package.json
  99. 2 2
      dist/preview release/proceduralTexturesLibrary/package.json
  100. 0 0
      dist/preview release/serializers/package.json

Разница между файлами не показана из-за своего большого размера
+ 7415 - 7379
Playground/babylon.d.txt


+ 2 - 1
Tools/Gulp/config.json

@@ -676,7 +676,8 @@
                 "../../src/Gamepad/Controllers/babylon.oculusTouchController.js",
                 "../../src/Gamepad/Controllers/babylon.viveController.js",
                 "../../src/Gamepad/Controllers/babylon.genericController.js",
-                "../../src/Gamepad/Controllers/babylon.windowsMotionController.js"
+                "../../src/Gamepad/Controllers/babylon.windowsMotionController.js",
+                "../../src/Gamepad/Controllers/babylon.gearVRController.js"
             ],
             "dependUpon": [
                 "core"

+ 3 - 3
Tools/Publisher/index.js

@@ -49,7 +49,7 @@ let packages = [
 //check if logged in
 console.log("Using npm user:");
 let loginCheck = shelljs.exec('npm whoami');
-console.log("No that I can check, but - did you forget to run gulp typescript-all?");
+console.log("Not that I can check, but - did you run gulp typescript-all?");
 if (loginCheck.code === 0) {
     prompt.start();
 
@@ -143,12 +143,12 @@ function processCore(package, version) {
 
     fs.writeFileSync(basePath + '/package/' + 'package.json', JSON.stringify(packageJson, null, 4));
 
-    console.log('Publishing ' + package.name + " from " + package.path);
+    console.log('Publishing ' + package.name + " from " + basePath + '/package/');
     //publish the respected package
     shelljs.exec('npm publish \"' + basePath + '/package/' + "\"");
 
     // remove package directory
-    fs.removeSync(basePath + '/package/');
+    //fs.removeSync(basePath + '/package/');
 
     // now update the main package.json
     packageJson.files = packageJson.files.map(file => {

Разница между файлами не показана из-за своего большого размера
+ 7645 - 7611
dist/preview release/babylon.d.ts


Разница между файлами не показана из-за своего большого размера
+ 14 - 14
dist/preview release/babylon.js


+ 73 - 4
dist/preview release/babylon.max.js

@@ -17725,6 +17725,10 @@ var BABYLON;
             _this.orthoRight = null;
             _this.orthoBottom = null;
             _this.orthoTop = null;
+            /**
+             * default : 0.8
+             * FOV is set in Radians.
+             */
             _this.fov = 0.8;
             _this.minZ = 1;
             _this.maxZ = 10000.0;
@@ -17732,7 +17736,15 @@ var BABYLON;
             _this.mode = Camera.PERSPECTIVE_CAMERA;
             _this.isIntermediate = false;
             _this.viewport = new BABYLON.Viewport(0, 0, 1.0, 1.0);
+            /**
+            * Restricts the camera to viewing objects with the same layerMask.
+            * A camera with a layerMask of 1 will render meshes with no layerMask and meshes with a layerMask of 1.
+            */
             _this.layerMask = 0x0FFFFFFF;
+            /**
+            * default : FOVMODE_VERTICAL_FIXED
+            * fovMode sets the camera frustum bounds to the viewport bounds.
+            */
             _this.fovMode = Camera.FOVMODE_VERTICAL_FIXED;
             // Camera rig members
             _this.cameraRigMode = Camera.RIG_MODE_NONE;
@@ -17776,6 +17788,11 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Camera, "FOVMODE_VERTICAL_FIXED", {
+            /**
+             * This is the default FOV mode for perspective cameras.
+             * This setting aligns the upper and lower bounds of the viewport to the upper and lower bounds of the camera frustum.
+             *
+             */
             get: function () {
                 return Camera._FOVMODE_VERTICAL_FIXED;
             },
@@ -17783,6 +17800,10 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Camera, "FOVMODE_HORIZONTAL_FIXED", {
+            /**
+             * This setting aligns the left and right bounds of the viewport to the left and right bounds of the camera frustum.
+             *
+             */
             get: function () {
                 return Camera._FOVMODE_HORIZONTAL_FIXED;
             },
@@ -17993,7 +18014,7 @@ var BABYLON;
             for (var i = 0, len = this._rigCameras.length; i < len; i++) {
                 var cam = this._rigCameras[i];
                 var rigPostProcess = cam._rigPostProcess;
-                // for VR rig, there does not have to be a post process 
+                // for VR rig, there does not have to be a post process
                 if (rigPostProcess) {
                     var isPass = rigPostProcess instanceof BABYLON.PassPostProcess;
                     if (isPass) {
@@ -18020,7 +18041,7 @@ var BABYLON;
             else {
                 this._postProcesses.splice(insertAt, 0, postProcess);
             }
-            this._cascadePostProcessesToRigCams(); // also ensures framebuffer invalidated            
+            this._cascadePostProcessesToRigCams(); // also ensures framebuffer invalidated
             return this._postProcesses.indexOf(postProcess);
         };
         Camera.prototype.detachPostProcess = function (postProcess) {
@@ -18253,7 +18274,7 @@ var BABYLON;
             }
             this.cameraRigMode = mode;
             this._cameraRigParams = {};
-            //we have to implement stereo camera calcultating left and right viewpoints from interaxialDistance and target, 
+            //we have to implement stereo camera calcultating left and right viewpoints from interaxialDistance and target,
             //not from a given angle as it is now, but until that complete code rewriting provisional stereoHalfAngle value is introduced
             this._cameraRigParams.interaxialDistance = rigParams.interaxialDistance || 0.0637;
             this._cameraRigParams.stereoHalfAngle = BABYLON.Tools.ToRadians(this._cameraRigParams.interaxialDistance / 0.0637);
@@ -58326,7 +58347,8 @@ var BABYLON;
         PoseEnabledControllerType[PoseEnabledControllerType["VIVE"] = 0] = "VIVE";
         PoseEnabledControllerType[PoseEnabledControllerType["OCULUS"] = 1] = "OCULUS";
         PoseEnabledControllerType[PoseEnabledControllerType["WINDOWS"] = 2] = "WINDOWS";
-        PoseEnabledControllerType[PoseEnabledControllerType["GENERIC"] = 3] = "GENERIC";
+        PoseEnabledControllerType[PoseEnabledControllerType["GEAR_VR"] = 3] = "GEAR_VR";
+        PoseEnabledControllerType[PoseEnabledControllerType["GENERIC"] = 4] = "GENERIC";
     })(PoseEnabledControllerType = BABYLON.PoseEnabledControllerType || (BABYLON.PoseEnabledControllerType = {}));
     var PoseEnabledControllerHelper = /** @class */ (function () {
         function PoseEnabledControllerHelper() {
@@ -58342,6 +58364,9 @@ var BABYLON;
             else if (vrGamepad.id.toLowerCase().indexOf('openvr') !== -1) {
                 return new BABYLON.ViveController(vrGamepad);
             }
+            else if (vrGamepad.id.indexOf(BABYLON.GearVRController.GAMEPAD_ID_PREFIX) === 0) {
+                return new BABYLON.GearVRController(vrGamepad);
+            }
             else {
                 return new BABYLON.GenericController(vrGamepad);
             }
@@ -59200,6 +59225,50 @@ var BABYLON;
 //# sourceMappingURL=babylon.windowsMotionController.js.map
 
 
+var BABYLON;
+(function (BABYLON) {
+    var GearVRController = /** @class */ (function (_super) {
+        __extends(GearVRController, _super);
+        function GearVRController(vrGamepad) {
+            var _this = _super.call(this, vrGamepad) || this;
+            _this._buttonIndexToObservableNameMap = [
+                'onTrackpadChangedObservable',
+                'onTriggerStateChangedObservable' // Trigger
+            ];
+            _this.controllerType = BABYLON.PoseEnabledControllerType.GEAR_VR;
+            return _this;
+        }
+        GearVRController.prototype.initControllerMesh = function (scene, meshLoaded) {
+            var _this = this;
+            BABYLON.SceneLoader.ImportMesh("", GearVRController.MODEL_BASE_URL, GearVRController.MODEL_FILENAME, scene, function (newMeshes) {
+                _this._defaultModel = newMeshes[1];
+                _this.attachToMesh(_this._defaultModel);
+                if (meshLoaded) {
+                    meshLoaded(_this._defaultModel);
+                }
+            });
+        };
+        GearVRController.prototype.handleButtonChange = function (buttonIdx, state, changes) {
+            if (buttonIdx < this._buttonIndexToObservableNameMap.length) {
+                var observableName = this._buttonIndexToObservableNameMap[buttonIdx];
+                // Only emit events for buttons that we know how to map from index to observable
+                var observable = this[observableName];
+                if (observable) {
+                    observable.notifyObservers(state);
+                }
+            }
+        };
+        GearVRController.MODEL_BASE_URL = 'https://controllers.babylonjs.com/generic/';
+        GearVRController.MODEL_FILENAME = 'generic.babylon';
+        GearVRController.GAMEPAD_ID_PREFIX = 'Gear VR'; // id is 'Gear VR Controller'
+        return GearVRController;
+    }(BABYLON.WebVRController));
+    BABYLON.GearVRController = GearVRController;
+})(BABYLON || (BABYLON = {}));
+
+//# sourceMappingURL=babylon.gearVRController.js.map
+
+
 
 
 

Разница между файлами не показана из-за своего большого размера
+ 14 - 14
dist/preview release/babylon.worker.js


Разница между файлами не показана из-за своего большого размера
+ 1214 - 1180
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts


Разница между файлами не показана из-за своего большого размера
+ 14 - 14
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js


+ 73 - 4
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js

@@ -17725,6 +17725,10 @@ var BABYLON;
             _this.orthoRight = null;
             _this.orthoBottom = null;
             _this.orthoTop = null;
+            /**
+             * default : 0.8
+             * FOV is set in Radians.
+             */
             _this.fov = 0.8;
             _this.minZ = 1;
             _this.maxZ = 10000.0;
@@ -17732,7 +17736,15 @@ var BABYLON;
             _this.mode = Camera.PERSPECTIVE_CAMERA;
             _this.isIntermediate = false;
             _this.viewport = new BABYLON.Viewport(0, 0, 1.0, 1.0);
+            /**
+            * Restricts the camera to viewing objects with the same layerMask.
+            * A camera with a layerMask of 1 will render meshes with no layerMask and meshes with a layerMask of 1.
+            */
             _this.layerMask = 0x0FFFFFFF;
+            /**
+            * default : FOVMODE_VERTICAL_FIXED
+            * fovMode sets the camera frustum bounds to the viewport bounds.
+            */
             _this.fovMode = Camera.FOVMODE_VERTICAL_FIXED;
             // Camera rig members
             _this.cameraRigMode = Camera.RIG_MODE_NONE;
@@ -17776,6 +17788,11 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Camera, "FOVMODE_VERTICAL_FIXED", {
+            /**
+             * This is the default FOV mode for perspective cameras.
+             * This setting aligns the upper and lower bounds of the viewport to the upper and lower bounds of the camera frustum.
+             *
+             */
             get: function () {
                 return Camera._FOVMODE_VERTICAL_FIXED;
             },
@@ -17783,6 +17800,10 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Camera, "FOVMODE_HORIZONTAL_FIXED", {
+            /**
+             * This setting aligns the left and right bounds of the viewport to the left and right bounds of the camera frustum.
+             *
+             */
             get: function () {
                 return Camera._FOVMODE_HORIZONTAL_FIXED;
             },
@@ -17993,7 +18014,7 @@ var BABYLON;
             for (var i = 0, len = this._rigCameras.length; i < len; i++) {
                 var cam = this._rigCameras[i];
                 var rigPostProcess = cam._rigPostProcess;
-                // for VR rig, there does not have to be a post process 
+                // for VR rig, there does not have to be a post process
                 if (rigPostProcess) {
                     var isPass = rigPostProcess instanceof BABYLON.PassPostProcess;
                     if (isPass) {
@@ -18020,7 +18041,7 @@ var BABYLON;
             else {
                 this._postProcesses.splice(insertAt, 0, postProcess);
             }
-            this._cascadePostProcessesToRigCams(); // also ensures framebuffer invalidated            
+            this._cascadePostProcessesToRigCams(); // also ensures framebuffer invalidated
             return this._postProcesses.indexOf(postProcess);
         };
         Camera.prototype.detachPostProcess = function (postProcess) {
@@ -18253,7 +18274,7 @@ var BABYLON;
             }
             this.cameraRigMode = mode;
             this._cameraRigParams = {};
-            //we have to implement stereo camera calcultating left and right viewpoints from interaxialDistance and target, 
+            //we have to implement stereo camera calcultating left and right viewpoints from interaxialDistance and target,
             //not from a given angle as it is now, but until that complete code rewriting provisional stereoHalfAngle value is introduced
             this._cameraRigParams.interaxialDistance = rigParams.interaxialDistance || 0.0637;
             this._cameraRigParams.stereoHalfAngle = BABYLON.Tools.ToRadians(this._cameraRigParams.interaxialDistance / 0.0637);
@@ -58172,7 +58193,8 @@ var BABYLON;
         PoseEnabledControllerType[PoseEnabledControllerType["VIVE"] = 0] = "VIVE";
         PoseEnabledControllerType[PoseEnabledControllerType["OCULUS"] = 1] = "OCULUS";
         PoseEnabledControllerType[PoseEnabledControllerType["WINDOWS"] = 2] = "WINDOWS";
-        PoseEnabledControllerType[PoseEnabledControllerType["GENERIC"] = 3] = "GENERIC";
+        PoseEnabledControllerType[PoseEnabledControllerType["GEAR_VR"] = 3] = "GEAR_VR";
+        PoseEnabledControllerType[PoseEnabledControllerType["GENERIC"] = 4] = "GENERIC";
     })(PoseEnabledControllerType = BABYLON.PoseEnabledControllerType || (BABYLON.PoseEnabledControllerType = {}));
     var PoseEnabledControllerHelper = /** @class */ (function () {
         function PoseEnabledControllerHelper() {
@@ -58188,6 +58210,9 @@ var BABYLON;
             else if (vrGamepad.id.toLowerCase().indexOf('openvr') !== -1) {
                 return new BABYLON.ViveController(vrGamepad);
             }
+            else if (vrGamepad.id.indexOf(BABYLON.GearVRController.GAMEPAD_ID_PREFIX) === 0) {
+                return new BABYLON.GearVRController(vrGamepad);
+            }
             else {
                 return new BABYLON.GenericController(vrGamepad);
             }
@@ -59046,6 +59071,50 @@ var BABYLON;
 //# sourceMappingURL=babylon.windowsMotionController.js.map
 
 
+var BABYLON;
+(function (BABYLON) {
+    var GearVRController = /** @class */ (function (_super) {
+        __extends(GearVRController, _super);
+        function GearVRController(vrGamepad) {
+            var _this = _super.call(this, vrGamepad) || this;
+            _this._buttonIndexToObservableNameMap = [
+                'onTrackpadChangedObservable',
+                'onTriggerStateChangedObservable' // Trigger
+            ];
+            _this.controllerType = BABYLON.PoseEnabledControllerType.GEAR_VR;
+            return _this;
+        }
+        GearVRController.prototype.initControllerMesh = function (scene, meshLoaded) {
+            var _this = this;
+            BABYLON.SceneLoader.ImportMesh("", GearVRController.MODEL_BASE_URL, GearVRController.MODEL_FILENAME, scene, function (newMeshes) {
+                _this._defaultModel = newMeshes[1];
+                _this.attachToMesh(_this._defaultModel);
+                if (meshLoaded) {
+                    meshLoaded(_this._defaultModel);
+                }
+            });
+        };
+        GearVRController.prototype.handleButtonChange = function (buttonIdx, state, changes) {
+            if (buttonIdx < this._buttonIndexToObservableNameMap.length) {
+                var observableName = this._buttonIndexToObservableNameMap[buttonIdx];
+                // Only emit events for buttons that we know how to map from index to observable
+                var observable = this[observableName];
+                if (observable) {
+                    observable.notifyObservers(state);
+                }
+            }
+        };
+        GearVRController.MODEL_BASE_URL = 'https://controllers.babylonjs.com/generic/';
+        GearVRController.MODEL_FILENAME = 'generic.babylon';
+        GearVRController.GAMEPAD_ID_PREFIX = 'Gear VR'; // id is 'Gear VR Controller'
+        return GearVRController;
+    }(BABYLON.WebVRController));
+    BABYLON.GearVRController = GearVRController;
+})(BABYLON || (BABYLON = {}));
+
+//# sourceMappingURL=babylon.gearVRController.js.map
+
+
 
 
 

+ 2 - 0
dist/preview release/gui/babylon.gui.d.ts

@@ -441,6 +441,7 @@ declare module BABYLON.GUI {
         private _borderColor;
         private _barOffset;
         private _isThumbCircle;
+        private _isThumbClamped;
         onValueChangedObservable: Observable<number>;
         borderColor: string;
         background: string;
@@ -452,6 +453,7 @@ declare module BABYLON.GUI {
         maximum: number;
         value: number;
         isThumbCircle: boolean;
+        isThumbClamped: boolean;
         constructor(name?: string | undefined);
         protected _getTypeName(): string;
         _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;

+ 38 - 15
dist/preview release/gui/babylon.gui.js

@@ -2622,6 +2622,7 @@ var BABYLON;
                 _this._borderColor = "white";
                 _this._barOffset = new GUI.ValueAndUnit(5, GUI.ValueAndUnit.UNITMODE_PIXEL, false);
                 _this._isThumbCircle = false;
+                _this._isThumbClamped = false;
                 _this.onValueChangedObservable = new BABYLON.Observable();
                 // Events
                 _this._pointerIsDown = false;
@@ -2760,6 +2761,20 @@ var BABYLON;
                 enumerable: true,
                 configurable: true
             });
+            Object.defineProperty(Slider.prototype, "isThumbClamped", {
+                get: function () {
+                    return this._isThumbClamped;
+                },
+                set: function (value) {
+                    if (this._isThumbClamped === value) {
+                        return;
+                    }
+                    this._isThumbClamped = value;
+                    this._markAsDirty();
+                },
+                enumerable: true,
+                configurable: true
+            });
             Slider.prototype._getTypeName = function () {
                 return "Slider";
             };
@@ -2770,12 +2785,6 @@ var BABYLON;
                     // Main bar
                     var effectiveThumbWidth;
                     var effectiveBarOffset;
-                    if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {
-                        context.shadowColor = this.shadowColor;
-                        context.shadowBlur = this.shadowBlur;
-                        context.shadowOffsetX = this.shadowOffsetX;
-                        context.shadowOffsetY = this.shadowOffsetY;
-                    }
                     if (this._thumbWidth.isPixel) {
                         effectiveThumbWidth = Math.min(this._thumbWidth.getValue(this._host), this._currentMeasure.width);
                     }
@@ -2788,29 +2797,43 @@ var BABYLON;
                     else {
                         effectiveBarOffset = this._currentMeasure.height * this._barOffset.getValue(this._host);
                     }
-                    var left = this._currentMeasure.left + effectiveThumbWidth / 2;
+                    if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {
+                        context.shadowColor = this.shadowColor;
+                        context.shadowBlur = this.shadowBlur;
+                        context.shadowOffsetX = this.shadowOffsetX;
+                        context.shadowOffsetY = this.shadowOffsetY;
+                    }
+                    var left = this._currentMeasure.left;
                     var width = this._currentMeasure.width - effectiveThumbWidth;
-                    var thumbPosition = (this._value - this._minimum) / (this._maximum - this._minimum) * width;
-                    // Bar
+                    var thumbPosition = ((this._value - this._minimum) / (this._maximum - this._minimum)) * width;
                     context.fillStyle = this._background;
-                    context.fillRect(left, this._currentMeasure.top + effectiveBarOffset, width, this._currentMeasure.height - effectiveBarOffset * 2);
+                    if (this.isThumbClamped) {
+                        context.fillRect(left, this._currentMeasure.top + effectiveBarOffset, width + effectiveThumbWidth, this._currentMeasure.height - effectiveBarOffset * 2);
+                    }
+                    else {
+                        context.fillRect(left + (effectiveThumbWidth / 2), this._currentMeasure.top + effectiveBarOffset, width, this._currentMeasure.height - effectiveBarOffset * 2);
+                    }
                     if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {
                         context.shadowBlur = 0;
                         context.shadowOffsetX = 0;
                         context.shadowOffsetY = 0;
                     }
                     context.fillStyle = this.color;
-                    context.fillRect(left, this._currentMeasure.top + effectiveBarOffset, thumbPosition, this._currentMeasure.height - effectiveBarOffset * 2);
+                    if (this.isThumbClamped) {
+                        context.fillRect(left, this._currentMeasure.top + effectiveBarOffset, width + effectiveThumbWidth, this._currentMeasure.height - effectiveBarOffset * 2);
+                    }
+                    else {
+                        context.fillRect(left + (effectiveThumbWidth / 2), this._currentMeasure.top + effectiveBarOffset, width, this._currentMeasure.height - effectiveBarOffset * 2);
+                    }
                     if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {
                         context.shadowColor = this.shadowColor;
                         context.shadowBlur = this.shadowBlur;
                         context.shadowOffsetX = this.shadowOffsetX;
                         context.shadowOffsetY = this.shadowOffsetY;
                     }
-                    // Thumb
                     if (this._isThumbCircle) {
                         context.beginPath();
-                        context.arc(left + thumbPosition, this._currentMeasure.top + this._currentMeasure.height / 2, effectiveThumbWidth / 2, 0, 2 * Math.PI);
+                        context.arc(left + thumbPosition + (effectiveThumbWidth / 2), this._currentMeasure.top + this._currentMeasure.height / 2, effectiveThumbWidth / 2, 0, 2 * Math.PI);
                         context.fill();
                         if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {
                             context.shadowBlur = 0;
@@ -2821,14 +2844,14 @@ var BABYLON;
                         context.stroke();
                     }
                     else {
-                        context.fillRect(left + thumbPosition - effectiveThumbWidth / 2, this._currentMeasure.top, effectiveThumbWidth, this._currentMeasure.height);
+                        context.fillRect(left + thumbPosition, this._currentMeasure.top, effectiveThumbWidth, this._currentMeasure.height);
                         if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {
                             context.shadowBlur = 0;
                             context.shadowOffsetX = 0;
                             context.shadowOffsetY = 0;
                         }
                         context.strokeStyle = this._borderColor;
-                        context.strokeRect(left + thumbPosition - effectiveThumbWidth / 2, this._currentMeasure.top, effectiveThumbWidth, this._currentMeasure.height);
+                        context.strokeRect(left + thumbPosition, this._currentMeasure.top, effectiveThumbWidth, this._currentMeasure.height);
                     }
                 }
                 context.restore();

Разница между файлами не показана из-за своего большого размера
+ 2 - 2
dist/preview release/gui/babylon.gui.min.js


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

@@ -447,6 +447,7 @@ declare module BABYLON.GUI {
         private _borderColor;
         private _barOffset;
         private _isThumbCircle;
+        private _isThumbClamped;
         onValueChangedObservable: Observable<number>;
         borderColor: string;
         background: string;
@@ -458,6 +459,7 @@ declare module BABYLON.GUI {
         maximum: number;
         value: number;
         isThumbCircle: boolean;
+        isThumbClamped: boolean;
         constructor(name?: string | undefined);
         protected _getTypeName(): string;
         _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;

+ 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": "3.2.0-alpha0",
+    "version": "3.2.0-alpha2",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -28,7 +28,7 @@
     ],
     "license": "Apache-2.0",
     "peerDependencies": {
-        "babylonjs": ">=3.1.0-alpha"
+        "babylonjs": ">=3.2.0-alpha"
     },
     "engines": {
         "node": "*"

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

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-inspector",
     "description": "The Babylon.js inspector.",
-    "version": "3.2.0-alpha0",
+    "version": "3.2.0-alpha2",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -25,7 +25,7 @@
     ],
     "license": "Apache-2.0",
     "peerDependencies": {
-        "babylonjs": ">=3.1.0-alpha"
+        "babylonjs": ">=3.2.0-alpha"
     },
     "engines": {
         "node": "*"

+ 2 - 2
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": "3.2.0-alpha0",
+    "version": "3.2.0-alpha2",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -27,7 +27,7 @@
     ],
     "license": "Apache-2.0",
     "peerDependencies": {
-        "babylonjs": ">=3.1.0-alpha"
+        "babylonjs": ">=3.2.0-alpha"
     },
     "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": "3.2.0-alpha0",
+    "version": "3.2.0-alpha2",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -27,7 +27,7 @@
     ],
     "license": "Apache-2.0",
     "peerDependencies": {
-        "babylonjs": ">=3.1.0-alpha"
+        "babylonjs": ">=3.2.0-alpha"
     },
     "engines": {
         "node": "*"

Разница между файлами не показана из-за своего большого размера
+ 17 - 17
dist/preview release/modules/actions/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 17 - 17
dist/preview release/modules/additionalCameras/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 17 - 17
dist/preview release/modules/additionalMeshes/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 16 - 16
dist/preview release/modules/additionalPostProcess_blur/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 17 - 17
dist/preview release/modules/additionalPostProcess_fxaa/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 17 - 17
dist/preview release/modules/additionalPostProcess_highlights/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 17 - 17
dist/preview release/modules/additionalPostProcess_imageProcessing/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 17 - 17
dist/preview release/modules/additionalPostProcesses/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 17 - 17
dist/preview release/modules/additionalRenderingPipeline/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 16 - 16
dist/preview release/modules/additionalTextures/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 16 - 16
dist/preview release/modules/animations/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 16 - 16
dist/preview release/modules/arcRotateCamera/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 16 - 16
dist/preview release/modules/assetsManager/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 16 - 16
dist/preview release/modules/audio/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 17 - 17
dist/preview release/modules/backgroundMaterial/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 16 - 16
dist/preview release/modules/bones/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 16 - 16
dist/preview release/modules/cameraBehaviors/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 17 - 17
dist/preview release/modules/collisions/index.d.ts


+ 84 - 8
dist/preview release/modules/core/es6.js

@@ -1730,6 +1730,13 @@ var BABYLON;
             return this;
         };
         /**
+         * Divides the current Vector3 coordinates by the passed ones.
+         * Returns the updated Vector3.
+         */
+        Vector2.prototype.divideInPlace = function (otherVector) {
+            return this.divideToRef(otherVector, this);
+        };
+        /**
          * Returns a new Vector2 with current Vector2 negated coordinates.
          */
         Vector2.prototype.negate = function () {
@@ -2205,6 +2212,13 @@ var BABYLON;
             return this;
         };
         /**
+         * Divides the current Vector3 coordinates by the passed ones.
+         * Returns the updated Vector3.
+         */
+        Vector3.prototype.divideInPlace = function (otherVector) {
+            return this.divideToRef(otherVector, this);
+        };
+        /**
          * Updates the current Vector3 with the minimal coordinate values between its and the passed vector ones.
          * Returns the updated Vector3.
          */
@@ -2934,6 +2948,13 @@ var BABYLON;
             return this;
         };
         /**
+         * Divides the current Vector3 coordinates by the passed ones.
+         * Returns the updated Vector3.
+         */
+        Vector4.prototype.divideInPlace = function (otherVector) {
+            return this.divideToRef(otherVector, this);
+        };
+        /**
          * Updates the Vector4 coordinates with the minimum values between its own and the passed vector ones.
          */
         Vector4.prototype.MinimizeInPlace = function (other) {
@@ -6423,10 +6444,11 @@ var BABYLON;
         /**
          * Remove a callback from the Observable object
          * @param callback the callback to remove. If it doesn't belong to this Observable, false will be returned.
+         * @param scope optional scope. If used only the callbacks with this scope will be removed.
         */
-        Observable.prototype.removeCallback = function (callback) {
+        Observable.prototype.removeCallback = function (callback, scope) {
             for (var index = 0; index < this._observers.length; index++) {
-                if (this._observers[index].callback === callback) {
+                if (this._observers[index].callback === callback && (!scope || scope === this._observers[index].scope)) {
                     this._observers.splice(index, 1);
                     return true;
                 }
@@ -15201,7 +15223,6 @@ var BABYLON;
             this.getScene().stopAnimation(this);
             // Remove from scene
             this.getScene().removeTransformNode(this);
-            this._cache = {};
             if (!doNotRecurse) {
                 // Children
                 var objects = this.getDescendants(true);
@@ -17701,6 +17722,10 @@ var BABYLON;
             _this.orthoRight = null;
             _this.orthoBottom = null;
             _this.orthoTop = null;
+            /**
+             * default : 0.8
+             * FOV is set in Radians.
+             */
             _this.fov = 0.8;
             _this.minZ = 1;
             _this.maxZ = 10000.0;
@@ -17708,7 +17733,15 @@ var BABYLON;
             _this.mode = Camera.PERSPECTIVE_CAMERA;
             _this.isIntermediate = false;
             _this.viewport = new BABYLON.Viewport(0, 0, 1.0, 1.0);
+            /**
+            * Restricts the camera to viewing objects with the same layerMask.
+            * A camera with a layerMask of 1 will render meshes with no layerMask and meshes with a layerMask of 1.
+            */
             _this.layerMask = 0x0FFFFFFF;
+            /**
+            * default : FOVMODE_VERTICAL_FIXED
+            * fovMode sets the camera frustum bounds to the viewport bounds.
+            */
             _this.fovMode = Camera.FOVMODE_VERTICAL_FIXED;
             // Camera rig members
             _this.cameraRigMode = Camera.RIG_MODE_NONE;
@@ -17752,6 +17785,11 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Camera, "FOVMODE_VERTICAL_FIXED", {
+            /**
+             * This is the default FOV mode for perspective cameras.
+             * This setting aligns the upper and lower bounds of the viewport to the upper and lower bounds of the camera frustum.
+             *
+             */
             get: function () {
                 return Camera._FOVMODE_VERTICAL_FIXED;
             },
@@ -17759,6 +17797,10 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Camera, "FOVMODE_HORIZONTAL_FIXED", {
+            /**
+             * This setting aligns the left and right bounds of the viewport to the left and right bounds of the camera frustum.
+             *
+             */
             get: function () {
                 return Camera._FOVMODE_HORIZONTAL_FIXED;
             },
@@ -17969,7 +18011,7 @@ var BABYLON;
             for (var i = 0, len = this._rigCameras.length; i < len; i++) {
                 var cam = this._rigCameras[i];
                 var rigPostProcess = cam._rigPostProcess;
-                // for VR rig, there does not have to be a post process 
+                // for VR rig, there does not have to be a post process
                 if (rigPostProcess) {
                     var isPass = rigPostProcess instanceof BABYLON.PassPostProcess;
                     if (isPass) {
@@ -17996,7 +18038,7 @@ var BABYLON;
             else {
                 this._postProcesses.splice(insertAt, 0, postProcess);
             }
-            this._cascadePostProcessesToRigCams(); // also ensures framebuffer invalidated            
+            this._cascadePostProcessesToRigCams(); // also ensures framebuffer invalidated
             return this._postProcesses.indexOf(postProcess);
         };
         Camera.prototype.detachPostProcess = function (postProcess) {
@@ -18229,7 +18271,7 @@ var BABYLON;
             }
             this.cameraRigMode = mode;
             this._cameraRigParams = {};
-            //we have to implement stereo camera calcultating left and right viewpoints from interaxialDistance and target, 
+            //we have to implement stereo camera calcultating left and right viewpoints from interaxialDistance and target,
             //not from a given angle as it is now, but until that complete code rewriting provisional stereoHalfAngle value is introduced
             this._cameraRigParams.interaxialDistance = rigParams.interaxialDistance || 0.0637;
             this._cameraRigParams.stereoHalfAngle = BABYLON.Tools.ToRadians(this._cameraRigParams.interaxialDistance / 0.0637);
@@ -20767,6 +20809,34 @@ var BABYLON;
         Scene.prototype.unregisterAfterRender = function (func) {
             this.onAfterRenderObservable.removeCallback(func);
         };
+        Scene.prototype._executeOnceBeforeRender = function (func) {
+            var _this = this;
+            var execFunc = function () {
+                func();
+                setTimeout(function () {
+                    _this.unregisterBeforeRender(execFunc);
+                });
+            };
+            this.registerBeforeRender(execFunc);
+        };
+        /**
+         * The provided function will run before render once and will be disposed afterwards.
+         * A timeout delay can be provided so that the function will be executed in N ms.
+         * The timeout is using the browser's native setTimeout so time percision cannot be guaranteed.
+         * @param func The function to be executed.
+         * @param timeout optional delay in ms
+         */
+        Scene.prototype.executeOnceBeforeRender = function (func, timeout) {
+            var _this = this;
+            if (timeout !== undefined) {
+                setTimeout(function () {
+                    _this._executeOnceBeforeRender(func);
+                }, timeout);
+            }
+            else {
+                this._executeOnceBeforeRender(func);
+            }
+        };
         Scene.prototype._addPendingData = function (data) {
             this._pendingData.push(data);
         };
@@ -24550,12 +24620,18 @@ var BABYLON;
                     source._geometry.applyToMesh(_this);
                 }
                 // Deep copy
-                BABYLON.Tools.DeepCopy(source, _this, ["name", "material", "skeleton", "instances", "parent", "uniqueId", "source"], ["_poseMatrix", "_source"]);
+                BABYLON.Tools.DeepCopy(source, _this, ["name", "material", "skeleton", "instances", "parent", "uniqueId", "source", "metadata"], ["_poseMatrix", "_source"]);
+                // Metadata
+                if (source.metadata && source.metadata.clone) {
+                    _this.metadata = source.metadata.clone();
+                }
+                else {
+                    _this.metadata = source.metadata;
+                }
                 // Tags
                 if (BABYLON.Tags && BABYLON.Tags.HasTags(source)) {
                     BABYLON.Tags.AddTagsTo(_this, BABYLON.Tags.GetTags(source, true));
                 }
-                _this.metadata = source.metadata;
                 // Parent
                 _this.parent = source.parent;
                 // Pivot

Разница между файлами не показана из-за своего большого размера
+ 64 - 18
dist/preview release/modules/core/index.d.ts


+ 84 - 8
dist/preview release/modules/core/index.js

@@ -1733,6 +1733,13 @@ var BABYLON;
             return this;
         };
         /**
+         * Divides the current Vector3 coordinates by the passed ones.
+         * Returns the updated Vector3.
+         */
+        Vector2.prototype.divideInPlace = function (otherVector) {
+            return this.divideToRef(otherVector, this);
+        };
+        /**
          * Returns a new Vector2 with current Vector2 negated coordinates.
          */
         Vector2.prototype.negate = function () {
@@ -2208,6 +2215,13 @@ var BABYLON;
             return this;
         };
         /**
+         * Divides the current Vector3 coordinates by the passed ones.
+         * Returns the updated Vector3.
+         */
+        Vector3.prototype.divideInPlace = function (otherVector) {
+            return this.divideToRef(otherVector, this);
+        };
+        /**
          * Updates the current Vector3 with the minimal coordinate values between its and the passed vector ones.
          * Returns the updated Vector3.
          */
@@ -2937,6 +2951,13 @@ var BABYLON;
             return this;
         };
         /**
+         * Divides the current Vector3 coordinates by the passed ones.
+         * Returns the updated Vector3.
+         */
+        Vector4.prototype.divideInPlace = function (otherVector) {
+            return this.divideToRef(otherVector, this);
+        };
+        /**
          * Updates the Vector4 coordinates with the minimum values between its own and the passed vector ones.
          */
         Vector4.prototype.MinimizeInPlace = function (other) {
@@ -6426,10 +6447,11 @@ var BABYLON;
         /**
          * Remove a callback from the Observable object
          * @param callback the callback to remove. If it doesn't belong to this Observable, false will be returned.
+         * @param scope optional scope. If used only the callbacks with this scope will be removed.
         */
-        Observable.prototype.removeCallback = function (callback) {
+        Observable.prototype.removeCallback = function (callback, scope) {
             for (var index = 0; index < this._observers.length; index++) {
-                if (this._observers[index].callback === callback) {
+                if (this._observers[index].callback === callback && (!scope || scope === this._observers[index].scope)) {
                     this._observers.splice(index, 1);
                     return true;
                 }
@@ -15204,7 +15226,6 @@ var BABYLON;
             this.getScene().stopAnimation(this);
             // Remove from scene
             this.getScene().removeTransformNode(this);
-            this._cache = {};
             if (!doNotRecurse) {
                 // Children
                 var objects = this.getDescendants(true);
@@ -17704,6 +17725,10 @@ var BABYLON;
             _this.orthoRight = null;
             _this.orthoBottom = null;
             _this.orthoTop = null;
+            /**
+             * default : 0.8
+             * FOV is set in Radians.
+             */
             _this.fov = 0.8;
             _this.minZ = 1;
             _this.maxZ = 10000.0;
@@ -17711,7 +17736,15 @@ var BABYLON;
             _this.mode = Camera.PERSPECTIVE_CAMERA;
             _this.isIntermediate = false;
             _this.viewport = new BABYLON.Viewport(0, 0, 1.0, 1.0);
+            /**
+            * Restricts the camera to viewing objects with the same layerMask.
+            * A camera with a layerMask of 1 will render meshes with no layerMask and meshes with a layerMask of 1.
+            */
             _this.layerMask = 0x0FFFFFFF;
+            /**
+            * default : FOVMODE_VERTICAL_FIXED
+            * fovMode sets the camera frustum bounds to the viewport bounds.
+            */
             _this.fovMode = Camera.FOVMODE_VERTICAL_FIXED;
             // Camera rig members
             _this.cameraRigMode = Camera.RIG_MODE_NONE;
@@ -17755,6 +17788,11 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Camera, "FOVMODE_VERTICAL_FIXED", {
+            /**
+             * This is the default FOV mode for perspective cameras.
+             * This setting aligns the upper and lower bounds of the viewport to the upper and lower bounds of the camera frustum.
+             *
+             */
             get: function () {
                 return Camera._FOVMODE_VERTICAL_FIXED;
             },
@@ -17762,6 +17800,10 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Camera, "FOVMODE_HORIZONTAL_FIXED", {
+            /**
+             * This setting aligns the left and right bounds of the viewport to the left and right bounds of the camera frustum.
+             *
+             */
             get: function () {
                 return Camera._FOVMODE_HORIZONTAL_FIXED;
             },
@@ -17972,7 +18014,7 @@ var BABYLON;
             for (var i = 0, len = this._rigCameras.length; i < len; i++) {
                 var cam = this._rigCameras[i];
                 var rigPostProcess = cam._rigPostProcess;
-                // for VR rig, there does not have to be a post process 
+                // for VR rig, there does not have to be a post process
                 if (rigPostProcess) {
                     var isPass = rigPostProcess instanceof BABYLON.PassPostProcess;
                     if (isPass) {
@@ -17999,7 +18041,7 @@ var BABYLON;
             else {
                 this._postProcesses.splice(insertAt, 0, postProcess);
             }
-            this._cascadePostProcessesToRigCams(); // also ensures framebuffer invalidated            
+            this._cascadePostProcessesToRigCams(); // also ensures framebuffer invalidated
             return this._postProcesses.indexOf(postProcess);
         };
         Camera.prototype.detachPostProcess = function (postProcess) {
@@ -18232,7 +18274,7 @@ var BABYLON;
             }
             this.cameraRigMode = mode;
             this._cameraRigParams = {};
-            //we have to implement stereo camera calcultating left and right viewpoints from interaxialDistance and target, 
+            //we have to implement stereo camera calcultating left and right viewpoints from interaxialDistance and target,
             //not from a given angle as it is now, but until that complete code rewriting provisional stereoHalfAngle value is introduced
             this._cameraRigParams.interaxialDistance = rigParams.interaxialDistance || 0.0637;
             this._cameraRigParams.stereoHalfAngle = BABYLON.Tools.ToRadians(this._cameraRigParams.interaxialDistance / 0.0637);
@@ -20770,6 +20812,34 @@ var BABYLON;
         Scene.prototype.unregisterAfterRender = function (func) {
             this.onAfterRenderObservable.removeCallback(func);
         };
+        Scene.prototype._executeOnceBeforeRender = function (func) {
+            var _this = this;
+            var execFunc = function () {
+                func();
+                setTimeout(function () {
+                    _this.unregisterBeforeRender(execFunc);
+                });
+            };
+            this.registerBeforeRender(execFunc);
+        };
+        /**
+         * The provided function will run before render once and will be disposed afterwards.
+         * A timeout delay can be provided so that the function will be executed in N ms.
+         * The timeout is using the browser's native setTimeout so time percision cannot be guaranteed.
+         * @param func The function to be executed.
+         * @param timeout optional delay in ms
+         */
+        Scene.prototype.executeOnceBeforeRender = function (func, timeout) {
+            var _this = this;
+            if (timeout !== undefined) {
+                setTimeout(function () {
+                    _this._executeOnceBeforeRender(func);
+                }, timeout);
+            }
+            else {
+                this._executeOnceBeforeRender(func);
+            }
+        };
         Scene.prototype._addPendingData = function (data) {
             this._pendingData.push(data);
         };
@@ -24553,12 +24623,18 @@ var BABYLON;
                     source._geometry.applyToMesh(_this);
                 }
                 // Deep copy
-                BABYLON.Tools.DeepCopy(source, _this, ["name", "material", "skeleton", "instances", "parent", "uniqueId", "source"], ["_poseMatrix", "_source"]);
+                BABYLON.Tools.DeepCopy(source, _this, ["name", "material", "skeleton", "instances", "parent", "uniqueId", "source", "metadata"], ["_poseMatrix", "_source"]);
+                // Metadata
+                if (source.metadata && source.metadata.clone) {
+                    _this.metadata = source.metadata.clone();
+                }
+                else {
+                    _this.metadata = source.metadata;
+                }
                 // Tags
                 if (BABYLON.Tags && BABYLON.Tags.HasTags(source)) {
                     BABYLON.Tags.AddTagsTo(_this, BABYLON.Tags.GetTags(source, true));
                 }
-                _this.metadata = source.metadata;
                 // Parent
                 _this.parent = source.parent;
                 // Pivot

Разница между файлами не показана из-за своего большого размера
+ 17 - 17
dist/preview release/modules/csg/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 380 - 1
dist/preview release/modules/debug/es6.js


Разница между файлами не показана из-за своего большого размера
+ 96 - 16
dist/preview release/modules/debug/index.d.ts


+ 379 - 1
dist/preview release/modules/debug/index.js

@@ -23,6 +23,384 @@ var BABYLON3 = require('babylonjs/stringDictionary');
 if(BABYLON !== BABYLON3) __extends(BABYLON, BABYLON3);
 var BABYLON4 = require('babylonjs/actions');
 if(BABYLON !== BABYLON4) __extends(BABYLON, BABYLON4);
+
+var BABYLON;
+(function (BABYLON) {
+    var Debug = /** @class */ (function () {
+        function Debug() {
+        }
+        Debug.AxesViewer = /** @class */ (function () {
+            function AxesViewer(scene, scaleLines) {
+                if (scaleLines === void 0) { scaleLines = 1; }
+                this._xline = [BABYLON.Vector3.Zero(), BABYLON.Vector3.Zero()];
+                this._yline = [BABYLON.Vector3.Zero(), BABYLON.Vector3.Zero()];
+                this._zline = [BABYLON.Vector3.Zero(), BABYLON.Vector3.Zero()];
+                this.scaleLines = 1;
+                this.scaleLines = scaleLines;
+                this._xmesh = BABYLON.Mesh.CreateLines("xline", this._xline, scene, true);
+                this._ymesh = BABYLON.Mesh.CreateLines("yline", this._yline, scene, true);
+                this._zmesh = BABYLON.Mesh.CreateLines("zline", this._zline, scene, true);
+                this._xmesh.renderingGroupId = 2;
+                this._ymesh.renderingGroupId = 2;
+                this._zmesh.renderingGroupId = 2;
+                this._xmesh.material.checkReadyOnlyOnce = true;
+                this._xmesh.color = new BABYLON.Color3(1, 0, 0);
+                this._ymesh.material.checkReadyOnlyOnce = true;
+                this._ymesh.color = new BABYLON.Color3(0, 1, 0);
+                this._zmesh.material.checkReadyOnlyOnce = true;
+                this._zmesh.color = new BABYLON.Color3(0, 0, 1);
+                this.scene = scene;
+            }
+            AxesViewer.prototype.update = function (position, xaxis, yaxis, zaxis) {
+                var scaleLines = this.scaleLines;
+                if (this._xmesh) {
+                    this._xmesh.position.copyFrom(position);
+                }
+                if (this._ymesh) {
+                    this._ymesh.position.copyFrom(position);
+                }
+                if (this._zmesh) {
+                    this._zmesh.position.copyFrom(position);
+                }
+                var point2 = this._xline[1];
+                point2.x = xaxis.x * scaleLines;
+                point2.y = xaxis.y * scaleLines;
+                point2.z = xaxis.z * scaleLines;
+                BABYLON.Mesh.CreateLines("", this._xline, null, false, this._xmesh);
+                point2 = this._yline[1];
+                point2.x = yaxis.x * scaleLines;
+                point2.y = yaxis.y * scaleLines;
+                point2.z = yaxis.z * scaleLines;
+                BABYLON.Mesh.CreateLines("", this._yline, null, false, this._ymesh);
+                point2 = this._zline[1];
+                point2.x = zaxis.x * scaleLines;
+                point2.y = zaxis.y * scaleLines;
+                point2.z = zaxis.z * scaleLines;
+                BABYLON.Mesh.CreateLines("", this._zline, null, false, this._zmesh);
+            };
+            AxesViewer.prototype.dispose = function () {
+                if (this._xmesh) {
+                    this._xmesh.dispose();
+                }
+                if (this._ymesh) {
+                    this._ymesh.dispose();
+                }
+                if (this._zmesh) {
+                    this._zmesh.dispose();
+                }
+                this._xmesh = null;
+                this._ymesh = null;
+                this._zmesh = null;
+                this.scene = null;
+            };
+            return AxesViewer;
+        }());
+        Debug.BoneAxesViewer = /** @class */ (function (_super) {
+            __extends(BoneAxesViewer, _super);
+            function BoneAxesViewer(scene, bone, mesh, scaleLines) {
+                if (scaleLines === void 0) { scaleLines = 1; }
+                var _this = _super.call(this, scene, scaleLines) || this;
+                _this.pos = BABYLON.Vector3.Zero();
+                _this.xaxis = BABYLON.Vector3.Zero();
+                _this.yaxis = BABYLON.Vector3.Zero();
+                _this.zaxis = BABYLON.Vector3.Zero();
+                _this.mesh = mesh;
+                _this.bone = bone;
+                return _this;
+            }
+            BoneAxesViewer.prototype.update = function () {
+                if (!this.mesh || !this.bone) {
+                    return;
+                }
+                var bone = this.bone;
+                bone.getAbsolutePositionToRef(this.mesh, this.pos);
+                bone.getDirectionToRef(BABYLON.Axis.X, this.mesh, this.xaxis);
+                bone.getDirectionToRef(BABYLON.Axis.Y, this.mesh, this.yaxis);
+                bone.getDirectionToRef(BABYLON.Axis.Z, this.mesh, this.zaxis);
+                _super.prototype.update.call(this, this.pos, this.xaxis, this.yaxis, this.zaxis);
+            };
+            BoneAxesViewer.prototype.dispose = function () {
+                if (this.mesh) {
+                    this.mesh = null;
+                    this.bone = null;
+                    _super.prototype.dispose.call(this);
+                }
+            };
+            return BoneAxesViewer;
+        }(Debug.AxesViewer));
+        Debug.PhysicsViewer = /** @class */ (function () {
+            function PhysicsViewer(scene) {
+                this._impostors = [];
+                this._meshes = [];
+                this._numMeshes = 0;
+                this._scene = scene || BABYLON.Engine.LastCreatedScene;
+                var physicEngine = this._scene.getPhysicsEngine();
+                if (physicEngine) {
+                    this._physicsEnginePlugin = physicEngine.getPhysicsPlugin();
+                }
+            }
+            PhysicsViewer.prototype._updateDebugMeshes = function () {
+                var plugin = this._physicsEnginePlugin;
+                for (var i = 0; i < this._numMeshes; i++) {
+                    var impostor = this._impostors[i];
+                    if (!impostor) {
+                        continue;
+                    }
+                    if (impostor.isDisposed) {
+                        this.hideImpostor(this._impostors[i--]);
+                    }
+                    else {
+                        var mesh = this._meshes[i];
+                        if (mesh && plugin) {
+                            plugin.syncMeshWithImpostor(mesh, impostor);
+                        }
+                    }
+                }
+            };
+            PhysicsViewer.prototype.showImpostor = function (impostor) {
+                if (!this._scene) {
+                    return;
+                }
+                for (var i = 0; i < this._numMeshes; i++) {
+                    if (this._impostors[i] == impostor) {
+                        return;
+                    }
+                }
+                var debugMesh = this._getDebugMesh(impostor, this._scene);
+                if (debugMesh) {
+                    this._impostors[this._numMeshes] = impostor;
+                    this._meshes[this._numMeshes] = debugMesh;
+                    if (this._numMeshes === 0) {
+                        this._renderFunction = this._updateDebugMeshes.bind(this);
+                        this._scene.registerBeforeRender(this._renderFunction);
+                    }
+                    this._numMeshes++;
+                }
+            };
+            PhysicsViewer.prototype.hideImpostor = function (impostor) {
+                if (!impostor || !this._scene) {
+                    return;
+                }
+                var removed = false;
+                for (var i = 0; i < this._numMeshes; i++) {
+                    if (this._impostors[i] == impostor) {
+                        var mesh = this._meshes[i];
+                        if (!mesh) {
+                            continue;
+                        }
+                        this._scene.removeMesh(mesh);
+                        mesh.dispose();
+                        this._numMeshes--;
+                        if (this._numMeshes > 0) {
+                            this._meshes[i] = this._meshes[this._numMeshes];
+                            this._impostors[i] = this._impostors[this._numMeshes];
+                            this._meshes[this._numMeshes] = null;
+                            this._impostors[this._numMeshes] = null;
+                        }
+                        else {
+                            this._meshes[0] = null;
+                            this._impostors[0] = null;
+                        }
+                        removed = true;
+                        break;
+                    }
+                }
+                if (removed && this._numMeshes === 0) {
+                    this._scene.unregisterBeforeRender(this._renderFunction);
+                }
+            };
+            PhysicsViewer.prototype._getDebugMaterial = function (scene) {
+                if (!this._debugMaterial) {
+                    this._debugMaterial = new BABYLON.StandardMaterial('', scene);
+                    this._debugMaterial.wireframe = true;
+                }
+                return this._debugMaterial;
+            };
+            PhysicsViewer.prototype._getDebugBoxMesh = function (scene) {
+                if (!this._debugBoxMesh) {
+                    this._debugBoxMesh = BABYLON.MeshBuilder.CreateBox('physicsBodyBoxViewMesh', { size: 1 }, scene);
+                    this._debugBoxMesh.renderingGroupId = 1;
+                    this._debugBoxMesh.rotationQuaternion = BABYLON.Quaternion.Identity();
+                    this._debugBoxMesh.material = this._getDebugMaterial(scene);
+                    scene.removeMesh(this._debugBoxMesh);
+                }
+                return this._debugBoxMesh.createInstance('physicsBodyBoxViewInstance');
+            };
+            PhysicsViewer.prototype._getDebugSphereMesh = function (scene) {
+                if (!this._debugSphereMesh) {
+                    this._debugSphereMesh = BABYLON.MeshBuilder.CreateSphere('physicsBodySphereViewMesh', { diameter: 1 }, scene);
+                    this._debugSphereMesh.renderingGroupId = 1;
+                    this._debugSphereMesh.rotationQuaternion = BABYLON.Quaternion.Identity();
+                    this._debugSphereMesh.material = this._getDebugMaterial(scene);
+                    scene.removeMesh(this._debugSphereMesh);
+                }
+                return this._debugSphereMesh.createInstance('physicsBodyBoxViewInstance');
+            };
+            PhysicsViewer.prototype._getDebugMesh = function (impostor, scene) {
+                var mesh = null;
+                if (impostor.type == BABYLON.PhysicsImpostor.BoxImpostor) {
+                    mesh = this._getDebugBoxMesh(scene);
+                    impostor.getBoxSizeToRef(mesh.scaling);
+                }
+                else if (impostor.type == BABYLON.PhysicsImpostor.SphereImpostor) {
+                    mesh = this._getDebugSphereMesh(scene);
+                    var radius = impostor.getRadius();
+                    mesh.scaling.x = radius * 2;
+                    mesh.scaling.y = radius * 2;
+                    mesh.scaling.z = radius * 2;
+                }
+                return mesh;
+            };
+            PhysicsViewer.prototype.dispose = function () {
+                for (var i = 0; i < this._numMeshes; i++) {
+                    this.hideImpostor(this._impostors[i]);
+                }
+                if (this._debugBoxMesh) {
+                    this._debugBoxMesh.dispose();
+                }
+                if (this._debugSphereMesh) {
+                    this._debugSphereMesh.dispose();
+                }
+                if (this._debugMaterial) {
+                    this._debugMaterial.dispose();
+                }
+                this._impostors.length = 0;
+                this._scene = null;
+                this._physicsEnginePlugin = null;
+            };
+            return PhysicsViewer;
+        }());
+        Debug.SkeletonViewer = /** @class */ (function () {
+            function SkeletonViewer(skeleton, mesh, scene, autoUpdateBonesMatrices, renderingGroupId) {
+                if (autoUpdateBonesMatrices === void 0) { autoUpdateBonesMatrices = true; }
+                if (renderingGroupId === void 0) { renderingGroupId = 1; }
+                this.skeleton = skeleton;
+                this.mesh = mesh;
+                this.autoUpdateBonesMatrices = autoUpdateBonesMatrices;
+                this.renderingGroupId = renderingGroupId;
+                this.color = BABYLON.Color3.White();
+                this._debugLines = new Array();
+                this._isEnabled = false;
+                this._scene = scene;
+                this.update();
+                this._renderFunction = this.update.bind(this);
+            }
+            Object.defineProperty(SkeletonViewer.prototype, "isEnabled", {
+                get: function () {
+                    return this._isEnabled;
+                },
+                set: function (value) {
+                    if (this._isEnabled === value) {
+                        return;
+                    }
+                    this._isEnabled = value;
+                    if (value) {
+                        this._scene.registerBeforeRender(this._renderFunction);
+                    }
+                    else {
+                        this._scene.unregisterBeforeRender(this._renderFunction);
+                    }
+                },
+                enumerable: true,
+                configurable: true
+            });
+            SkeletonViewer.prototype._getBonePosition = function (position, bone, meshMat, x, y, z) {
+                if (x === void 0) { x = 0; }
+                if (y === void 0) { y = 0; }
+                if (z === void 0) { z = 0; }
+                var tmat = BABYLON.Tmp.Matrix[0];
+                var parentBone = bone.getParent();
+                tmat.copyFrom(bone.getLocalMatrix());
+                if (x !== 0 || y !== 0 || z !== 0) {
+                    var tmat2 = BABYLON.Tmp.Matrix[1];
+                    BABYLON.Matrix.IdentityToRef(tmat2);
+                    tmat2.m[12] = x;
+                    tmat2.m[13] = y;
+                    tmat2.m[14] = z;
+                    tmat2.multiplyToRef(tmat, tmat);
+                }
+                if (parentBone) {
+                    tmat.multiplyToRef(parentBone.getAbsoluteTransform(), tmat);
+                }
+                tmat.multiplyToRef(meshMat, tmat);
+                position.x = tmat.m[12];
+                position.y = tmat.m[13];
+                position.z = tmat.m[14];
+            };
+            SkeletonViewer.prototype._getLinesForBonesWithLength = function (bones, meshMat) {
+                var len = bones.length;
+                var meshPos = this.mesh.position;
+                for (var i = 0; i < len; i++) {
+                    var bone = bones[i];
+                    var points = this._debugLines[i];
+                    if (!points) {
+                        points = [BABYLON.Vector3.Zero(), BABYLON.Vector3.Zero()];
+                        this._debugLines[i] = points;
+                    }
+                    this._getBonePosition(points[0], bone, meshMat);
+                    this._getBonePosition(points[1], bone, meshMat, 0, bone.length, 0);
+                    points[0].subtractInPlace(meshPos);
+                    points[1].subtractInPlace(meshPos);
+                }
+            };
+            SkeletonViewer.prototype._getLinesForBonesNoLength = function (bones, meshMat) {
+                var len = bones.length;
+                var boneNum = 0;
+                var meshPos = this.mesh.position;
+                for (var i = len - 1; i >= 0; i--) {
+                    var childBone = bones[i];
+                    var parentBone = childBone.getParent();
+                    if (!parentBone) {
+                        continue;
+                    }
+                    var points = this._debugLines[boneNum];
+                    if (!points) {
+                        points = [BABYLON.Vector3.Zero(), BABYLON.Vector3.Zero()];
+                        this._debugLines[boneNum] = points;
+                    }
+                    childBone.getAbsolutePositionToRef(this.mesh, points[0]);
+                    parentBone.getAbsolutePositionToRef(this.mesh, points[1]);
+                    points[0].subtractInPlace(meshPos);
+                    points[1].subtractInPlace(meshPos);
+                    boneNum++;
+                }
+            };
+            SkeletonViewer.prototype.update = function () {
+                if (this.autoUpdateBonesMatrices) {
+                    this.skeleton.computeAbsoluteTransforms();
+                }
+                if (this.skeleton.bones[0].length === undefined) {
+                    this._getLinesForBonesNoLength(this.skeleton.bones, this.mesh.getWorldMatrix());
+                }
+                else {
+                    this._getLinesForBonesWithLength(this.skeleton.bones, this.mesh.getWorldMatrix());
+                }
+                if (!this._debugMesh) {
+                    this._debugMesh = BABYLON.MeshBuilder.CreateLineSystem("", { lines: this._debugLines, updatable: true, instance: null }, this._scene);
+                    this._debugMesh.renderingGroupId = this.renderingGroupId;
+                }
+                else {
+                    BABYLON.MeshBuilder.CreateLineSystem("", { lines: this._debugLines, updatable: true, instance: this._debugMesh }, this._scene);
+                }
+                this._debugMesh.position.copyFrom(this.mesh.position);
+                this._debugMesh.color = this.color;
+            };
+            SkeletonViewer.prototype.dispose = function () {
+                if (this._debugMesh) {
+                    this.isEnabled = false;
+                    this._debugMesh.dispose();
+                    this._debugMesh = null;
+                }
+            };
+            return SkeletonViewer;
+        }());
+        return Debug;
+    }());
+    BABYLON.Debug = Debug;
+})(BABYLON || (BABYLON = {}));
+
+//# sourceMappingURL=babylon.debugModules.js.map
+
 var BABYLON;
 (function (BABYLON) {
     var RayHelper = /** @class */ (function () {
@@ -371,7 +749,7 @@ BABYLON.Effect.IncludesShadersStore['lightFragment'] = "#ifdef LIGHT{X}\n#if def
 BABYLON.Effect.IncludesShadersStore['logDepthFragment'] = "#ifdef LOGARITHMICDEPTH\ngl_FragDepthEXT=log2(vFragmentDepth)*logarithmicDepthConstant*0.5;\n#endif";
 BABYLON.Effect.IncludesShadersStore['fogFragment'] = "#ifdef FOG\nfloat fog=CalcFogFactor();\ncolor.rgb=fog*color.rgb+(1.0-fog)*vFogColor;\n#endif";
 (function() {
-var EXPORTS = {};EXPORTS['RayHelper'] = BABYLON['RayHelper'];EXPORTS['DebugLayer'] = BABYLON['DebugLayer'];EXPORTS['BoundingBoxRenderer'] = BABYLON['BoundingBoxRenderer'];
+var EXPORTS = {};EXPORTS['Debug'] = BABYLON['Debug'];EXPORTS['RayHelper'] = BABYLON['RayHelper'];EXPORTS['DebugLayer'] = BABYLON['DebugLayer'];EXPORTS['BoundingBoxRenderer'] = BABYLON['BoundingBoxRenderer'];
     globalObject["BABYLON"] = globalObject["BABYLON"] || BABYLON;
     module.exports = EXPORTS;
     })();

Разница между файлами не показана из-за своего большого размера
+ 16 - 16
dist/preview release/modules/defaultRenderingPipeline/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 16 - 16
dist/preview release/modules/depthRenderer/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 17 - 17
dist/preview release/modules/directionalLight/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 17 - 17
dist/preview release/modules/environmentHelper/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 16 - 16
dist/preview release/modules/freeCamera/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 16 - 16
dist/preview release/modules/fresnel/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 17 - 17
dist/preview release/modules/gamepad/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 16 - 16
dist/preview release/modules/geometryBufferRenderer/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 17 - 17
dist/preview release/modules/gpuParticles/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 17 - 17
dist/preview release/modules/hdr/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 17 - 17
dist/preview release/modules/hemisphericLight/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 17 - 17
dist/preview release/modules/highlights/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 17 - 17
dist/preview release/modules/instrumentation/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 17 - 17
dist/preview release/modules/layer/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 16 - 16
dist/preview release/modules/lensFlares/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 16 - 16
dist/preview release/modules/loader/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 17 - 17
dist/preview release/modules/meshBuilder/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 16 - 16
dist/preview release/modules/morphTargets/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 16 - 16
dist/preview release/modules/multiMaterial/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 16 - 16
dist/preview release/modules/nullEngine/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 16 - 16
dist/preview release/modules/octrees/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 16 - 16
dist/preview release/modules/offline/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 17 - 17
dist/preview release/modules/optimizations/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 17 - 17
dist/preview release/modules/particles/index.d.ts


+ 6 - 1
dist/preview release/modules/pbrMaterial/es6.js

@@ -342,6 +342,10 @@ var BABYLON;
              * Force normal to face away from face.
              */
             _this._forceNormalForward = false;
+            /**
+             * Force metallic workflow.
+             */
+            _this._forceMetallicWorkflow = false;
             _this._renderTargets = new BABYLON.SmartArray(16);
             _this._globalAmbientColor = new BABYLON.Color3(0, 0, 0);
             // Setup the default processing configuration to the scene.
@@ -712,7 +716,7 @@ var BABYLON;
                 defines.SPECULAROVERALPHA = this._useSpecularOverAlpha;
                 defines.USEPHYSICALLIGHTFALLOFF = this._usePhysicalLightFalloff;
                 defines.RADIANCEOVERALPHA = this._useRadianceOverAlpha;
-                if ((this._metallic !== undefined && this._metallic !== null) || (this._roughness !== undefined && this._roughness !== null)) {
+                if (this._forceMetallicWorkflow || (this._metallic !== undefined && this._metallic !== null) || (this._roughness !== undefined && this._roughness !== null)) {
                     defines.METALLICWORKFLOW = true;
                 }
                 else {
@@ -2191,6 +2195,7 @@ var BABYLON;
             _this._useRoughnessFromMetallicTextureAlpha = false;
             _this._useRoughnessFromMetallicTextureGreen = true;
             _this._useMetallnessFromMetallicTextureBlue = true;
+            _this._forceMetallicWorkflow = true;
             return _this;
         }
         /**

Разница между файлами не показана из-за своего большого размера
+ 21 - 17
dist/preview release/modules/pbrMaterial/index.d.ts


+ 6 - 1
dist/preview release/modules/pbrMaterial/index.js

@@ -346,6 +346,10 @@ var BABYLON;
              * Force normal to face away from face.
              */
             _this._forceNormalForward = false;
+            /**
+             * Force metallic workflow.
+             */
+            _this._forceMetallicWorkflow = false;
             _this._renderTargets = new BABYLON.SmartArray(16);
             _this._globalAmbientColor = new BABYLON.Color3(0, 0, 0);
             // Setup the default processing configuration to the scene.
@@ -716,7 +720,7 @@ var BABYLON;
                 defines.SPECULAROVERALPHA = this._useSpecularOverAlpha;
                 defines.USEPHYSICALLIGHTFALLOFF = this._usePhysicalLightFalloff;
                 defines.RADIANCEOVERALPHA = this._useRadianceOverAlpha;
-                if ((this._metallic !== undefined && this._metallic !== null) || (this._roughness !== undefined && this._roughness !== null)) {
+                if (this._forceMetallicWorkflow || (this._metallic !== undefined && this._metallic !== null) || (this._roughness !== undefined && this._roughness !== null)) {
                     defines.METALLICWORKFLOW = true;
                 }
                 else {
@@ -2195,6 +2199,7 @@ var BABYLON;
             _this._useRoughnessFromMetallicTextureAlpha = false;
             _this._useRoughnessFromMetallicTextureGreen = true;
             _this._useMetallnessFromMetallicTextureBlue = true;
+            _this._forceMetallicWorkflow = true;
             return _this;
         }
         /**

+ 3 - 1
dist/preview release/modules/physics/es6.js

@@ -1845,6 +1845,7 @@ var BABYLON;
             var center = impostor.getObjectCenter();
             //m.getAbsolutePosition().subtract(m.getBoundingInfo().boundingBox.centerWorld)
             this._tmpDeltaPosition.copyFrom(object.getAbsolutePivotPoint().subtract(center));
+            this._tmpDeltaPosition.divideInPlace(impostor.object.scaling);
             this._tmpPosition.copyFrom(center);
             var quaternion = object.rotationQuaternion;
             if (!quaternion) {
@@ -2164,7 +2165,8 @@ var BABYLON;
                     var extendSize = i.getObjectExtendSize();
                     if (i === impostor) {
                         var center = impostor.getObjectCenter();
-                        impostor.object.position.subtractToRef(center, _this._tmpPositionVector);
+                        impostor.object.getAbsolutePivotPoint().subtractToRef(center, _this._tmpPositionVector);
+                        _this._tmpPositionVector.divideInPlace(impostor.object.scaling);
                         //Can also use Array.prototype.push.apply
                         bodyConfig.pos.push(center.x);
                         bodyConfig.pos.push(center.y);

Разница между файлами не показана из-за своего большого размера
+ 16 - 16
dist/preview release/modules/physics/index.d.ts


+ 3 - 1
dist/preview release/modules/physics/index.js

@@ -1849,6 +1849,7 @@ var BABYLON;
             var center = impostor.getObjectCenter();
             //m.getAbsolutePosition().subtract(m.getBoundingInfo().boundingBox.centerWorld)
             this._tmpDeltaPosition.copyFrom(object.getAbsolutePivotPoint().subtract(center));
+            this._tmpDeltaPosition.divideInPlace(impostor.object.scaling);
             this._tmpPosition.copyFrom(center);
             var quaternion = object.rotationQuaternion;
             if (!quaternion) {
@@ -2168,7 +2169,8 @@ var BABYLON;
                     var extendSize = i.getObjectExtendSize();
                     if (i === impostor) {
                         var center = impostor.getObjectCenter();
-                        impostor.object.position.subtractToRef(center, _this._tmpPositionVector);
+                        impostor.object.getAbsolutePivotPoint().subtractToRef(center, _this._tmpPositionVector);
+                        _this._tmpPositionVector.divideInPlace(impostor.object.scaling);
                         //Can also use Array.prototype.push.apply
                         bodyConfig.pos.push(center.x);
                         bodyConfig.pos.push(center.y);

Разница между файлами не показана из-за своего большого размера
+ 17 - 17
dist/preview release/modules/picking/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 17 - 17
dist/preview release/modules/pointLight/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 17 - 17
dist/preview release/modules/polygonMesh/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 17 - 17
dist/preview release/modules/postProcesses/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 17 - 17
dist/preview release/modules/probes/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 17 - 17
dist/preview release/modules/procedural/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 17 - 17
dist/preview release/modules/renderingPipeline/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 16 - 16
dist/preview release/modules/serialization/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 17 - 17
dist/preview release/modules/shaderMaterial/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 16 - 16
dist/preview release/modules/shadows/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 16 - 16
dist/preview release/modules/simd/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 16 - 16
dist/preview release/modules/solidParticles/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 17 - 17
dist/preview release/modules/spotLight/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 16 - 16
dist/preview release/modules/sprites/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 16 - 16
dist/preview release/modules/stringDictionary/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 17 - 17
dist/preview release/modules/targetCamera/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 17 - 17
dist/preview release/modules/textureFormats/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 17 - 17
dist/preview release/modules/textureTools/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 17 - 17
dist/preview release/modules/touchCamera/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 16 - 16
dist/preview release/modules/userData/index.d.ts


Разница между файлами не показана из-за своего большого размера
+ 17 - 17
dist/preview release/modules/virtualJoystick/index.d.ts


+ 26 - 12
dist/preview release/modules/vr/es6.js

@@ -1017,8 +1017,15 @@ var BABYLON;
             this._haloCenter = new BABYLON.Vector3(0, 0, 0);
             this._padSensibilityUp = 0.65;
             this._padSensibilityDown = 0.35;
+            /**
+             * Observable raised when a new mesh is selected based on meshSelectionPredicate
+             */
             this.onNewMeshSelected = new BABYLON.Observable();
             /**
+             * Observable raised when a new mesh is picked based on meshSelectionPredicate
+             */
+            this.onNewMeshPicked = new BABYLON.Observable();
+            /**
              * Observable raised before camera teleportation
             */
             this.onBeforeCameraTeleport = new BABYLON.Observable();
@@ -1030,9 +1037,13 @@ var BABYLON;
             * Observable raised when current selected mesh gets unselected
             */
             this.onSelectedMeshUnselected = new BABYLON.Observable();
+            /**
+             * Set teleportation enabled. If set to false camera teleportation will be disabled but camera rotation will be kept.
+             */
+            this.teleportationEnabled = true;
             this._pointerDownOnMeshAsked = false;
             this._isActionableMesh = false;
-            this._teleportationEnabled = false;
+            this._teleportationInitialized = false;
             this._interactionsEnabled = false;
             this._interactionsRequested = false;
             this._displayGaze = true;
@@ -1072,7 +1083,7 @@ var BABYLON;
                 if (gamepad.type !== BABYLON.Gamepad.POSE_ENABLED) {
                     if (gamepad.leftStick) {
                         gamepad.onleftstickchanged(function (stickValues) {
-                            if (_this._teleportationEnabled) {
+                            if (_this._teleportationInitialized && _this.teleportationEnabled) {
                                 // Listening to classic/xbox gamepad only if no VR controller is active
                                 if ((!_this._leftLaserPointer && !_this._rightLaserPointer) ||
                                     ((_this._leftLaserPointer && !_this._leftLaserPointer.isVisible) &&
@@ -1085,7 +1096,7 @@ var BABYLON;
                     }
                     if (gamepad.rightStick) {
                         gamepad.onrightstickchanged(function (stickValues) {
-                            if (_this._teleportationEnabled) {
+                            if (_this._teleportationInitialized) {
                                 _this._checkRotate(stickValues);
                             }
                         });
@@ -1587,13 +1598,13 @@ var BABYLON;
                 }
                 this._createGazeTracker();
                 this.raySelectionPredicate = function (mesh) {
-                    return true;
+                    return mesh.isVisible;
                 };
                 this.meshSelectionPredicate = function (mesh) {
                     return true;
                 };
                 this._raySelectionPredicate = function (mesh) {
-                    if (_this._isTeleportationFloor(mesh) || (mesh.isVisible && mesh.name.indexOf("gazeTracker") === -1
+                    if (_this._isTeleportationFloor(mesh) || (mesh.name.indexOf("gazeTracker") === -1
                         && mesh.name.indexOf("teleportationTarget") === -1
                         && mesh.name.indexOf("torusTeleportation") === -1
                         && mesh.name.indexOf("laserPointer") === -1)) {
@@ -1635,7 +1646,7 @@ var BABYLON;
         };
         VRExperienceHelper.prototype.enableTeleportation = function (vrTeleportationOptions) {
             if (vrTeleportationOptions === void 0) { vrTeleportationOptions = {}; }
-            if (!this._teleportationEnabled) {
+            if (!this._teleportationInitialized) {
                 this._teleportationRequested = true;
                 this.enableInteractions();
                 if (vrTeleportationOptions.floorMeshName) {
@@ -1659,7 +1670,7 @@ var BABYLON;
                 this._postProcessMove = new BABYLON.ImageProcessingPostProcess("postProcessMove", 1.0, this._webVRCamera, undefined, undefined, undefined, undefined, imageProcessingConfiguration);
                 this._webVRCamera.detachPostProcess(this._postProcessMove);
                 this._passProcessMove = new BABYLON.PassPostProcess("pass", 1.0, this._webVRCamera);
-                this._teleportationEnabled = true;
+                this._teleportationInitialized = true;
                 if (this._isDefaultTeleportationTarget) {
                     this._createTeleportationCircles();
                 }
@@ -1880,8 +1891,10 @@ var BABYLON;
                     });
                 }
                 webVRController.onPadValuesChangedObservable.add(function (stateObject) {
-                    _this._checkTeleportBackwards(stateObject);
-                    _this._checkTeleportWithRay(stateObject, webVRController);
+                    if (_this.teleportationEnabled) {
+                        _this._checkTeleportBackwards(stateObject);
+                        _this._checkTeleportWithRay(stateObject, webVRController);
+                    }
                     _this._checkRotate(stateObject);
                 });
             }
@@ -1947,7 +1960,7 @@ var BABYLON;
             this._hideTeleportationTarget();
         };
         VRExperienceHelper.prototype._displayTeleportationTarget = function () {
-            if (this._teleportationEnabled) {
+            if (this._teleportationInitialized) {
                 this._teleportationTarget.isVisible = true;
                 if (this._isDefaultTeleportationTarget) {
                     this._teleportationTarget.getChildren()[0].isVisible = true;
@@ -1955,7 +1968,7 @@ var BABYLON;
             }
         };
         VRExperienceHelper.prototype._hideTeleportationTarget = function () {
-            if (this._teleportationEnabled) {
+            if (this._teleportationInitialized) {
                 this._teleportationTarget.isVisible = false;
                 if (this._isDefaultTeleportationTarget) {
                     this._teleportationTarget.getChildren()[0].isVisible = false;
@@ -2209,7 +2222,7 @@ var BABYLON;
                     this._scene.simulatePointerMove(this._currentHit);
                 }
                 // The object selected is the floor, we're in a teleportation scenario
-                if (this._teleportationEnabled && this._isTeleportationFloor(hit.pickedMesh) && hit.pickedPoint) {
+                if (this._teleportationInitialized && this._isTeleportationFloor(hit.pickedMesh) && hit.pickedPoint) {
                     // Moving the teleportation area to this targetted point
                     this._moveTeleportationSelectorTo(hit);
                     return;
@@ -2219,6 +2232,7 @@ var BABYLON;
                 this._teleportationAllowed = false;
                 if (hit.pickedMesh !== this._currentMeshSelected) {
                     if (this.meshSelectionPredicate(hit.pickedMesh)) {
+                        this.onNewMeshPicked.notifyObservers(hit);
                         this._currentMeshSelected = hit.pickedMesh;
                         if (hit.pickedMesh.isPickable && hit.pickedMesh.actionManager) {
                             this.changeGazeColor(new BABYLON.Color3(0, 0, 1));

Разница между файлами не показана из-за своего большого размера
+ 28 - 17
dist/preview release/modules/vr/index.d.ts


+ 26 - 12
dist/preview release/modules/vr/index.js

@@ -1021,8 +1021,15 @@ var BABYLON;
             this._haloCenter = new BABYLON.Vector3(0, 0, 0);
             this._padSensibilityUp = 0.65;
             this._padSensibilityDown = 0.35;
+            /**
+             * Observable raised when a new mesh is selected based on meshSelectionPredicate
+             */
             this.onNewMeshSelected = new BABYLON.Observable();
             /**
+             * Observable raised when a new mesh is picked based on meshSelectionPredicate
+             */
+            this.onNewMeshPicked = new BABYLON.Observable();
+            /**
              * Observable raised before camera teleportation
             */
             this.onBeforeCameraTeleport = new BABYLON.Observable();
@@ -1034,9 +1041,13 @@ var BABYLON;
             * Observable raised when current selected mesh gets unselected
             */
             this.onSelectedMeshUnselected = new BABYLON.Observable();
+            /**
+             * Set teleportation enabled. If set to false camera teleportation will be disabled but camera rotation will be kept.
+             */
+            this.teleportationEnabled = true;
             this._pointerDownOnMeshAsked = false;
             this._isActionableMesh = false;
-            this._teleportationEnabled = false;
+            this._teleportationInitialized = false;
             this._interactionsEnabled = false;
             this._interactionsRequested = false;
             this._displayGaze = true;
@@ -1076,7 +1087,7 @@ var BABYLON;
                 if (gamepad.type !== BABYLON.Gamepad.POSE_ENABLED) {
                     if (gamepad.leftStick) {
                         gamepad.onleftstickchanged(function (stickValues) {
-                            if (_this._teleportationEnabled) {
+                            if (_this._teleportationInitialized && _this.teleportationEnabled) {
                                 // Listening to classic/xbox gamepad only if no VR controller is active
                                 if ((!_this._leftLaserPointer && !_this._rightLaserPointer) ||
                                     ((_this._leftLaserPointer && !_this._leftLaserPointer.isVisible) &&
@@ -1089,7 +1100,7 @@ var BABYLON;
                     }
                     if (gamepad.rightStick) {
                         gamepad.onrightstickchanged(function (stickValues) {
-                            if (_this._teleportationEnabled) {
+                            if (_this._teleportationInitialized) {
                                 _this._checkRotate(stickValues);
                             }
                         });
@@ -1591,13 +1602,13 @@ var BABYLON;
                 }
                 this._createGazeTracker();
                 this.raySelectionPredicate = function (mesh) {
-                    return true;
+                    return mesh.isVisible;
                 };
                 this.meshSelectionPredicate = function (mesh) {
                     return true;
                 };
                 this._raySelectionPredicate = function (mesh) {
-                    if (_this._isTeleportationFloor(mesh) || (mesh.isVisible && mesh.name.indexOf("gazeTracker") === -1
+                    if (_this._isTeleportationFloor(mesh) || (mesh.name.indexOf("gazeTracker") === -1
                         && mesh.name.indexOf("teleportationTarget") === -1
                         && mesh.name.indexOf("torusTeleportation") === -1
                         && mesh.name.indexOf("laserPointer") === -1)) {
@@ -1639,7 +1650,7 @@ var BABYLON;
         };
         VRExperienceHelper.prototype.enableTeleportation = function (vrTeleportationOptions) {
             if (vrTeleportationOptions === void 0) { vrTeleportationOptions = {}; }
-            if (!this._teleportationEnabled) {
+            if (!this._teleportationInitialized) {
                 this._teleportationRequested = true;
                 this.enableInteractions();
                 if (vrTeleportationOptions.floorMeshName) {
@@ -1663,7 +1674,7 @@ var BABYLON;
                 this._postProcessMove = new BABYLON.ImageProcessingPostProcess("postProcessMove", 1.0, this._webVRCamera, undefined, undefined, undefined, undefined, imageProcessingConfiguration);
                 this._webVRCamera.detachPostProcess(this._postProcessMove);
                 this._passProcessMove = new BABYLON.PassPostProcess("pass", 1.0, this._webVRCamera);
-                this._teleportationEnabled = true;
+                this._teleportationInitialized = true;
                 if (this._isDefaultTeleportationTarget) {
                     this._createTeleportationCircles();
                 }
@@ -1884,8 +1895,10 @@ var BABYLON;
                     });
                 }
                 webVRController.onPadValuesChangedObservable.add(function (stateObject) {
-                    _this._checkTeleportBackwards(stateObject);
-                    _this._checkTeleportWithRay(stateObject, webVRController);
+                    if (_this.teleportationEnabled) {
+                        _this._checkTeleportBackwards(stateObject);
+                        _this._checkTeleportWithRay(stateObject, webVRController);
+                    }
                     _this._checkRotate(stateObject);
                 });
             }
@@ -1951,7 +1964,7 @@ var BABYLON;
             this._hideTeleportationTarget();
         };
         VRExperienceHelper.prototype._displayTeleportationTarget = function () {
-            if (this._teleportationEnabled) {
+            if (this._teleportationInitialized) {
                 this._teleportationTarget.isVisible = true;
                 if (this._isDefaultTeleportationTarget) {
                     this._teleportationTarget.getChildren()[0].isVisible = true;
@@ -1959,7 +1972,7 @@ var BABYLON;
             }
         };
         VRExperienceHelper.prototype._hideTeleportationTarget = function () {
-            if (this._teleportationEnabled) {
+            if (this._teleportationInitialized) {
                 this._teleportationTarget.isVisible = false;
                 if (this._isDefaultTeleportationTarget) {
                     this._teleportationTarget.getChildren()[0].isVisible = false;
@@ -2213,7 +2226,7 @@ var BABYLON;
                     this._scene.simulatePointerMove(this._currentHit);
                 }
                 // The object selected is the floor, we're in a teleportation scenario
-                if (this._teleportationEnabled && this._isTeleportationFloor(hit.pickedMesh) && hit.pickedPoint) {
+                if (this._teleportationInitialized && this._isTeleportationFloor(hit.pickedMesh) && hit.pickedPoint) {
                     // Moving the teleportation area to this targetted point
                     this._moveTeleportationSelectorTo(hit);
                     return;
@@ -2223,6 +2236,7 @@ var BABYLON;
                 this._teleportationAllowed = false;
                 if (hit.pickedMesh !== this._currentMeshSelected) {
                     if (this.meshSelectionPredicate(hit.pickedMesh)) {
+                        this.onNewMeshPicked.notifyObservers(hit);
                         this._currentMeshSelected = hit.pickedMesh;
                         if (hit.pickedMesh.isPickable && hit.pickedMesh.actionManager) {
                             this.changeGazeColor(new BABYLON.Color3(0, 0, 1));

+ 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": "3.2.0-alpha0",
+    "version": "3.2.0-alpha2",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -27,7 +27,7 @@
     ],
     "license": "Apache-2.0",
     "peerDependencies": {
-        "babylonjs": ">=3.1.0-alpha"
+        "babylonjs": ">=3.2.0-alpha"
     },
     "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": "3.2.0-alpha0",
+    "version": "3.2.0-alpha2",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -27,7 +27,7 @@
     ],
     "license": "Apache-2.0",
     "peerDependencies": {
-        "babylonjs": ">=3.1.0-alpha"
+        "babylonjs": ">=3.2.0-alpha"
     },
     "engines": {
         "node": "*"

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


Некоторые файлы не были показаны из-за большого количества измененных файлов