- for( int i=0; i<rd->part_count; i ++ )
- rb_collide( &rd->parts[i].rb, &world->rb_geo );
+
+ float contact_velocities[256];
+
+ for( int i=0; i<rd->part_count; i ++ ){
+ if( rb_global_has_space() ){
+ rb_ct *buf = rb_global_buffer();
+
+ int l;
+
+ if( rd->parts[i].rb.type == k_rb_shape_capsule ){
+ l = rb_capsule__scene( rd->parts[i].rb.to_world,
+ &rd->parts[i].rb.inf.capsule,
+ NULL, &world->rb_geo.inf.scene, buf );
+ }
+ else if( rd->parts[i].rb.type == k_rb_shape_box ){
+ l = rb_box__scene( rd->parts[i].rb.to_world,
+ rd->parts[i].rb.bbx,
+ NULL, &world->rb_geo.inf.scene, buf );
+ }
+ else continue;
+
+ for( int j=0; j<l; j++ ){
+ buf[j].rba = &rd->parts[i].rb;
+ buf[j].rbb = &world->rb_geo;
+ }
+
+ rb_contact_count += l;
+ }
+ }