David Catuhe 7 年之前
父節點
當前提交
9cb4784b0c

文件差異過大導致無法顯示
+ 2749 - 2736
Playground/babylon.d.txt


文件差異過大導致無法顯示
+ 4017 - 4016
dist/preview release/babylon.d.ts


文件差異過大導致無法顯示
+ 10 - 10
dist/preview release/babylon.js


+ 18 - 7
dist/preview release/babylon.max.js

@@ -84000,6 +84000,9 @@ var BABYLON;
             if (engine && engine.premultipliedAlpha) {
             if (engine && engine.premultipliedAlpha) {
                 return Promise.reject("Env texture can only be created when the engine is created with the premultipliedAlpha option set to false.");
                 return Promise.reject("Env texture can only be created when the engine is created with the premultipliedAlpha option set to false.");
             }
             }
+            if (texture.textureType === BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT) {
+                return Promise.reject("The cube texture should allow HDR (Full Float or Half Float).");
+            }
             var canvas = engine.getRenderingCanvas();
             var canvas = engine.getRenderingCanvas();
             if (!canvas) {
             if (!canvas) {
                 return Promise.reject("Env texture can only be created when the engine is associated to a canvas.");
                 return Promise.reject("Env texture can only be created when the engine is associated to a canvas.");
@@ -88020,12 +88023,14 @@ var BABYLON;
                 var checkWithEpsilon_1 = function (value) {
                 var checkWithEpsilon_1 = function (value) {
                     return Math.max(value, BABYLON.PhysicsEngine.Epsilon);
                     return Math.max(value, BABYLON.PhysicsEngine.Epsilon);
                 };
                 };
+                var globalQuaternion_1 = new BABYLON.Quaternion();
                 impostors.forEach(function (i) {
                 impostors.forEach(function (i) {
                     if (!i.object.rotationQuaternion) {
                     if (!i.object.rotationQuaternion) {
                         return;
                         return;
                     }
                     }
                     //get the correct bounding box
                     //get the correct bounding box
                     var oldQuaternion = i.object.rotationQuaternion;
                     var oldQuaternion = i.object.rotationQuaternion;
+                    globalQuaternion_1 = oldQuaternion.clone();
                     var rot = oldQuaternion.toEulerAngles();
                     var rot = oldQuaternion.toEulerAngles();
                     var extendSize = i.getObjectExtendSize();
                     var extendSize = i.getObjectExtendSize();
                     var radToDeg = 57.295779513082320876;
                     var radToDeg = 57.295779513082320876;
@@ -88039,9 +88044,9 @@ var BABYLON;
                         bodyConfig.pos.push(center.z);
                         bodyConfig.pos.push(center.z);
                         bodyConfig.posShape.push(0, 0, 0);
                         bodyConfig.posShape.push(0, 0, 0);
                         //tmp solution
                         //tmp solution
-                        bodyConfig.rot.push(rot.x * radToDeg);
-                        bodyConfig.rot.push(rot.y * radToDeg);
-                        bodyConfig.rot.push(rot.z * radToDeg);
+                        bodyConfig.rot.push(0);
+                        bodyConfig.rot.push(0);
+                        bodyConfig.rot.push(0);
                         bodyConfig.rotShape.push(0, 0, 0);
                         bodyConfig.rotShape.push(0, 0, 0);
                     }
                     }
                     else {
                     else {
@@ -88102,6 +88107,10 @@ var BABYLON;
                     i.object.rotationQuaternion = oldQuaternion;
                     i.object.rotationQuaternion = oldQuaternion;
                 });
                 });
                 impostor.physicsBody = this.world.add(bodyConfig);
                 impostor.physicsBody = this.world.add(bodyConfig);
+                // set the quaternion, ignoring the previously defined (euler) rotation
+                impostor.physicsBody.resetQuaternion(globalQuaternion_1);
+                // update with delta 0, so the body will reveive the new rotation.
+                impostor.physicsBody.updatePosition(0);
             }
             }
             else {
             else {
                 this._tmpPositionVector.copyFromFloats(0, 0, 0);
                 this._tmpPositionVector.copyFromFloats(0, 0, 0);
@@ -89523,6 +89532,7 @@ var BABYLON;
                 }
                 }
                 else {
                 else {
                     PointerDragBehavior._planeScene = new BABYLON.Scene(this._scene.getEngine());
                     PointerDragBehavior._planeScene = new BABYLON.Scene(this._scene.getEngine());
+                    PointerDragBehavior._planeScene.detachControl();
                     this._scene.getEngine().scenes.pop();
                     this._scene.getEngine().scenes.pop();
                 }
                 }
             }
             }
@@ -89585,7 +89595,7 @@ var BABYLON;
                     }
                     }
                 }
                 }
             });
             });
