|
@@ -111,7 +111,7 @@ export class CannonJSPlugin implements IPhysicsEnginePlugin {
|
|
//try to keep the body moving in the right direction by taking old properties.
|
|
//try to keep the body moving in the right direction by taking old properties.
|
|
//Should be tested!
|
|
//Should be tested!
|
|
if (oldBody) {
|
|
if (oldBody) {
|
|
- ['force', 'torque', 'velocity', 'angularVelocity'].forEach(function (param) {
|
|
|
|
|
|
+ ['force', 'torque', 'velocity', 'angularVelocity'].forEach(function(param) {
|
|
impostor.physicsBody[param].copy(oldBody[param]);
|
|
impostor.physicsBody[param].copy(oldBody[param]);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -214,7 +214,7 @@ export class CannonJSPlugin implements IPhysicsEnginePlugin {
|
|
if (impostorJoint.joint.type !== PhysicsJoint.SpringJoint) {
|
|
if (impostorJoint.joint.type !== PhysicsJoint.SpringJoint) {
|
|
this.world.addConstraint(constraint);
|
|
this.world.addConstraint(constraint);
|
|
} else {
|
|
} else {
|
|
- (<SpringJointData>impostorJoint.joint.jointData).forceApplicationCallback = (<SpringJointData>impostorJoint.joint.jointData).forceApplicationCallback || function () {
|
|
|
|
|
|
+ (<SpringJointData>impostorJoint.joint.jointData).forceApplicationCallback = (<SpringJointData>impostorJoint.joint.jointData).forceApplicationCallback || function() {
|
|
constraint.applyForce();
|
|
constraint.applyForce();
|
|
};
|
|
};
|
|
impostorJoint.mainImpostor.registerAfterPhysicsStep((<SpringJointData>impostorJoint.joint.jointData).forceApplicationCallback);
|
|
impostorJoint.mainImpostor.registerAfterPhysicsStep((<SpringJointData>impostorJoint.joint.jointData).forceApplicationCallback);
|
|
@@ -626,7 +626,7 @@ export class CannonJSPlugin implements IPhysicsEnginePlugin {
|
|
//this will force cannon to execute at least one step when using interpolation
|
|
//this will force cannon to execute at least one step when using interpolation
|
|
let step_tmp1 = new this.BJSCANNON.Vec3();
|
|
let step_tmp1 = new this.BJSCANNON.Vec3();
|
|
let Engine = this.BJSCANNON;
|
|
let Engine = this.BJSCANNON;
|
|
- this.BJSCANNON.World.prototype.step = function (dt: number, timeSinceLastCalled: number, maxSubSteps: number) {
|
|
|
|
|
|
+ this.BJSCANNON.World.prototype.step = function(dt: number, timeSinceLastCalled: number, maxSubSteps: number) {
|
|
maxSubSteps = maxSubSteps || 10;
|
|
maxSubSteps = maxSubSteps || 10;
|
|
timeSinceLastCalled = timeSinceLastCalled || 0;
|
|
timeSinceLastCalled = timeSinceLastCalled || 0;
|
|
if (timeSinceLastCalled === 0) {
|
|
if (timeSinceLastCalled === 0) {
|