Browse Source

fixing two bugs in cannon's plugin

Raanan Weber 9 years ago
parent
commit
eea335128b
1 changed files with 2 additions and 2 deletions
  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;