@@ -117,26 +117,26 @@ impl ParallelInteractionGroups {
117117 ( false , false ) => {
118118 let rb1 = & bodies[ body_pair. 0 . unwrap ( ) ] ;
119119 let rb2 = & bodies[ body_pair. 1 . unwrap ( ) ] ;
120- let color_mask = bcolors [ rb1 . ids . active_set_offset as usize ]
121- | bcolors[ rb2. ids . active_set_offset as usize ] ;
120+ let color_mask =
121+ bcolors [ rb1 . ids . active_set_id ] | bcolors[ rb2. ids . active_set_id ] ;
122122 * color = ( !color_mask) . trailing_zeros ( ) as usize ;
123123 color_len[ * color] += 1 ;
124- bcolors[ rb1. ids . active_set_offset as usize ] |= 1 << * color;
125- bcolors[ rb2. ids . active_set_offset as usize ] |= 1 << * color;
124+ bcolors[ rb1. ids . active_set_id ] |= 1 << * color;
125+ bcolors[ rb2. ids . active_set_id ] |= 1 << * color;
126126 }
127127 ( true , false ) => {
128128 let rb2 = & bodies[ body_pair. 1 . unwrap ( ) ] ;
129- let color_mask = bcolors[ rb2. ids . active_set_offset as usize ] ;
129+ let color_mask = bcolors[ rb2. ids . active_set_id ] ;
130130 * color = 127 - ( !color_mask) . leading_zeros ( ) as usize ;
131131 color_len[ * color] += 1 ;
132- bcolors[ rb2. ids . active_set_offset as usize ] |= 1 << * color;
132+ bcolors[ rb2. ids . active_set_id ] |= 1 << * color;
133133 }
134134 ( false , true ) => {
135135 let rb1 = & bodies[ body_pair. 0 . unwrap ( ) ] ;
136- let color_mask = bcolors[ rb1. ids . active_set_offset as usize ] ;
136+ let color_mask = bcolors[ rb1. ids . active_set_id ] ;
137137 * color = 127 - ( !color_mask) . leading_zeros ( ) as usize ;
138138 color_len[ * color] += 1 ;
139- bcolors[ rb1. ids . active_set_offset as usize ] |= 1 << * color;
139+ bcolors[ rb1. ids . active_set_id ] |= 1 << * color;
140140 }
141141 ( true , true ) => unreachable ! ( ) ,
142142 }
@@ -270,18 +270,10 @@ impl InteractionGroups {
270270 }
271271
272272 let ijoint = interaction. data . locked_axes . bits ( ) as usize ;
273- let i1 = rb1. ids . active_set_offset ;
274- let i2 = rb2. ids . active_set_offset ;
275- let conflicts = self
276- . body_masks
277- . get ( i1 as usize )
278- . copied ( )
279- . unwrap_or_default ( )
280- | self
281- . body_masks
282- . get ( i2 as usize )
283- . copied ( )
284- . unwrap_or_default ( )
273+ let i1 = rb1. ids . active_set_id ;
274+ let i2 = rb2. ids . active_set_id ;
275+ let conflicts = self . body_masks . get ( i1) . copied ( ) . unwrap_or_default ( )
276+ | self . body_masks . get ( i2) . copied ( ) . unwrap_or_default ( )
285277 | joint_type_conflicts[ ijoint] ;
286278 let conflictfree_targets = !( conflicts & occupied_mask) ; // The & is because we consider empty buckets as free of conflicts.
287279 let conflictfree_occupied_targets = conflictfree_targets & occupied_mask;
@@ -420,17 +412,15 @@ impl InteractionGroups {
420412 continue ;
421413 }
422414
423- let ( status1, active_set_offset1) = if let Some ( rb1) = interaction. data . rigid_body1
424- {
415+ let ( status1, active_set_id1) = if let Some ( rb1) = interaction. data . rigid_body1 {
425416 let rb1 = & bodies[ rb1] ;
426- ( rb1. body_type , rb1. ids . active_set_offset )
417+ ( rb1. body_type , rb1. ids . active_set_id as u32 )
427418 } else {
428419 ( RigidBodyType :: Fixed , u32:: MAX )
429420 } ;
430- let ( status2, active_set_offset2) = if let Some ( rb2) = interaction. data . rigid_body2
431- {
421+ let ( status2, active_set_id2) = if let Some ( rb2) = interaction. data . rigid_body2 {
432422 let rb2 = & bodies[ rb2] ;
433- ( rb2. body_type , rb2. ids . active_set_offset )
423+ ( rb2. body_type , rb2. ids . active_set_id as u32 )
434424 } else {
435425 ( RigidBodyType :: Fixed , u32:: MAX )
436426 } ;
@@ -443,8 +433,8 @@ impl InteractionGroups {
443433 continue ;
444434 }
445435
446- let i1 = active_set_offset1 ;
447- let i2 = active_set_offset2 ;
436+ let i1 = active_set_id1 ;
437+ let i2 = active_set_id2 ;
448438 let mask1 = if !is_fixed1 {
449439 self . body_masks [ i1 as usize ]
450440 } else {
0 commit comments