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
;
42 k_ent_font_variant
= 10,
46 k_ent_swspreview
= 14,
54 static u32
mdl_entity_id_type( u32 entity_id
){
55 return (entity_id
& 0xffff0000) >> 16;
58 static u32
mdl_entity_id_id( u32 entity_id
){
59 return entity_id
& 0x0000ffff;
62 static u32
mdl_entity_id( u32 type
, u32 index
){
63 return (type
& 0xfffff)<<16 | (index
& 0xfffff);
67 k_ent_function_trigger
,
68 k_ent_function_particle_spawn
72 mdl_transform transform
;
77 k_light_type_point
= 0,
82 mdl_transform transform
;
97 k_gate_type_unlinked
= 0,
98 k_gate_type_teleport
= 1,
99 k_gate_type_nonlocal_unlinked
= 2,
100 k_gate_type_nonlocel
= 3
106 k_ent_gate_linked
= 0x1, /* this is a working portal */
107 k_ent_gate_nonlocal
= 0x2, /* use the key string to link this portal.
108 NOTE: if set, it adds the flip flag. */
109 k_ent_gate_flip
= 0x4, /* flip direction 180* for exiting portal */
110 k_ent_gate_custom_mesh
= 0x8, /* use a custom submesh instead of default */
124 m4x3f to_world
, transport
;
135 u16 routes
[4]; /* routes that pass through this gate */
139 u32 submesh_start
, submesh_count
;
142 struct ent_route_node
{
144 u8 ref_count
, ref_total
;
147 struct ent_path_index
{
151 struct ent_checkpoint
{
160 mdl_transform transform
;
161 u32 official_track_id
;
165 u16 checkpoints_start
,
171 u16 active_checkpoint
,
175 m4x3f board_transform
;
181 mdl_transform transform
;
183 u32 reserved0
, reserved1
;
186 struct ent_audio_clip
{
195 struct volume_particles
{
199 struct volume_trigger
{
203 enum ent_volume_flag
{
204 k_ent_volume_flag_particles
= 0x1,
205 k_ent_volume_flag_disabled
= 0x2
209 mdl_transform transform
;
210 m4x3f to_world
, to_local
;
215 volume_trigger trigger
;
216 volume_particles particles
;
221 mdl_transform transform
;
225 float volume
, crossfade
;
233 mdl_transform transform
;
238 k_skateshop_type_boardshop
,
239 k_skateshop_type_charshop
,
240 k_skateshop_type_worldshop
243 struct ent_skateshop
{
244 mdl_transform transform
;
269 struct ent_swspreview
{
270 u32 id_camera
, id_display
, id_display1
;
274 mdl_transform transform
;
281 u32 index
; /* into the path */
285 mdl_transform transform
;
289 enum ent_menuitem_type
{
290 k_ent_menuitem_type_visual
= 0,
291 k_ent_menuitem_type_event_button
= 1,
292 k_ent_menuitem_type_page_button
= 2,
293 k_ent_menuitem_type_toggle
= 3,
294 k_ent_menuitem_type_slider
= 4,
295 k_ent_menuitem_type_page
= 5
298 typedef struct ent_menuitem ent_menuitem
;
301 id_links
[4]; /* ent_menuitem */
302 f32 factive
, fvisible
;
304 mdl_transform transform
;
305 u32 submesh_start
, submesh_count
;
307 union{ u64 _u64
; /* force storage for 64bit pointers */
315 u32 id_min
, /* ent_marker */
317 id_handle
, /* ent_menuitem */
328 u32 id_check
, /* ent_menuitem */
330 v3f offset
; /* relative to parent */
336 id_entrypoint
, /* ent_menuitem */
337 id_viewpoint
; /* ent_camera */
343 struct ent_worldinfo
{
344 u32 pstr_name
, pstr_author
, pstr_desc
;
348 VG_STATIC ent_marker
*ent_find_marker( mdl_context
*mdl
,
349 mdl_array_ptr
*arr
, const char *alias
)
351 for( u32 i
=0; i
<mdl_arrcount(arr
); i
++ ){
352 ent_marker
*marker
= mdl_arritm( arr
, i
);
354 if( !strcmp( mdl_pstr( mdl
, marker
->pstr_alias
), alias
) ){
362 enum channel_behaviour
{
363 k_channel_behaviour_unlimited
= 0,
364 k_channel_behaviour_discard_if_full
= 1,
365 k_channel_behaviour_crossfade_if_full
= 2
368 enum probability_curve
{
369 k_probability_curve_constant
= 0,
370 k_probability_curve_wildlife_day
= 1,
371 k_probability_curve_wildlife_night
= 2
383 struct ent_font_variant
{
398 struct ent_challenge
{
399 mdl_transform transform
;
407 typedef struct ent_call ent_call
;
414 VG_STATIC
void entity_call( world_instance
*world
, ent_call
*call
);
416 #endif /* ENTITY_H */