|
@@ -272,9 +272,10 @@ import { AbstractMesh } from "../../Meshes/abstractMesh";
|
|
|
body.setCollisionFlags(body.getCollisionFlags() | AmmoJSPlugin.DISABLE_COLLISION_FLAG);
|
|
|
}
|
|
|
|
|
|
- body.setRestitution(impostor.getParam("restitution"));
|
|
|
this.world.addRigidBody(body);
|
|
|
impostor.physicsBody = body;
|
|
|
+ this.setBodyRestitution(impostor, impostor.getParam("restitution"));
|
|
|
+ this.setBodyFriction(impostor, impostor.getParam("friction"));
|
|
|
|
|
|
impostor._pluginData.toDispose.concat([body, rbInfo, myMotionState, startTransform, localInertia, colShape]);
|
|
|
}
|
|
@@ -342,7 +343,7 @@ import { AbstractMesh } from "../../Meshes/abstractMesh";
|
|
|
joint = new Ammo.btPoint2PointConstraint(mainBody, connectedBody, new Ammo.btVector3(jointData.mainPivot.x, jointData.mainPivot.y, jointData.mainPivot.z), new Ammo.btVector3(jointData.connectedPivot.x, jointData.connectedPivot.y, jointData.connectedPivot.z));
|
|
|
break;
|
|
|
}
|
|
|
- this.world.addConstraint(joint, true);
|
|
|
+ this.world.addConstraint(joint, !impostorJoint.joint.jointData.collision);
|
|
|
impostorJoint.joint.physicsJoint = joint;
|
|
|
}
|
|
|
|
|
@@ -620,7 +621,7 @@ import { AbstractMesh } from "../../Meshes/abstractMesh";
|
|
|
* @returns friction value
|
|
|
*/
|
|
|
public getBodyFriction(impostor: PhysicsImpostor): number {
|
|
|
- return impostor.physicsBody.getFriction();
|
|
|
+ return impostor._pluginData.friction;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -630,6 +631,7 @@ import { AbstractMesh } from "../../Meshes/abstractMesh";
|
|
|
*/
|
|
|
public setBodyFriction(impostor: PhysicsImpostor, friction: number) {
|
|
|
impostor.physicsBody.setFriction(friction);
|
|
|
+ impostor._pluginData.friction = friction;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -638,7 +640,7 @@ import { AbstractMesh } from "../../Meshes/abstractMesh";
|
|
|
* @returns restitution value
|
|
|
*/
|
|
|
public getBodyRestitution(impostor: PhysicsImpostor): number {
|
|
|
- return impostor.physicsBody.getRestitution();
|
|
|
+ return impostor._pluginData.restitution;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -648,6 +650,7 @@ import { AbstractMesh } from "../../Meshes/abstractMesh";
|
|
|
*/
|
|
|
public setBodyRestitution(impostor: PhysicsImpostor, restitution: number) {
|
|
|
impostor.physicsBody.setRestitution(restitution);
|
|
|
+ impostor._pluginData.restitution = restitution;
|
|
|
}
|
|
|
|
|
|
/**
|