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,
53 static u32
mdl_entity_id_type( u32 entity_id
){
54 return (entity_id
& 0xffff0000) >> 16;
57 static u32
mdl_entity_id_id( u32 entity_id
){
58 return entity_id
& 0x0000ffff;
61 static u32
mdl_entity_id( u32 type
, u32 index
){
62 return (type
& 0xfffff)<<16 | (index
& 0xfffff);
66 k_ent_function_trigger
,
67 k_ent_function_particle_spawn
71 mdl_transform transform
;
76 k_light_type_point
= 0,
81 mdl_transform transform
;
94 k_gate_type_unlinked
= 0,
95 k_gate_type_teleport
= 1,
96 k_gate_type_nonlocal_unlinked
= 2,
97 k_gate_type_nonlocel
= 3
111 m4x3f to_world
, transport
;
122 u16 routes
[4]; /* routes that pass through this gate */
126 struct ent_route_node
{
128 u8 ref_count
, ref_total
;
131 struct ent_path_index
{
135 struct ent_checkpoint
{
144 mdl_transform transform
;
145 u32 official_track_id
;
149 u16 checkpoints_start
,
155 u16 active_checkpoint
,
159 m4x3f board_transform
;
165 mdl_transform transform
;
167 u32 reserved0
, reserved1
;
170 struct ent_audio_clip
{
179 struct volume_particles
{
183 struct volume_trigger
{
188 k_volume_subtype_trigger
,
189 k_volume_subtype_particle
193 mdl_transform transform
;
194 m4x3f to_world
, to_local
;
200 volume_trigger trigger
;
201 volume_particles particles
;
206 mdl_transform transform
;
210 float volume
, crossfade
;
218 mdl_transform transform
;
223 k_skateshop_type_boardshop
,
224 k_skateshop_type_charshop
,
225 k_skateshop_type_worldshop
228 struct ent_skateshop
{
229 mdl_transform transform
;
254 struct ent_swspreview
{
255 u32 id_camera
, id_display
, id_display1
;
259 mdl_transform transform
;
266 u32 index
; /* into the path */
270 mdl_transform transform
;
274 enum ent_menuitem_type
{
275 k_ent_menuitem_type_visual
= 0,
276 k_ent_menuitem_type_event_button
= 1,
277 k_ent_menuitem_type_page_button
= 2,
278 k_ent_menuitem_type_toggle
= 3,
279 k_ent_menuitem_type_slider
= 4,
280 k_ent_menuitem_type_page
= 5
283 typedef struct ent_menuitem ent_menuitem
;
286 id_links
[4]; /* ent_menuitem */
287 f32 factive
, fvisible
;
289 mdl_transform transform
;
290 u32 submesh_start
, submesh_count
;
292 union{ u64 _u64
; /* force storage for 64bit pointers */
300 u32 id_min
, /* ent_marker */
302 id_handle
, /* ent_menuitem */
313 u32 id_check
, /* ent_menuitem */
315 v3f offset
; /* relative to parent */
321 id_entrypoint
, /* ent_menuitem */
322 id_viewpoint
; /* ent_camera */
328 struct ent_worldinfo
{
329 u32 pstr_name
, pstr_author
, pstr_desc
;
333 VG_STATIC ent_marker
*ent_find_marker( mdl_context
*mdl
,
334 mdl_array_ptr
*arr
, const char *alias
)
336 for( u32 i
=0; i
<mdl_arrcount(arr
); i
++ ){
337 ent_marker
*marker
= mdl_arritm( arr
, i
);
339 if( !strcmp( mdl_pstr( mdl
, marker
->pstr_alias
), alias
) ){
347 enum channel_behaviour
{
348 k_channel_behaviour_unlimited
= 0,
349 k_channel_behaviour_discard_if_full
= 1,
350 k_channel_behaviour_crossfade_if_full
= 2
353 enum probability_curve
{
354 k_probability_curve_constant
= 0,
355 k_probability_curve_wildlife_day
= 1,
356 k_probability_curve_wildlife_night
= 2
368 struct ent_font_variant
{
383 struct ent_challenge
{
384 mdl_transform transform
;
391 typedef struct ent_call ent_call
;
398 VG_STATIC
void entity_call( world_instance
*world
, ent_call
*call
);
400 #endif /* ENTITY_H */