fixe
[carveJwlIkooP6JGAAIwe30JlM.git] / entity.h
1 #ifndef ENTITY_H
2 #define ENTITY_H
3
4 #include "model.h"
5
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
15 struct ent_spawn{
16 mdl_transform transform;
17 u32 pstr_name;
18 };
19
20 enum light_type{
21 k_light_type_point = 0,
22 k_light_type_spot = 1
23 };
24
25 struct ent_light{
26 mdl_transform transform;
27 u32 daytime,
28 type;
29
30 v4f colour;
31 float angle,
32 range;
33
34 m4x3f inverse_world;
35 v2f angle_sin_cos;
36 };
37
38 enum gate_type{
39 k_gate_type_unlinked = 0,
40 k_gate_type_teleport = 1,
41 k_gate_type_nonlocal = 2
42 };
43
44 struct ent_gate{
45 u32 type,
46 target;
47
48 /* TODO: World index */
49
50 v3f dimensions,
51 co[2];
52
53 v4f q[2];
54
55 /* runtime */
56 m4x3f to_world, transport;
57
58 union{
59 u32 timing_version;
60
61 struct{
62 u8 ref_count, ref_total;
63 };
64 };
65
66 double timing_time;
67 u16 routes[4]; /* routes that pass through this gate */
68 };
69
70 struct ent_route_node{
71 v3f co;
72 u8 ref_count, ref_total;
73 };
74
75 struct ent_path_index{
76 u16 index;
77 };
78
79 struct ent_checkpoint{
80 u16 gate_index,
81 path_start,
82 path_count;
83 };
84
85 struct ent_route{
86
87 union{
88 mdl_transform transform;
89 u32 official_track_id;
90 };
91
92 u32 pstr_name;
93 u16 checkpoints_start,
94 checkpoints_count;
95
96 v4f colour;
97
98 /* runtime */
99 u32 active_checkpoint;
100 float factive;
101 m4x3f board_transform;
102 mdl_submesh sm;
103 double latest_pass;
104 };
105
106 struct ent_water{
107 mdl_transform transform;
108 float max_dist;
109 u32 reserved0, reserved1;
110 };
111
112 #endif /* ENTITY_H */