c954052a4149ff924c0ddef42588e723c8630dac
[carveJwlIkooP6JGAAIwe30JlM.git] / world_entity.h
1 #pragma once
2 #include "world.h"
3 #include "entity.h"
4 #include "vg/vg_bvh.h"
5 #include "vg/vg_msg.h"
6
7 typedef struct ent_focus_context ent_focus_context;
8 struct ent_focus_context
9 {
10 world_instance *world;
11 u32 index; /* Array index of the focused entity */
12 bool active;
13 };
14
15 void world_gen_entities_init( world_instance *world );
16 ent_spawn *world_find_spawn_by_name( world_instance *world,
17 const char *name );
18 ent_spawn *world_find_closest_spawn( world_instance *world,
19 v3f position );
20 void world_default_spawn_pos( world_instance *world, v3f pos );
21 void world_entity_start( world_instance *world, vg_msg *sav );
22 void world_entity_serialize( world_instance *world, vg_msg *sav );
23
24 entity_call_result ent_volume_call( world_instance *world, ent_call *call );
25 entity_call_result ent_audio_call( world_instance *world, ent_call *call );
26 entity_call_result ent_ccmd_call( world_instance *world, ent_call *call );
27
28 void entity_bh_expand_bound( void *user, boxf bound, u32 item_index );
29 float entity_bh_centroid( void *user, u32 item_index, int axis );
30 void entity_bh_swap( void *user, u32 ia, u32 ib );
31 void entity_bh_debug( void *user, u32 item_index );
32 void entity_bh_closest( void *user, u32 item_index, v3f point,
33 v3f closest );
34
35 void world_entity_set_focus( u32 entity_id );
36 void world_entity_focus_modal(void);
37
38 void world_entity_exit_modal(void);
39 void world_entity_clear_focus(void);
40
41 void world_entity_focus_preupdate(void);
42 void world_entity_focus_render(void);
43 void world_entity_focus_camera( world_instance *world, u32 uid );
44 void update_ach_models(void);
45
46 extern bh_system bh_system_entity_list;