Skip to content

Commit 6f89250

Browse files
committed
remove constraint torque clamp
1 parent 2e6afd4 commit 6f89250

1 file changed

Lines changed: 2 additions & 12 deletions

File tree

src/constraint/Constraint.js

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -206,12 +206,6 @@ var Common = require('../core/Common');
206206
if (bodyA && !bodyA.isStatic) {
207207
torque = Vector.cross(offsetA, normalVelocity) * bodyA.inverseInertia * (1 - constraint.angularStiffness);
208208

209-
Sleeping.set(bodyA, false);
210-
211-
// clamp to prevent instability
212-
// TODO: solve this properly
213-
torque = Common.clamp(torque, -0.01, 0.01);
214-
215209
// keep track of applied impulses for post solving
216210
bodyA.constraintImpulse.x -= force.x;
217211
bodyA.constraintImpulse.y -= force.y;
@@ -226,12 +220,6 @@ var Common = require('../core/Common');
226220
if (bodyB && !bodyB.isStatic) {
227221
torque = Vector.cross(offsetB, normalVelocity) * bodyB.inverseInertia * (1 - constraint.angularStiffness);
228222

229-
Sleeping.set(bodyB, false);
230-
231-
// clamp to prevent instability
232-
// TODO: solve this properly
233-
torque = Common.clamp(torque, -0.01, 0.01);
234-
235223
// keep track of applied impulses for post solving
236224
bodyB.constraintImpulse.x += force.x;
237225
bodyB.constraintImpulse.y += force.y;
@@ -260,6 +248,8 @@ var Common = require('../core/Common');
260248
continue;
261249
}
262250

251+
Sleeping.set(body, false);
252+
263253
// update geometry and reset
264254
for (var j = 0; j < body.parts.length; j++) {
265255
var part = body.parts[j];

0 commit comments

Comments
 (0)