Skip to content
This repository has been archived by the owner on Dec 15, 2019. It is now read-only.

Commit

Permalink
minor change
Browse files Browse the repository at this point in the history
  • Loading branch information
wellcaffeinated committed Dec 8, 2014
1 parent a06333f commit 1f3f79a
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/behaviors/body-impulse-response.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ Physics.behavior('body-impulse-response', function( parent ){
,impulse
,sign
,max
,ratio
,inContact = contact
;

Expand All @@ -156,13 +157,15 @@ Physics.behavior('body-impulse-response', function( parent ){

} else {

mtv.mult( 0.5 );
mtv.negate();
clampMTV( bodyA._mtvTotal, mtv, tmp );
bodyA._mtvTotal.vadd( tmp );
mtv.negate();
ratio = 0.5; //bodyA.mass / ( bodyA.mass + bodyB.mass );
mtv.mult( ratio );
clampMTV( bodyB._mtvTotal, mtv, tmp );
bodyB._mtvTotal.vadd( tmp );

mtv.clone( mtrans ).mult( ratio - 1 );
clampMTV( bodyA._mtvTotal, mtv, tmp );
bodyA._mtvTotal.vadd( tmp );

}
}

Expand Down

0 comments on commit 1f3f79a

Please sign in to comment.