X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=world_entity.h;h=3baaa2385a591aac82a822e3ff719af234ee4e59;hb=7eba38b8178c82040618a518634d8ff4813e2ff2;hp=3c6d10de95407f3b1a1ad8df25efc982754d9a1f;hpb=4c95c9c3e6033cd1360adacef3c80fc4da933715;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/world_entity.h b/world_entity.h index 3c6d10d..3baaa23 100644 --- a/world_entity.h +++ b/world_entity.h @@ -3,6 +3,7 @@ #include "world.h" #include "entity.h" +#include "bvh.h" VG_STATIC void world_gen_entities_init(void); VG_STATIC ent_spawn *world_find_spawn_by_name( world_instance *world, @@ -14,4 +15,18 @@ 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 ); +VG_STATIC void entity_bh_expand_bound( void *user, boxf bound, u32 item_index ); +VG_STATIC float entity_bh_centroid( void *user, u32 item_index, int axis ); +VG_STATIC void entity_bh_swap( void *user, u32 ia, u32 ib ); +VG_STATIC void entity_bh_debug( void *user, u32 item_index ); + +static bh_system bh_system_entity_list = { + .expand_bound = entity_bh_expand_bound, + .item_centroid = entity_bh_centroid, + .item_closest = NULL, + .item_swap = entity_bh_swap, + .item_debug = entity_bh_debug, + .cast_ray = NULL +}; + #endif /* WORLD_ENTITY_H */