Skip to content

Commit

Permalink
improve delta factors in resolver and constraint stiffness
Browse files Browse the repository at this point in the history
  • Loading branch information
liabru committed Aug 6, 2022
1 parent c6a1a6d commit 9dc6be7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/collision/Resolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,9 @@ var Bounds = require('../geometry/Bounds');
timeScaleSquared = timeScale * timeScale,
timeScaleCubed = timeScaleSquared * timeScale,
restingThresh = -Resolver._restingThresh * timeScale,
restingThreshTangent = Resolver._restingThreshTangent * timeScale,
restingThreshTangent = Resolver._restingThreshTangent,
frictionNormalMultiplier = Resolver._frictionNormalMultiplier * timeScale,
frictionMaxStatic = Resolver._frictionMaxStatic * timeScale,
frictionMaxStatic = Resolver._frictionMaxStatic,
pairsLength = pairs.length,
tangentImpulse,
maxFriction,
Expand Down
2 changes: 1 addition & 1 deletion src/constraint/Constraint.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ var Common = require('../core/Common');
isRigid = constraint.stiffness >= 1 || constraint.length === 0,
stiffness = isRigid ? constraint.stiffness * timeScale
: constraint.stiffness * timeScale * timeScale,
damping = constraint.damping * timeScale * timeScale,
damping = constraint.damping * timeScale,
force = Vector.mult(delta, difference * stiffness),
massTotal = (bodyA ? bodyA.inverseMass : 0) + (bodyB ? bodyB.inverseMass : 0),
inertiaTotal = (bodyA ? bodyA.inverseInertia : 0) + (bodyB ? bodyB.inverseInertia : 0),
Expand Down

0 comments on commit 9dc6be7

Please sign in to comment.