소스 검색

Fixing dispose bug

Raanan Weber 9 년 전
부모
커밋
d5524122cb
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 {