3 static rb_object baller
= {
4 .type
= k_rb_shape_box
,
5 .rb
.bbx
= {{ -0.1f
, -0.2f
, -0.1f
},
10 static void testing_update(void){
11 if( vg_getkey( SDLK_9
) ){
12 v3_add( localplayer
.rb
.co
, (v3f
){0,1,0}, baller
.rb
.co
);
13 v3_zero( baller
.rb
.w
);
14 v3_zero( baller
.rb
.v
);
15 q_identity( baller
.rb
.q
);
16 rb_update_transform( &baller
.rb
);
18 rb_object_debug( &baller
, VG__RED
);
20 world_instance
*world
= world_current_instance();
23 rb_ct
*buf
= rb_global_buffer();
24 rb_contact_count
+= rb_box__scene( baller
.rb
.to_world
, baller
.rb
.bbx
,
25 NULL
, &world
->rb_geo
.inf
.scene
, buf
,
26 k_material_flag_ghosts
);
27 for( u32 j
=0; j
<rb_contact_count
; j
++ ){
28 buf
[j
].rba
= &baller
.rb
;
29 buf
[j
].rbb
= &world
->rb_geo
.rb
;
32 rb_presolve_contacts( rb_contact_buffer
, rb_contact_count
);
34 for( u32 i
=0; i
<8; i
++ )
35 rb_solve_contacts( rb_contact_buffer
, rb_contact_count
);
37 rb_iter( &baller
.rb
);
38 rb_update_transform( &baller
.rb
);
41 static void testing_init(void){
42 rb_init_object( &baller
, 1.0f
);