File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -279,10 +279,10 @@ var Resolver = {};
279279 // modify impulses accounting for mass, inertia and offset
280280 var oAcN = Vector . cross ( offsetA , normal ) ,
281281 oBcN = Vector . cross ( offsetB , normal ) ,
282- share = contactShare / ( bodyA . inverseMass + bodyB . inverseMass + bodyA . inverseInertia * oAcN * oAcN + bodyB . inverseInertia * oBcN * oBcN ) ;
282+ denom = bodyA . inverseMass + bodyB . inverseMass + bodyA . inverseInertia * oAcN * oAcN + bodyB . inverseInertia * oBcN * oBcN ;
283283
284- normalImpulse *= share ;
285- tangentImpulse *= Math . min ( share , 1 ) ;
284+ normalImpulse *= contactShare / denom ;
285+ tangentImpulse *= contactShare / ( 1 + denom ) ;
286286
287287 // handle high velocity and resting collisions separately
288288 if ( normalVelocity < 0 && normalVelocity * normalVelocity > Resolver . _restingThresh * timeScaleSquared ) {
You can’t perform that action at this time.
0 commit comments