-            this._scene.onBeforeRenderObservable.add(function () {
+            this._beforeRenderObserver = this._scene.onBeforeRenderObservable.add(function () {
                 if (_this._moving && _this.moveAttached) {
                 if (_this._moving && _this.moveAttached) {
                     // Slowly move mesh to avoid jitter
                     // Slowly move mesh to avoid jitter
                     targetPosition.subtractToRef(_this._attachedNode.absolutePosition, _this._tmpVector);
                     targetPosition.subtractToRef(_this._attachedNode.absolutePosition, _this._tmpVector);
@@ -89679,6 +89689,9 @@ var BABYLON;
             if (this._pointerObserver) {
             if (this._pointerObserver) {
                 this._scene.onPointerObservable.remove(this._pointerObserver);
                 this._scene.onPointerObservable.remove(this._pointerObserver);
             }
             }
+            if (this._beforeRenderObserver) {
+                this._scene.onBeforeRenderObservable.remove(this._beforeRenderObserver);
+            }
         };
         };
         return PointerDragBehavior;
         return PointerDragBehavior;
     }());
     }());
@@ -93348,7 +93361,6 @@ var BABYLON;
         };
         };
         VRExperienceHelperControllerGazer.prototype._setLaserPointerParent = function (mesh) {
         VRExperienceHelperControllerGazer.prototype._setLaserPointerParent = function (mesh) {
             var makeNotPick = function (root) {
             var makeNotPick = function (root) {
-                root.name += " laserPointer";
                 root.isPickable = false;
                 root.isPickable = false;
                 root.getChildMeshes().forEach(function (c) {
                 root.getChildMeshes().forEach(function (c) {
                     makeNotPick(c);
                     makeNotPick(c);
@@ -94145,8 +94157,7 @@ var BABYLON;
                 this._raySelectionPredicate = function (mesh) {
                 this._raySelectionPredicate = function (mesh) {
                     if (_this._isTeleportationFloor(mesh) || (mesh.name.indexOf("gazeTracker") === -1
                     if (_this._isTeleportationFloor(mesh) || (mesh.name.indexOf("gazeTracker") === -1
                         && mesh.name.indexOf("teleportationTarget") === -1
                         && mesh.name.indexOf("teleportationTarget") === -1
-                        && mesh.name.indexOf("torusTeleportation") === -1
-                        && mesh.name.indexOf("laserPointer") === -1)) {
+                        && mesh.name.indexOf("torusTeleportation") === -1)) {
                         return _this.raySelectionPredicate(mesh);
                         return _this.raySelectionPredicate(mesh);
                     }
                     }
                     return false;
                     return false;

+ 18 - 7
dist/preview release/babylon.no-module.max.js

@@ -83967,6 +83967,9 @@ var BABYLON;
             if (engine && engine.premultipliedAlpha) {
             if (engine && engine.premultipliedAlpha) {
                 return Promise.reject("Env texture can only be created when the engine is created with the premultipliedAlpha option set to false.");
                 return Promise.reject("Env texture can only be created when the engine is created with the premultipliedAlpha option set to false.");
             }
             }
+            if (texture.textureType === BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT) {
+                return Promise.reject("The cube texture should allow HDR (Full Float or Half Float).");
+            }
             var canvas = engine.getRenderingCanvas();
             var canvas = engine.getRenderingCanvas();
             if (!canvas) {
             if (!canvas) {
                 return Promise.reject("Env texture can only be created when the engine is associated to a canvas.");
                 return Promise.reject("Env texture can only be created when the engine is associated to a canvas.");
@@ -87987,12 +87990,14 @@ var BABYLON;
                 var checkWithEpsilon_1 = function (value) {
                 var checkWithEpsilon_1 = function (value) {
                     return Math.max(value, BABYLON.PhysicsEngine.Epsilon);
                     return Math.max(value, BABYLON.PhysicsEngine.Epsilon);
                 };
                 };
+                var globalQuaternion_1 = new BABYLON.Quaternion();
                 impostors.forEach(function (i) {
                 impostors.forEach(function (i) {
                     if (!i.object.rotationQuaternion) {
                     if (!i.object.rotationQuaternion) {
                         return;
                         return;
                     }
                     }
                     //get the correct bounding box
                     //get the correct bounding box
                     var oldQuaternion = i.object.rotationQuaternion;
                     var oldQuaternion = i.object.rotationQuaternion;
+                    globalQuaternion_1 = oldQuaternion.clone();
                     var rot = oldQuaternion.toEulerAngles();
                     var rot = oldQuaternion.toEulerAngles();
                     var extendSize = i.getObjectExtendSize();
                     var extendSize = i.getObjectExtendSize();
                     var radToDeg = 57.295779513082320876;
                     var radToDeg = 57.295779513082320876;
@@ -88006,9 +88011,9 @@ var BABYLON;
                         bodyConfig.pos.push(center.z);
                         bodyConfig.pos.push(center.z);
                         bodyConfig.posShape.push(0, 0, 0);
                         bodyConfig.posShape.push(0, 0, 0);
                         //tmp solution
                         //tmp solution
-                        bodyConfig.rot.push(rot.x * radToDeg);
-                        bodyConfig.rot.push(rot.y * radToDeg);
-                        bodyConfig.rot.push(rot.z * radToDeg);
+                        bodyConfig.rot.push(0);
+                        bodyConfig.rot.push(0);
+                        bodyConfig.rot.push(0);
                         bodyConfig.rotShape.push(0, 0, 0);
                         bodyConfig.rotShape.push(0, 0, 0);
                     }
                     }
                     else {
                     else {
@@ -88069,6 +88074,10 @@ var BABYLON;
                     i.object.rotationQuaternion = oldQuaternion;
                     i.object.rotationQuaternion = oldQuaternion;
                 });
                 });
                 impostor.physicsBody = this.world.add(bodyConfig);
                 impostor.physicsBody = this.world.add(bodyConfig);
+                // set the quaternion, ignoring the previously defined (euler) rotation
+                impostor.physicsBody.resetQuaternion(globalQuaternion_1);
+                // update with delta 0, so the body will reveive the new rotation.
+                impostor.physicsBody.updatePosition(0);
             }
             }
             else {
             else {
                 this._tmpPositionVector.copyFromFloats(0, 0, 0);
                 this._tmpPositionVector.copyFromFloats(0, 0, 0);
@@ -89490,6 +89499,7 @@ var BABYLON;
                 }
                 }
                 else {
                 else {
                     PointerDragBehavior._planeScene = new BABYLON.Scene(this._scene.getEngine());
                     PointerDragBehavior._planeScene = new BABYLON.Scene(this._scene.getEngine());
+                    PointerDragBehavior._planeScene.detachControl();
                     this._scene.getEngine().scenes.pop();
                     this._scene.getEngine().scenes.pop();
                 }
                 }
             }
             }
@@ -89552,7 +89562,7 @@ var BABYLON;
                     }
                     }
                 }
                 }
             });
             });
