X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=world_entity.c;h=146683669bc4e5d7512b600c9bb74a8eeaee505c;hb=1c56bc84c9ad3da49c9d2447ec97aaf7f6038601;hp=e0c67d82645bd0100701b2186023be07bbbbbd27;hpb=77c2df4874873fb2d085b9413ed97f66681ad7ac;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/world_entity.c b/world_entity.c index e0c67d8..1466836 100644 --- a/world_entity.c +++ b/world_entity.c @@ -37,8 +37,7 @@ static void world_entity_focus_camera( world_instance *world, u32 uid ){ 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_angles( dir, world_static.focus_cam.angles ); v3_copy( cam->transform.co, world_static.focus_cam.pos ); world_static.focus_cam.fov = cam->fov; } @@ -93,10 +92,9 @@ static void world_entity_focus_render(void){ ent_skateshop *skateshop = mdl_arritm( &world->ent_skateshop, index ); skateshop_render( skateshop ); } - else if( type == k_ent_challenge ){ - } - else if( type == k_ent_route ){ - } + else if( type == k_ent_challenge ){} + else if( type == k_ent_route ){} + else if( type == k_ent_miniworld ){} else { vg_fatal_error( "Programming error\n" ); } @@ -124,6 +122,7 @@ static void world_gen_entities_init( world_instance *world ){ gate_transform_update( gate ); } } + vg_async_call( world_link_nonlocal_async, world, 0 ); /* water */ @@ -287,6 +286,17 @@ static void ent_volume_call( world_instance *world, ent_call *call ) entity_call( world, call ); } } + else if( call->function == k_ent_function_trigger_leave ){ + call->id = volume->target; + + if( volume->flags & k_ent_volume_flag_particles ){ + assert(0); + } + else{ + call->function = volume->trigger.event_leave; + entity_call( world, call ); + } + } } static void ent_audio_call( world_instance *world, ent_call *call ){ @@ -308,7 +318,7 @@ static void ent_audio_call( world_instance *world, ent_call *call ){ v3_copy( audio->transform.co, sound_co ); } else - vg_fatal_error( "ent_audio_call (invalid function id)" ); + return; float chance = vg_randf64()*100.0f, bar = 0.0f;