X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=world_entity.h;h=c954052a4149ff924c0ddef42588e723c8630dac;hb=72f789aa46c913ec2ffa10907b2124f8d09670e5;hp=3c6d10de95407f3b1a1ad8df25efc982754d9a1f;hpb=4c95c9c3e6033cd1360adacef3c80fc4da933715;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/world_entity.h b/world_entity.h index 3c6d10d..c954052 100644 --- a/world_entity.h +++ b/world_entity.h @@ -1,17 +1,46 @@ -#ifndef WORLD_ENTITY_H -#define WORLD_ENTITY_H - +#pragma once #include "world.h" #include "entity.h" +#include "vg/vg_bvh.h" +#include "vg/vg_msg.h" + +typedef struct ent_focus_context ent_focus_context; +struct ent_focus_context +{ + world_instance *world; + u32 index; /* Array index of the focused entity */ + bool active; +}; + +void world_gen_entities_init( world_instance *world ); +ent_spawn *world_find_spawn_by_name( world_instance *world, + const char *name ); +ent_spawn *world_find_closest_spawn( world_instance *world, + v3f position ); +void world_default_spawn_pos( world_instance *world, v3f pos ); +void world_entity_start( world_instance *world, vg_msg *sav ); +void world_entity_serialize( world_instance *world, vg_msg *sav ); + +entity_call_result ent_volume_call( world_instance *world, ent_call *call ); +entity_call_result ent_audio_call( world_instance *world, ent_call *call ); +entity_call_result ent_ccmd_call( world_instance *world, ent_call *call ); + +void entity_bh_expand_bound( void *user, boxf bound, u32 item_index ); +float entity_bh_centroid( void *user, u32 item_index, int axis ); +void entity_bh_swap( void *user, u32 ia, u32 ib ); +void entity_bh_debug( void *user, u32 item_index ); +void entity_bh_closest( void *user, u32 item_index, v3f point, + v3f closest ); + +void world_entity_set_focus( u32 entity_id ); +void world_entity_focus_modal(void); -VG_STATIC void world_gen_entities_init(void); -VG_STATIC ent_spawn *world_find_spawn_by_name( world_instance *world, - const char *name ); -VG_STATIC ent_spawn *world_find_closest_spawn( world_instance *world, - v3f position ); +void world_entity_exit_modal(void); +void world_entity_clear_focus(void); -VG_STATIC void ent_volume_call( world_instance *world, ent_call *call ); -VG_STATIC void ent_audio_call( world_instance *world, ent_call *call ); -VG_STATIC void ent_ccmd_call( world_instance *world, ent_call *call ); +void world_entity_focus_preupdate(void); +void world_entity_focus_render(void); +void world_entity_focus_camera( world_instance *world, u32 uid ); +void update_ach_models(void); -#endif /* WORLD_ENTITY_H */ +extern bh_system bh_system_entity_list;