浏览代码

Merge pull request #1084 from RaananW/physics-bug-fix

Physics bug fix
David Catuhe 9 年之前
父节点
当前提交
ad29772ef8
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      src/Physics/Plugins/babylon.cannonJSPlugin.ts
  2. 1 1
      src/Physics/babylon.physicsImpostor.ts

+ 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 {