@@ -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) {
@@ -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 {