Browse Source

Fixing (again!) a bug with inputManager

David Catuhe 9 năm trước cách đây
mục cha
commit
00aa4cffe7

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 10 - 10
dist/preview release/babylon.core.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 2024 - 2025
dist/preview release/babylon.d.ts


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 10 - 10
dist/preview release/babylon.js


+ 2 - 5
dist/preview release/babylon.max.js

@@ -11591,6 +11591,7 @@ var BABYLON;
                     var construct = BABYLON.CameraInputTypes[this.attached[n].getTypeName()];
                     if (construct) {
                         var input = BABYLON.SerializationHelper.Parse(function () { return new construct(); }, parsedCamera, null);
+                        this.remove(this.attached[n]);
                         this.add(input);
                     }
                 }
@@ -16739,7 +16740,7 @@ var BABYLON;
                 // Physics clone  
                 var physicsEngine = this.getScene().getPhysicsEngine();
                 if (clonePhysicsImpostor && physicsEngine) {
-                    var impostor = physicsEngine.getImpostorForPhysicsObject(mesh);
+                    var impostor = physicsEngine.getImpostorForPhysicsObject(source);
                     if (impostor) {
                         this.physicsImpostor = impostor.clone(this);
                     }
@@ -23669,10 +23670,6 @@ var BABYLON;
         * @param engine is the instance of BABYLON.Engine to use to create the scene
         */
         SceneLoader.Load = function (rootUrl, sceneFilename, engine, onsuccess, progressCallBack, onerror) {
-            if (!SceneLoader._warned) {
-                BABYLON.Tools.Warn("SceneLoader.Load deprecated since 2.4.  Use SceneLoader.Append.");
-                SceneLoader._warned = true;
-            }
             SceneLoader.Append(rootUrl, sceneFilename, new BABYLON.Scene(engine), onsuccess, progressCallBack, onerror);
         };
         /**

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 10 - 10
dist/preview release/babylon.noworker.js


+ 1 - 0
src/Cameras/babylon.cameraInputsManager.js

@@ -121,6 +121,7 @@ var BABYLON;
                     var construct = BABYLON.CameraInputTypes[this.attached[n].getTypeName()];
                     if (construct) {
                         var input = BABYLON.SerializationHelper.Parse(function () { return new construct(); }, parsedCamera, null);
+                        this.remove(this.attached[n]);
                         this.add(input);
                     }
                 }

+ 1 - 0
src/Cameras/babylon.cameraInputsManager.ts

@@ -162,6 +162,7 @@ module BABYLON {
                     var construct = CameraInputTypes[this.attached[n].getTypeName()];
                     if (construct) {
                         var input = SerializationHelper.Parse(() => { return new construct() }, parsedCamera, null);
+                        this.remove(this.attached[n]);
                         this.add(input as any);
                     }
                 }

+ 0 - 4
src/Loading/babylon.sceneLoader.js

@@ -168,10 +168,6 @@ var BABYLON;
         * @param engine is the instance of BABYLON.Engine to use to create the scene
         */
         SceneLoader.Load = function (rootUrl, sceneFilename, engine, onsuccess, progressCallBack, onerror) {
-            if (!SceneLoader._warned) {
-                BABYLON.Tools.Warn("SceneLoader.Load deprecated since 2.4.  Use SceneLoader.Append.");
-                SceneLoader._warned = true;
-            }
             SceneLoader.Append(rootUrl, sceneFilename, new BABYLON.Scene(engine), onsuccess, progressCallBack, onerror);
         };
         /**

+ 1 - 6
src/Loading/babylon.sceneLoader.ts

@@ -179,8 +179,7 @@
                 manifestChecked(true);
             }
         }
-
-        private static _warned : boolean;
+        
         /**
         * Load a scene
         * @param rootUrl a string that defines the root url for scene and resources
@@ -188,10 +187,6 @@
         * @param engine is the instance of BABYLON.Engine to use to create the scene
         */
         public static Load(rootUrl: string, sceneFilename: any, engine: Engine, onsuccess?: (scene: Scene) => void, progressCallBack?: any, onerror?: (scene: Scene) => void): void {
-            if (!SceneLoader._warned) {
-                Tools.Warn("SceneLoader.Load deprecated since 2.4.  Use SceneLoader.Append.");
-                SceneLoader._warned = true;
-            }
             SceneLoader.Append(rootUrl, sceneFilename, new Scene(engine), onsuccess, progressCallBack, onerror);
         }
 

+ 1 - 1
src/Mesh/babylon.mesh.js

@@ -82,7 +82,7 @@ var BABYLON;
                 // Physics clone  
                 var physicsEngine = this.getScene().getPhysicsEngine();
                 if (clonePhysicsImpostor && physicsEngine) {
-                    var impostor = physicsEngine.getImpostorForPhysicsObject(mesh);
+                    var impostor = physicsEngine.getImpostorForPhysicsObject(source);
                     if (impostor) {
                         this.physicsImpostor = impostor.clone(this);
                     }

+ 1 - 1
src/Mesh/babylon.mesh.ts

@@ -163,7 +163,7 @@
                 // Physics clone  
                 var physicsEngine = this.getScene().getPhysicsEngine();
                 if (clonePhysicsImpostor && physicsEngine) {
-                    var impostor = physicsEngine.getImpostorForPhysicsObject(source);
+                    var impostor = physicsEngine.getImpostorForPhysicsObject(source); 
                     if (impostor) {
                         this.physicsImpostor = impostor.clone(this);
                     }