X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=physics_test.h;h=acf4ed3cd96c6e46183b3995a81093075a51601d;hb=b4c9550f206c476bb38b0bb2855d35e6b31bee83;hp=8143c1d02d4bc4814423cb3cc8389675e70ba48e;hpb=344f0153cf1907da87dd041db3ec517325b1c429;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/physics_test.h b/physics_test.h index 8143c1d..acf4ed3 100644 --- a/physics_test.h +++ b/physics_test.h @@ -19,6 +19,26 @@ rigidbody blocky = .is_world = 1 }; +rigidbody marko = +{ + .type = k_rb_shape_box, + .bbx = {{-2.0f,-2.0f,-2.0f},{2.0f,2.0f,2.0f}}, + .co = {-36.0f,8.0f,-36.0f}, + .q = {0.0f,0.0f,0.0f,1.0f}, + .is_world = 0 +}; + +scene epic_scene; + +rigidbody epic_scene_rb = +{ + .type = k_rb_shape_scene, + .co = {0.0f,0.0f,0.0f}, + .q = {0.0f,0.0f,0.0f,1.0f}, + .is_world = 1, + .inf.scene = { .pscene = &epic_scene } +}; + rigidbody funnel[4] = { { .type = k_rb_shape_box, @@ -53,7 +73,7 @@ rigidbody jeff1 = { .type = k_rb_shape_capsule, }; rigidbody ball = { .type = k_rb_shape_sphere, - .inf.sphere = { .radius = 2.0f }, + .inf.sphere = { .radius = 4.0f }, .co = {0.0f,20.0f,2.0f}, .q = {0.0f,0.0f,0.0f,1.0f}}, @@ -68,6 +88,8 @@ static void reorg_jeffs(void) { for( int i=0; inode_count; i++ ) + { + mdl_node *pnode = mdl_node_from_id( mdl, i ); + + for( int j=0; jsubmesh_count; j++ ) + { + mdl_submesh *sm = mdl_node_submesh( mdl, pnode, j ); + scene_add_submesh( &epic_scene, mdl, sm, transform ); + } + } + + free( mdl ); + scene_bh_create( &epic_scene ); + + rb_init( &epic_scene_rb ); + rb_init( &marko ); } static void physics_test_update(void) @@ -107,7 +153,6 @@ static void physics_test_update(void) player_freecam(); player_camera_update(); - for( int i=0; i<4; i++ ) rb_debug( &funnel[i], 0xff0060e0 ); rb_debug( &ground, 0xff00ff00 ); @@ -117,79 +162,78 @@ static void physics_test_update(void) rb_debug( &blocky, 0xffcccccc ); rb_debug( &jeff1, 0xff00ffff ); - for( int i=0; i