瀏覽代碼

fixing two bugs in cannon's plugin

Raanan Weber 9 年之前
父節點
當前提交
eea335128b
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/Physics/Plugins/babylon.cannonJSPlugin.ts

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

@@ -206,7 +206,7 @@
         }
 
         public removeJoint(impostorJoint: PhysicsImpostorJoint) {
-            this.world.removeConstraint(impostorJoint.joint);
+            this.world.removeConstraint(impostorJoint.joint.physicsJoint);
         }
 
         private _addMaterial(name: string, friction: number, restitution: number) {
@@ -221,7 +221,7 @@
                 }
             }
 
-            var currentMat = new CANNON.Material("mat");
+            var currentMat = new CANNON.Material(name);
             currentMat.friction = friction;
             currentMat.restitution = restitution;