Explorar o código

fixing two bugs in cannon's plugin

Raanan Weber %!s(int64=9) %!d(string=hai) anos
pai
achega
eea335128b
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  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;