Skip to content

Commit

Permalink
remove constraint torque clamp
Browse files Browse the repository at this point in the history
  • Loading branch information
liabru committed Dec 28, 2015
1 parent 2e6afd4 commit 6f89250
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions src/constraint/Constraint.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,6 @@ var Common = require('../core/Common');
if (bodyA && !bodyA.isStatic) {
torque = Vector.cross(offsetA, normalVelocity) * bodyA.inverseInertia * (1 - constraint.angularStiffness);

Sleeping.set(bodyA, false);

// clamp to prevent instability
// TODO: solve this properly
torque = Common.clamp(torque, -0.01, 0.01);

// keep track of applied impulses for post solving
bodyA.constraintImpulse.x -= force.x;
bodyA.constraintImpulse.y -= force.y;
Expand All @@ -226,12 +220,6 @@ var Common = require('../core/Common');
if (bodyB && !bodyB.isStatic) {
torque = Vector.cross(offsetB, normalVelocity) * bodyB.inverseInertia * (1 - constraint.angularStiffness);

Sleeping.set(bodyB, false);

// clamp to prevent instability
// TODO: solve this properly
torque = Common.clamp(torque, -0.01, 0.01);

// keep track of applied impulses for post solving
bodyB.constraintImpulse.x += force.x;
bodyB.constraintImpulse.y += force.y;
Expand Down Expand Up @@ -260,6 +248,8 @@ var Common = require('../core/Common');
continue;
}

Sleeping.set(body, false);

// update geometry and reset
for (var j = 0; j < body.parts.length; j++) {
var part = body.parts[j];
Expand Down

0 comments on commit 6f89250

Please sign in to comment.