mirror of
https://github.com/liabru/matter-js.git
synced 2024-12-26 13:49:01 -05:00
fix constraint.angularStiffness
This commit is contained in:
parent
1bae2dee45
commit
ab0283b5b3
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue