6 typedef struct ent_spawn ent_spawn
;
7 typedef struct ent_light ent_light
;
8 typedef struct ent_gate ent_gate
;
9 typedef struct ent_route_node ent_route_node
;
10 typedef struct ent_path_index ent_path_index
;
11 typedef struct ent_checkpoint ent_checkpoint
;
12 typedef struct ent_route ent_route
;
13 typedef struct ent_water ent_water
;
14 typedef struct ent_audio_clip ent_audio_clip
;
15 typedef struct volume_particles volume_particles
;
16 typedef struct volume_trigger volume_trigger
;
17 typedef struct ent_volume ent_volume
;
18 typedef struct ent_audio ent_audio
;
19 typedef struct ent_marker ent_marker
;
20 typedef struct ent_traffic ent_traffic
;
21 typedef struct ent_font ent_font
;
22 typedef struct ent_font_variant ent_font_variant
;
23 typedef struct ent_glyph ent_glyph
;
24 typedef struct ent_skateshop ent_skateshop
;
25 typedef struct ent_camera ent_camera
;
26 typedef struct ent_swspreview ent_swspreview
;
27 typedef struct ent_worldinfo ent_worldinfo
;
28 typedef struct ent_ccmd ent_ccmd
;
29 typedef struct ent_challenge ent_challenge
;
30 typedef struct ent_unlock ent_unlock
;
31 typedef struct ent_relay ent_relay
;
44 k_ent_font_variant
= 10,
48 k_ent_swspreview
= 14,
57 static u32
mdl_entity_id_type( u32 entity_id
){
58 return (entity_id
& 0xffff0000) >> 16;
61 static u32
mdl_entity_id_id( u32 entity_id
){
62 return entity_id
& 0x0000ffff;
65 static u32
mdl_entity_id( u32 type
, u32 index
){
66 return (type
& 0xfffff)<<16 | (index
& 0xfffff);
70 k_ent_function_trigger
,
71 k_ent_function_particle_spawn
75 mdl_transform transform
;
80 k_light_type_point
= 0,
85 mdl_transform transform
;
100 k_gate_type_unlinked
= 0,
101 k_gate_type_teleport
= 1,
102 k_gate_type_nonlocal_unlinked
= 2,
103 k_gate_type_nonlocel
= 3
109 k_ent_gate_linked
= 0x1, /* this is a working portal */
110 k_ent_gate_nonlocal
= 0x2, /* use the key string to link this portal.
111 NOTE: if set, it adds the flip flag. */
112 k_ent_gate_flip
= 0x4, /* flip direction 180* for exiting portal */
113 k_ent_gate_custom_mesh
= 0x8, /* use a custom submesh instead of default */
114 k_ent_gate_locked
= 0x10,/* has to be unlocked to be useful */
128 m4x3f to_world
, transport
;
139 u16 routes
[4]; /* routes that pass through this gate */
143 u32 submesh_start
, submesh_count
;
146 struct ent_route_node
{
148 u8 ref_count
, ref_total
;
151 struct ent_path_index
{
155 struct ent_checkpoint
{
164 mdl_transform transform
;
165 u32 official_track_id
;
169 u16 checkpoints_start
,
175 u16 active_checkpoint
,
179 m4x3f board_transform
;
185 mdl_transform transform
;
187 u32 reserved0
, reserved1
;
190 struct ent_audio_clip
{
199 struct volume_particles
{
203 struct volume_trigger
{
207 enum ent_volume_flag
{
208 k_ent_volume_flag_particles
= 0x1,
209 k_ent_volume_flag_disabled
= 0x2
213 mdl_transform transform
;
214 m4x3f to_world
, to_local
;
219 volume_trigger trigger
;
220 volume_particles particles
;
225 mdl_transform transform
;
229 float volume
, crossfade
;
237 mdl_transform transform
;
242 k_skateshop_type_boardshop
,
243 k_skateshop_type_charshop
,
244 k_skateshop_type_worldshop
247 struct ent_skateshop
{
248 mdl_transform transform
;
273 struct ent_swspreview
{
274 u32 id_camera
, id_display
, id_display1
;
278 mdl_transform transform
;
285 u32 index
; /* into the path */
289 mdl_transform transform
;
293 enum ent_menuitem_type
{
294 k_ent_menuitem_type_visual
= 0,
295 k_ent_menuitem_type_event_button
= 1,
296 k_ent_menuitem_type_page_button
= 2,
297 k_ent_menuitem_type_toggle
= 3,
298 k_ent_menuitem_type_slider
= 4,
299 k_ent_menuitem_type_page
= 5
302 typedef struct ent_menuitem ent_menuitem
;
305 id_links
[4]; /* ent_menuitem */
306 f32 factive
, fvisible
;
308 mdl_transform transform
;
309 u32 submesh_start
, submesh_count
;
311 union{ u64 _u64
; /* force storage for 64bit pointers */
319 u32 id_min
, /* ent_marker */
321 id_handle
, /* ent_menuitem */
332 u32 id_check
, /* ent_menuitem */
334 v3f offset
; /* relative to parent */
340 id_entrypoint
, /* ent_menuitem */
341 id_viewpoint
; /* ent_camera */
347 struct ent_worldinfo
{
348 u32 pstr_name
, pstr_author
, pstr_desc
;
352 VG_STATIC ent_marker
*ent_find_marker( mdl_context
*mdl
,
353 mdl_array_ptr
*arr
, const char *alias
)
355 for( u32 i
=0; i
<mdl_arrcount(arr
); i
++ ){
356 ent_marker
*marker
= mdl_arritm( arr
, i
);
358 if( !strcmp( mdl_pstr( mdl
, marker
->pstr_alias
), alias
) ){
366 enum channel_behaviour
{
367 k_channel_behaviour_unlimited
= 0,
368 k_channel_behaviour_discard_if_full
= 1,
369 k_channel_behaviour_crossfade_if_full
= 2
372 enum probability_curve
{
373 k_probability_curve_constant
= 0,
374 k_probability_curve_wildlife_day
= 1,
375 k_probability_curve_wildlife_night
= 2
387 struct ent_font_variant
{
402 struct ent_challenge
{
403 mdl_transform transform
;
424 typedef struct ent_call ent_call
;
431 VG_STATIC
void entity_call( world_instance
*world
, ent_call
*call
);
433 #endif /* ENTITY_H */