-            this._scene.onBeforeRenderObservable.add(function () {
+            this._beforeRenderObserver = this._scene.onBeforeRenderObservable.add(function () {
                 if (_this._moving && _this.moveAttached) {
                 if (_this._moving && _this.moveAttached) {
                     // Slowly move mesh to avoid jitter
                     // Slowly move mesh to avoid jitter
                     targetPosition.subtractToRef(_this._attachedNode.absolutePosition, _this._tmpVector);
                     targetPosition.subtractToRef(_this._attachedNode.absolutePosition, _this._tmpVector);
@@ -89646,6 +89656,9 @@ var BABYLON;
             if (this._pointerObserver) {
             if (this._pointerObserver) {
                 this._scene.onPointerObservable.remove(this._pointerObserver);
                 this._scene.onPointerObservable.remove(this._pointerObserver);
             }
             }
+            if (this._beforeRenderObserver) {
+                this._scene.onBeforeRenderObservable.remove(this._beforeRenderObserver);
+            }
         };
         };
         return PointerDragBehavior;
         return PointerDragBehavior;
     }());
     }());
@@ -93315,7 +93328,6 @@ var BABYLON;
         };
         };
         VRExperienceHelperControllerGazer.prototype._setLaserPointerParent = function (mesh) {
         VRExperienceHelperControllerGazer.prototype._setLaserPointerParent = function (mesh) {
             var makeNotPick = function (root) {
             var makeNotPick = function (root) {
-                root.name += " laserPointer";
                 root.isPickable = false;
                 root.isPickable = false;
                 root.getChildMeshes().forEach(function (c) {
                 root.getChildMeshes().forEach(function (c) {
                     makeNotPick(c);
                     makeNotPick(c);
@@ -94112,8 +94124,7 @@ var BABYLON;
                 this._raySelectionPredicate = function (mesh) {
                 this._raySelectionPredicate = function (mesh) {
                     if (_this._isTeleportationFloor(mesh) || (mesh.name.indexOf("gazeTracker") === -1
                     if (_this._isTeleportationFloor(mesh) || (mesh.name.indexOf("gazeTracker") === -1
                         && mesh.name.indexOf("teleportationTarget") === -1
                         && mesh.name.indexOf("teleportationTarget") === -1
-                        && mesh.name.indexOf("torusTeleportation") === -1
-                        && mesh.name.indexOf("laserPointer") === -1)) {
+                        && mesh.name.indexOf("torusTeleportation") === -1)) {
                         return _this.raySelectionPredicate(mesh);
                         return _this.raySelectionPredicate(mesh);
                     }
                     }
                     return false;
                     return false;

文件差異過大導致無法顯示
+ 10 - 10
dist/preview release/babylon.worker.js


+ 18 - 7
dist/preview release/es6.js

@@ -83967,6 +83967,9 @@ var BABYLON;
             if (engine && engine.premultipliedAlpha) {
             if (engine && engine.premultipliedAlpha) {
                 return Promise.reject("Env texture can only be created when the engine is created with the premultipliedAlpha option set to false.");
                 return Promise.reject("Env texture can only be created when the engine is created with the premultipliedAlpha option set to false.");
             }
             }
+            if (texture.textureType === BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT) {
+                return Promise.reject("The cube texture should allow HDR (Full Float or Half Float).");
+            }
             var canvas = engine.getRenderingCanvas();
             var canvas = engine.getRenderingCanvas();
             if (!canvas) {
             if (!canvas) {
                 return Promise.reject("Env texture can only be created when the engine is associated to a canvas.");
                 return Promise.reject("Env texture can only be created when the engine is associated to a canvas.");
@@ -87987,12 +87990,14 @@ var BABYLON;
                 var checkWithEpsilon_1 = function (value) {
                 var checkWithEpsilon_1 = function (value) {
                     return Math.max(value, BABYLON.PhysicsEngine.Epsilon);
                     return Math.max(value, BABYLON.PhysicsEngine.Epsilon);
                 };
                 };
+                var globalQuaternion_1 = new BABYLON.Quaternion();
                 impostors.forEach(function (i) {
                 impostors.forEach(function (i) {
                     if (!i.object.rotationQuaternion) {
                     if (!i.object.rotationQuaternion) {
                         return;
                         return;
                     }
                     }
                     //get the correct bounding box
                     //get the correct bounding box
                     var oldQuaternion = i.object.rotationQuaternion;
                     var oldQuaternion = i.object.rotationQuaternion;
+                    globalQuaternion_1 = oldQuaternion.clone();
                     var rot = oldQuaternion.toEulerAngles();
                     var rot = oldQuaternion.toEulerAngles();
                     var extendSize = i.getObjectExtendSize();
                     var extendSize = i.getObjectExtendSize();
                     var radToDeg = 57.295779513082320876;
                     var radToDeg = 57.295779513082320876;
@@ -88006,9 +88011,9 @@ var BABYLON;
                         bodyConfig.pos.push(center.z);
                         bodyConfig.pos.push(center.z);
                         bodyConfig.posShape.push(0, 0, 0);
                         bodyConfig.posShape.push(0, 0, 0);
                         //tmp solution
                         //tmp solution
-                        bodyConfig.rot.push(rot.x * radToDeg);
-                        bodyConfig.rot.push(rot.y * radToDeg);
-                        bodyConfig.rot.push(rot.z * radToDeg);
+                        bodyConfig.rot.push(0);
+                        bodyConfig.rot.push(0);
+                        bodyConfig.rot.push(0);
                         bodyConfig.rotShape.push(0, 0, 0);
                         bodyConfig.rotShape.push(0, 0, 0);
                     }
                     }
                     else {
                     else {
@@ -88069,6 +88074,10 @@ var BABYLON;
                     i.object.rotationQuaternion = oldQuaternion;
                     i.object.rotationQuaternion = oldQuaternion;
                 });
                 });
                 impostor.physicsBody = this.world.add(bodyConfig);
                 impostor.physicsBody = this.world.add(bodyConfig);
+                // set the quaternion, ignoring the previously defined (euler) rotation
+                impostor.physicsBody.resetQuaternion(globalQuaternion_1);
+                // update with delta 0, so the body will reveive the new rotation.
+                impostor.physicsBody.updatePosition(0);
             }
             }
             else {
             else {
                 this._tmpPositionVector.copyFromFloats(0, 0, 0);
                 this._tmpPositionVector.copyFromFloats(0, 0, 0);
@@ -89490,6 +89499,7 @@ var BABYLON;
                 }
                 }
                 else {
                 else {
                     PointerDragBehavior._planeScene = new BABYLON.Scene(this._scene.getEngine());
                     PointerDragBehavior._planeScene = new BABYLON.Scene(this._scene.getEngine());
+                    PointerDragBehavior._planeScene.detachControl();
                     this._scene.getEngine().scenes.pop();
                     this._scene.getEngine().scenes.pop();
                 }
                 }
             }
             }
@@ -89552,7 +89562,7 @@ var BABYLON;
                     }
                     }
                 }
                 }
             });
             });
