From 6f892502c2f7dfe39ec0185af73693dea467cc4c Mon Sep 17 00:00:00 2001 From: liabru Date: Mon, 28 Dec 2015 18:50:07 +0000 Subject: [PATCH] remove constraint torque clamp --- src/constraint/Constraint.js | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/constraint/Constraint.js b/src/constraint/Constraint.js index eb51082..1ec35f1 100644 --- a/src/constraint/Constraint.js +++ b/src/constraint/Constraint.js @@ -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; @@ -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; @@ -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];