@@ -16,7 +16,9 @@ var Pair = {};
1616 */
1717 Pair . create = function ( collision , timestamp ) {
1818 var bodyA = collision . bodyA ,
19- bodyB = collision . bodyB ;
19+ bodyB = collision . bodyB ,
20+ parentA = collision . parentA ,
21+ parentB = collision . parentB ;
2022
2123 var pair = {
2224 id : Pair . id ( bodyA , bodyB ) ,
@@ -28,10 +30,10 @@ var Pair = {};
2830 isActive : true ,
2931 timeCreated : timestamp ,
3032 timeUpdated : timestamp ,
31- inverseMass : bodyA . inverseMass + bodyB . inverseMass ,
32- friction : Math . min ( bodyA . friction , bodyB . friction ) ,
33- restitution : Math . max ( bodyA . restitution , bodyB . restitution ) ,
34- slop : Math . max ( bodyA . slop , bodyB . slop )
33+ inverseMass : parentA . inverseMass + parentB . inverseMass ,
34+ friction : Math . min ( parentA . friction , parentB . friction ) ,
35+ restitution : Math . max ( parentA . restitution , parentB . restitution ) ,
36+ slop : Math . max ( parentA . slop , parentB . slop )
3537 } ;
3638
3739 Pair . update ( pair , collision , timestamp ) ;
@@ -48,13 +50,15 @@ var Pair = {};
4850 Pair . update = function ( pair , collision , timestamp ) {
4951 var contacts = pair . contacts ,
5052 supports = collision . supports ,
51- activeContacts = pair . activeContacts ;
53+ activeContacts = pair . activeContacts ,
54+ parentA = collision . parentA ,
55+ parentB = collision . parentB ;
5256
5357 pair . collision = collision ;
54- pair . inverseMass = collision . bodyA . inverseMass + collision . bodyB . inverseMass ;
55- pair . friction = Math . min ( collision . bodyA . friction , collision . bodyB . friction ) ;
56- pair . restitution = Math . max ( collision . bodyA . restitution , collision . bodyB . restitution ) ;
57- pair . slop = Math . max ( collision . bodyA . slop , collision . bodyB . slop ) ;
58+ pair . inverseMass = parentA . inverseMass + parentB . inverseMass ;
59+ pair . friction = Math . min ( parentA . friction , parentB . friction ) ;
60+ pair . restitution = Math . max ( parentA . restitution , parentB . restitution ) ;
61+ pair . slop = Math . max ( parentA . slop , parentB . slop ) ;
5862 activeContacts . length = 0 ;
5963
6064 if ( collision . collided ) {
0 commit comments