X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=ent_challenge.c;h=10196bf635fce0ed5297ae84ef513391412ef900;hb=4eb81766e4e7c54599b057ebf57b7fab01cd0726;hp=02fac7deaad77e1b9d27fa1a5bb3c9505b3c771a;hpb=9a63a9dde9257c8f140af3a96816bcda232fe739;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/ent_challenge.c b/ent_challenge.c index 02fac7d..10196bf 100644 --- a/ent_challenge.c +++ b/ent_challenge.c @@ -66,26 +66,7 @@ static void ent_challenge_preupdate( ent_challenge *challenge, int active ){ return; } - if( mdl_entity_id_type( challenge->camera ) == k_ent_camera ){ - u32 index = mdl_entity_id_id( challenge->camera ); - ent_camera *cam = mdl_arritm( &world->ent_camera, index ); - - /* TODO COMPRESSION */ - v3f dir = {0.0f,-1.0f,0.0f}; - mdl_transform_vector( &cam->transform, dir, dir ); - m3x3_mulv( localplayer.invbasis, dir, dir ); - player_vector_angles( world_static.focus_cam.angles, dir, 1.0f, 0.0f ); - v3_copy( cam->transform.co, world_static.focus_cam.pos ); - world_static.focus_cam.fov = cam->fov; - } - else { - /* TODO COMPRESSION */ - v3_copy( localplayer.cam.pos, world_static.focus_cam.pos ); - v3_copy( localplayer.cam.angles, world_static.focus_cam.angles ); - world_static.focus_cam.fov = localplayer.cam.fov; - world_static.focus_cam.nearz = localplayer.cam.nearz; - world_static.focus_cam.farz = localplayer.cam.farz; - } + world_entity_focus_camera( world, challenge->camera ); gui_helper_action( button_display_string( k_srbind_maccept ), "start" ); gui_helper_action( button_display_string( k_srbind_mback ), "exit" );