Forráskód Böngészése

Fixing dispose bug

Raanan Weber 9 éve
szülő
commit
d5524122cb

+ 1 - 1
src/Physics/Plugins/babylon.cannonJSPlugin.ts

@@ -206,7 +206,7 @@
         }
 
         public removeJoint(impostorJoint: PhysicsImpostorJoint) {
-            this.world.remove(impostorJoint.joint);
+            this.world.removeConstraint(impostorJoint.joint);
         }
 
         private _addMaterial(name: string, friction: number, restitution: number) {

+ 1 - 1
src/Physics/babylon.physicsImpostor.ts

@@ -395,7 +395,7 @@ module BABYLON {
                 this._physicsEngine.removeJoint(this, j.otherImpostor, j.joint);
             })
             //dispose the physics body
-            this.physicsBody = null;
+            this._physicsEngine.removeImpostor(this);
             if (this.parent) {
                 this.parent.forceUpdate();
             } else {