-            this._scene.onBeforeRenderObservable.add(function () {
+            this._beforeRenderObserver = this._scene.onBeforeRenderObservable.add(function () {
                 if (_this._moving && _this.moveAttached) {
                 if (_this._moving && _this.moveAttached) {
                     // Slowly move mesh to avoid jitter
                     // Slowly move mesh to avoid jitter
                     targetPosition.subtractToRef(_this._attachedNode.absolutePosition, _this._tmpVector);
                     targetPosition.subtractToRef(_this._attachedNode.absolutePosition, _this._tmpVector);
@@ -89646,6 +89656,9 @@ var BABYLON;
             if (this._pointerObserver) {
             if (this._pointerObserver) {
                 this._scene.onPointerObservable.remove(this._pointerObserver);
                 this._scene.onPointerObservable.remove(this._pointerObserver);
             }
             }
+            if (this._beforeRenderObserver) {
+                this._scene.onBeforeRenderObservable.remove(this._beforeRenderObserver);
+            }
         };
         };
         return PointerDragBehavior;
         return PointerDragBehavior;
     }());
     }());
@@ -93315,7 +93328,6 @@ var BABYLON;
         };
         };
         VRExperienceHelperControllerGazer.prototype._setLaserPointerParent = function (mesh) {
         VRExperienceHelperControllerGazer.prototype._setLaserPointerParent = function (mesh) {
             var makeNotPick = function (root) {
             var makeNotPick = function (root) {
-                root.name += " laserPointer";
                 root.isPickable = false;
                 root.isPickable = false;
                 root.getChildMeshes().forEach(function (c) {
                 root.getChildMeshes().forEach(function (c) {
                     makeNotPick(c);
                     makeNotPick(c);
@@ -94112,8 +94124,7 @@ var BABYLON;
                 this._raySelectionPredicate = function (mesh) {
                 this._raySelectionPredicate = function (mesh) {
                     if (_this._isTeleportationFloor(mesh) || (mesh.name.indexOf("gazeTracker") === -1
                     if (_this._isTeleportationFloor(mesh) || (mesh.name.indexOf("gazeTracker") === -1
                         && mesh.name.indexOf("teleportationTarget") === -1
                         && mesh.name.indexOf("teleportationTarget") === -1
-                        && mesh.name.indexOf("torusTeleportation") === -1
-                        && mesh.name.indexOf("laserPointer") === -1)) {
+                        && mesh.name.indexOf("torusTeleportation") === -1)) {
                         return _this.raySelectionPredicate(mesh);
                         return _this.raySelectionPredicate(mesh);
                     }
                     }
                     return false;
                     return false;

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

@@ -1738,6 +1738,7 @@ declare module BABYLON.GUI {
         _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
         _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
         _onPointerDown(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number): boolean;
         _onPointerDown(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number): boolean;
         _onPointerUp(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void;
         _onPointerUp(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void;
+        protected _beforeRenderText(text: string): string;
         dispose(): void;
         dispose(): void;
     }
     }
 }
 }
@@ -1745,6 +1746,16 @@ declare module BABYLON.GUI {
 
 
 declare module BABYLON.GUI {
 declare module BABYLON.GUI {
     /**
     /**
+     * Class used to create a password control
+     */
+    class InputPassword extends InputText {
+        protected _beforeRenderText(text: string): string;
+    }
+}
+
+
+declare module BABYLON.GUI {
+    /**
      * Class used to store key control properties
      * Class used to store key control properties
      */
      */
     class KeyPropertySet {
     class KeyPropertySet {

+ 32 - 2
dist/preview release/gui/babylon.gui.js

@@ -6026,7 +6026,7 @@ var BABYLON;
                 // Specific cases
                 // Specific cases
                 switch (keyCode) {
                 switch (keyCode) {
                     case 32: //SPACE
                     case 32: //SPACE
-                        key = " "; //ie11 key for space is "Spacebar" 
+                        key = " "; //ie11 key for space is "Spacebar"
                         break;
                         break;
                     case 8: // BACKSPACE
                     case 8: // BACKSPACE
                         if (this._text && this._text.length > 0) {
                         if (this._text && this._text.length > 0) {
@@ -6134,7 +6134,7 @@ var BABYLON;
                     if (this.color) {
                     if (this.color) {
                         context.fillStyle = this.color;
                         context.fillStyle = this.color;
                     }
                     }
-                    var text = this._text;
+                    var text = this._beforeRenderText(this._text);
                     if (!this._isFocused && !this._text && this._placeholderText) {
                     if (!this._isFocused && !this._text && this._placeholderText) {
                         text = this._placeholderText;
                         text = this._placeholderText;
                         if (this._placeholderColor) {
                         if (this._placeholderColor) {
@@ -6237,6 +6237,9 @@ var BABYLON;
             InputText.prototype._onPointerUp = function (target, coordinates, pointerId, buttonIndex, notifyClick) {
             InputText.prototype._onPointerUp = function (target, coordinates, pointerId, buttonIndex, notifyClick) {
                 _super.prototype._onPointerUp.call(this, target, coordinates, pointerId, buttonIndex, notifyClick);
                 _super.prototype._onPointerUp.call(this, target, coordinates, pointerId, buttonIndex, notifyClick);
             };
             };
+            InputText.prototype._beforeRenderText = function (text) {
+                return text;
+            };
             InputText.prototype.dispose = function () {
             InputText.prototype.dispose = function () {
                 _super.prototype.dispose.call(this);
                 _super.prototype.dispose.call(this);
                 this.onBlurObservable.clear();
                 this.onBlurObservable.clear();
@@ -6256,6 +6259,33 @@ var BABYLON;
     var GUI;
     var GUI;
     (function (GUI) {
     (function (GUI) {
         /**
         /**
+         * Class used to create a password control
+         */
+        var InputPassword = /** @class */ (function (_super) {
+            __extends(InputPassword, _super);
+            function InputPassword() {
+                return _super !== null && _super.apply(this, arguments) || this;
+            }
+            InputPassword.prototype._beforeRenderText = function (text) {
+                var txt = "";
+                for (var i = 0; i < text.length; i++) {
+                    txt += "\u2022";
+                }
+                return txt;
+            };
+            return InputPassword;
+        }(GUI.InputText));
+        GUI.InputPassword = InputPassword;
+    })(GUI = BABYLON.GUI || (BABYLON.GUI = {}));
+})(BABYLON || (BABYLON = {}));
+
+/// <reference path="../../../../dist/preview release/babylon.d.ts"/>
+
+var BABYLON;
+(function (BABYLON) {
+    var GUI;
+    (function (GUI) {
+        /**
          * Class used to store key control properties
          * Class used to store key control properties
          */
          */
         var KeyPropertySet = /** @class */ (function () {
         var KeyPropertySet = /** @class */ (function () {

文件差異過大導致無法顯示
+ 2 - 2
dist/preview release/gui/babylon.gui.min.js


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

@@ -1743,6 +1743,7 @@ declare module BABYLON.GUI {
         _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
         _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
         _onPointerDown(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number): boolean;
         _onPointerDown(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number): boolean;
         _onPointerUp(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void;
         _onPointerUp(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void;
+        protected _beforeRenderText(text: string): string;
         dispose(): void;
         dispose(): void;
     }
     }
 }
 }
@@ -1750,6 +1751,16 @@ declare module BABYLON.GUI {
 
 
 declare module BABYLON.GUI {
 declare module BABYLON.GUI {
     /**
     /**
+     * Class used to create a password control
+     */
+    class InputPassword extends InputText {
+        protected _beforeRenderText(text: string): string;
+    }
+}
+
+
+declare module BABYLON.GUI {
+    /**
      * Class used to store key control properties
      * Class used to store key control properties
      */
      */
     class KeyPropertySet {
     class KeyPropertySet {

+ 1 - 0
dist/preview release/serializers/babylon.glTF2Serializer.d.ts

@@ -287,6 +287,7 @@ declare module BABYLON.GLTF2 {
          * @param binaryWriter Buffer to write binary data to
          * @param binaryWriter Buffer to write binary data to
          */
          */
         private createSceneAsync(babylonScene, binaryWriter);
         private createSceneAsync(babylonScene, binaryWriter);
+        private getRootNodes(babylonScene, nodes, shouldExportTransformNode);
         /**
         /**
          * Creates a mapping of Node unique id to node index and handles animations
          * Creates a mapping of Node unique id to node index and handles animations
          * @param babylonScene Babylon Scene
          * @param babylonScene Babylon Scene

+ 27 - 2
dist/preview release/serializers/babylon.glTF2Serializer.js

@@ -1034,6 +1034,18 @@ var BABYLON;
                     }
                     }
                 });
                 });
             };
             };
+            _Exporter.prototype.getRootNodes = function (babylonScene, nodes, shouldExportTransformNode) {
+                var rootNodes = [];
+                for (var _i = 0, nodes_2 = nodes; _i < nodes_2.length; _i++) {
+                    var babylonTransformNode = nodes_2[_i];
+                    if (shouldExportTransformNode(babylonTransformNode)) {
+                        if (babylonTransformNode.parent == null) {
+                            rootNodes.push(babylonTransformNode);
+                        }
+                    }
+                }
+                return rootNodes;
+            };
             /**
             /**
              * Creates a mapping of Node unique id to node index and handles animations
              * Creates a mapping of Node unique id to node index and handles animations
              * @param babylonScene Babylon Scene
              * @param babylonScene Babylon Scene
@@ -1053,10 +1065,23 @@ var BABYLON;
                 };
                 };
                 var idleGLTFAnimations = [];
                 var idleGLTFAnimations = [];
                 var node;
                 var node;
-                for (var _i = 0, nodes_2 = nodes; _i < nodes_2.length; _i++) {
-                    var babylonTransformNode = nodes_2[_i];
+                var negScaleRootNode = null;
+                var rootNodes = this.getRootNodes(babylonScene, nodes, shouldExportTransformNode);
+                if (rootNodes.length === 1) {
+                    var node_1 = rootNodes[0];
+                    if (node_1.scaling.equalsToFloats(1, 1, -1)) {
+                        this._convertToRightHandedSystem = !this._convertToRightHandedSystem;
+                        negScaleRootNode = node_1;
+                    }
+                }
+                for (var _i = 0, nodes_3 = nodes; _i < nodes_3.length; _i++) {
+                    var babylonTransformNode = nodes_3[_i];
                     if (shouldExportTransformNode(babylonTransformNode)) {
                     if (shouldExportTransformNode(babylonTransformNode)) {
                         node = this.createNode(babylonTransformNode, binaryWriter);
                         node = this.createNode(babylonTransformNode, binaryWriter);
+                        if (negScaleRootNode && babylonTransformNode === negScaleRootNode) {
+                            node.scale = [1, 1, 1];
+                            node.rotation = [0, 0, 0, 1];
+                        }
                         this._nodes.push(node);
                         this._nodes.push(node);
                         nodeIndex = this._nodes.length - 1;
                         nodeIndex = this._nodes.length - 1;
                         nodeMap[babylonTransformNode.uniqueId] = nodeIndex;
                         nodeMap[babylonTransformNode.uniqueId] = nodeIndex;

文件差異過大導致無法顯示
+ 2 - 2
dist/preview release/serializers/babylon.glTF2Serializer.min.js


+ 1 - 0
dist/preview release/serializers/babylonjs.serializers.d.ts

@@ -295,6 +295,7 @@ declare module BABYLON.GLTF2 {
          * @param binaryWriter Buffer to write binary data to
          * @param binaryWriter Buffer to write binary data to
          */
          */
         private createSceneAsync(babylonScene, binaryWriter);
         private createSceneAsync(babylonScene, binaryWriter);
+        private getRootNodes(babylonScene, nodes, shouldExportTransformNode);
         /**
         /**
          * Creates a mapping of Node unique id to node index and handles animations
          * Creates a mapping of Node unique id to node index and handles animations
          * @param babylonScene Babylon Scene
          * @param babylonScene Babylon Scene

+ 27 - 2
dist/preview release/serializers/babylonjs.serializers.js

@@ -1195,6 +1195,18 @@ var BABYLON;
                     }
                     }
                 });
                 });
             };
             };
+            _Exporter.prototype.getRootNodes = function (babylonScene, nodes, shouldExportTransformNode) {
+                var rootNodes = [];
+                for (var _i = 0, nodes_2 = nodes; _i < nodes_2.length; _i++) {
+                    var babylonTransformNode = nodes_2[_i];
+                    if (shouldExportTransformNode(babylonTransformNode)) {
+                        if (babylonTransformNode.parent == null) {
+                            rootNodes.push(babylonTransformNode);
+                        }
+                    }
+                }
+                return rootNodes;
+            };
             /**
             /**
              * Creates a mapping of Node unique id to node index and handles animations
              * Creates a mapping of Node unique id to node index and handles animations
              * @param babylonScene Babylon Scene
              * @param babylonScene Babylon Scene
@@ -1214,10 +1226,23 @@ var BABYLON;
                 };
                 };
                 var idleGLTFAnimations = [];
                 var idleGLTFAnimations = [];
                 var node;
                 var node;
-                for (var _i = 0, nodes_2 = nodes; _i < nodes_2.length; _i++) {
-                    var babylonTransformNode = nodes_2[_i];
+                var negScaleRootNode = null;
+                var rootNodes = this.getRootNodes(babylonScene, nodes, shouldExportTransformNode);
+                if (rootNodes.length === 1) {
+                    var node_1 = rootNodes[0];
+                    if (node_1.scaling.equalsToFloats(1, 1, -1)) {
+                        this._convertToRightHandedSystem = !this._convertToRightHandedSystem;
+                        negScaleRootNode = node_1;
+                    }
+                }
+                for (var _i = 0, nodes_3 = nodes; _i < nodes_3.length; _i++) {
+                    var babylonTransformNode = nodes_3[_i];
                     if (shouldExportTransformNode(babylonTransformNode)) {
                     if (shouldExportTransformNode(babylonTransformNode)) {
                         node = this.createNode(babylonTransformNode, binaryWriter);
                         node = this.createNode(babylonTransformNode, binaryWriter);
+                        if (negScaleRootNode && babylonTransformNode === negScaleRootNode) {
+                            node.scale = [1, 1, 1];
+                            node.rotation = [0, 0, 0, 1];
+                        }
                         this._nodes.push(node);
                         this._nodes.push(node);
                         nodeIndex = this._nodes.length - 1;
                         nodeIndex = this._nodes.length - 1;
                         nodeMap[babylonTransformNode.uniqueId] = nodeIndex;
                         nodeMap[babylonTransformNode.uniqueId] = nodeIndex;

文件差異過大導致無法顯示
+ 2 - 2
dist/preview release/serializers/babylonjs.serializers.min.js


+ 1 - 0
dist/preview release/serializers/babylonjs.serializers.module.d.ts

@@ -302,6 +302,7 @@ declare module BABYLON.GLTF2 {
          * @param binaryWriter Buffer to write binary data to
          * @param binaryWriter Buffer to write binary data to
          */
          */
         private createSceneAsync(babylonScene, binaryWriter);
         private createSceneAsync(babylonScene, binaryWriter);
+        private getRootNodes(babylonScene, nodes, shouldExportTransformNode);
         /**
         /**
          * Creates a mapping of Node unique id to node index and handles animations
          * Creates a mapping of Node unique id to node index and handles animations
          * @param babylonScene Babylon Scene
          * @param babylonScene Babylon Scene

文件差異過大導致無法顯示
+ 10 - 10
dist/preview release/viewer/babylon.viewer.js


+ 18 - 7
dist/preview release/viewer/babylon.viewer.max.js

@@ -84088,6 +84088,9 @@ var BABYLON;
             if (engine && engine.premultipliedAlpha) {
             if (engine && engine.premultipliedAlpha) {
                 return Promise.reject("Env texture can only be created when the engine is created with the premultipliedAlpha option set to false.");
                 return Promise.reject("Env texture can only be created when the engine is created with the premultipliedAlpha option set to false.");
             }
             }
+            if (texture.textureType === BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT) {
+                return Promise.reject("The cube texture should allow HDR (Full Float or Half Float).");
+            }
             var canvas = engine.getRenderingCanvas();
             var canvas = engine.getRenderingCanvas();
             if (!canvas) {
             if (!canvas) {
                 return Promise.reject("Env texture can only be created when the engine is associated to a canvas.");
                 return Promise.reject("Env texture can only be created when the engine is associated to a canvas.");
@@ -88108,12 +88111,14 @@ var BABYLON;
                 var checkWithEpsilon_1 = function (value) {
                 var checkWithEpsilon_1 = function (value) {
                     return Math.max(value, BABYLON.PhysicsEngine.Epsilon);
                     return Math.max(value, BABYLON.PhysicsEngine.Epsilon);
                 };
                 };
+                var globalQuaternion_1 = new BABYLON.Quaternion();
                 impostors.forEach(function (i) {
                 impostors.forEach(function (i) {
                     if (!i.object.rotationQuaternion) {
                     if (!i.object.rotationQuaternion) {
                         return;
                         return;
                     }
                     }
                     //get the correct bounding box
                     //get the correct bounding box
                     var oldQuaternion = i.object.rotationQuaternion;
                     var oldQuaternion = i.object.rotationQuaternion;
+                    globalQuaternion_1 = oldQuaternion.clone();
                     var rot = oldQuaternion.toEulerAngles();
                     var rot = oldQuaternion.toEulerAngles();
                     var extendSize = i.getObjectExtendSize();
                     var extendSize = i.getObjectExtendSize();
                     var radToDeg = 57.295779513082320876;
                     var radToDeg = 57.295779513082320876;
@@ -88127,9 +88132,9 @@ var BABYLON;
                         bodyConfig.pos.push(center.z);
                         bodyConfig.pos.push(center.z);
                         bodyConfig.posShape.push(0, 0, 0);
                         bodyConfig.posShape.push(0, 0, 0);
                         //tmp solution
                         //tmp solution
-                        bodyConfig.rot.push(rot.x * radToDeg);
-                        bodyConfig.rot.push(rot.y * radToDeg);
-                        bodyConfig.rot.push(rot.z * radToDeg);
+                        bodyConfig.rot.push(0);
+                        bodyConfig.rot.push(0);
+                        bodyConfig.rot.push(0);
                         bodyConfig.rotShape.push(0, 0, 0);
                         bodyConfig.rotShape.push(0, 0, 0);
                     }
                     }
                     else {
                     else {
@@ -88190,6 +88195,10 @@ var BABYLON;
                     i.object.rotationQuaternion = oldQuaternion;
                     i.object.rotationQuaternion = oldQuaternion;
                 });
                 });
                 impostor.physicsBody = this.world.add(bodyConfig);
                 impostor.physicsBody = this.world.add(bodyConfig);
+                // set the quaternion, ignoring the previously defined (euler) rotation
+                impostor.physicsBody.resetQuaternion(globalQuaternion_1);
+                // update with delta 0, so the body will reveive the new rotation.
+                impostor.physicsBody.updatePosition(0);
             }
             }
             else {
             else {
                 this._tmpPositionVector.copyFromFloats(0, 0, 0);
                 this._tmpPositionVector.copyFromFloats(0, 0, 0);
@@ -89611,6 +89620,7 @@ var BABYLON;
                 }
                 }
                 else {
                 else {
                     PointerDragBehavior._planeScene = new BABYLON.Scene(this._scene.getEngine());
                     PointerDragBehavior._planeScene = new BABYLON.Scene(this._scene.getEngine());
+                    PointerDragBehavior._planeScene.detachControl();
                     this._scene.getEngine().scenes.pop();
                     this._scene.getEngine().scenes.pop();
                 }
                 }
             }
             }
@@ -89673,7 +89683,7 @@ var BABYLON;
                     }
                     }
                 }
                 }
             });
             });
-            this._scene.onBeforeRenderObservable.add(function () {
+            this._beforeRenderObserver = this._scene.onBeforeRenderObservable.add(function () {
                 if (_this._moving && _this.moveAttached) {
                 if (_this._moving && _this.moveAttached) {
                     // Slowly move mesh to avoid jitter
                     // Slowly move mesh to avoid jitter
                     targetPosition.subtractToRef(_this._attachedNode.absolutePosition, _this._tmpVector);
                     targetPosition.subtractToRef(_this._attachedNode.absolutePosition, _this._tmpVector);
@@ -89767,6 +89777,9 @@ var BABYLON;
             if (this._pointerObserver) {
             if (this._pointerObserver) {
                 this._scene.onPointerObservable.remove(this._pointerObserver);
                 this._scene.onPointerObservable.remove(this._pointerObserver);
             }
             }
+            if (this._beforeRenderObserver) {
+                this._scene.onBeforeRenderObservable.remove(this._beforeRenderObserver);
+            }
         };
         };
         return PointerDragBehavior;
         return PointerDragBehavior;
     }());
     }());
@@ -93436,7 +93449,6 @@ var BABYLON;
         };
         };
         VRExperienceHelperControllerGazer.prototype._setLaserPointerParent = function (mesh) {
         VRExperienceHelperControllerGazer.prototype._setLaserPointerParent = function (mesh) {
             var makeNotPick = function (root) {
             var makeNotPick = function (root) {
-                root.name += " laserPointer";
                 root.isPickable = false;
                 root.isPickable = false;
                 root.getChildMeshes().forEach(function (c) {
                 root.getChildMeshes().forEach(function (c) {
                     makeNotPick(c);
                     makeNotPick(c);
@@ -94233,8 +94245,7 @@ var BABYLON;
                 this._raySelectionPredicate = function (mesh) {
                 this._raySelectionPredicate = function (mesh) {
                     if (_this._isTeleportationFloor(mesh) || (mesh.name.indexOf("gazeTracker") === -1
                     if (_this._isTeleportationFloor(mesh) || (mesh.name.indexOf("gazeTracker") === -1
                         && mesh.name.indexOf("teleportationTarget") === -1
                         && mesh.name.indexOf("teleportationTarget") === -1
-                        && mesh.name.indexOf("torusTeleportation") === -1
-                        && mesh.name.indexOf("laserPointer") === -1)) {
+                        && mesh.name.indexOf("torusTeleportation") === -1)) {
                         return _this.raySelectionPredicate(mesh);
                         return _this.raySelectionPredicate(mesh);
                     }
                     }
                     return false;
                     return false;