Skip to content

Commit

Permalink
fix constraint.angularStiffness
Browse files Browse the repository at this point in the history
  • Loading branch information
liabru committed May 3, 2017
1 parent 1bae2de commit ab0283b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/constraint/Constraint.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ var Common = require('../core/Common');
bodyA.position.y -= force.y * share;

// apply torque
torque = (Vector.cross(pointA, force) / resistanceTotal) * Constraint._torqueDampen * bodyA.inverseInertia;
torque = (Vector.cross(pointA, force) / resistanceTotal) * Constraint._torqueDampen * bodyA.inverseInertia * (1 - constraint.angularStiffness);
bodyA.constraintImpulse.angle -= torque;
bodyA.angle -= torque;
}
Expand All @@ -208,7 +208,7 @@ var Common = require('../core/Common');
bodyB.position.y += force.y * share;

// apply torque
torque = (Vector.cross(pointB, force) / resistanceTotal) * Constraint._torqueDampen * bodyB.inverseInertia;
torque = (Vector.cross(pointB, force) / resistanceTotal) * Constraint._torqueDampen * bodyB.inverseInertia * (1 - constraint.angularStiffness);
bodyB.constraintImpulse.angle += torque;
bodyB.angle += torque;
}
Expand Down

0 comments on commit ab0283b

Please sign in to comment.