]> de.git.xonotic.org Git - xonotic/darkplaces.git/blob - progs.h
A bit more cleanup.
[xonotic/darkplaces.git] / progs.h
1 /*
2 Copyright (C) 1996-1997 Id Software, Inc.
3
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
13 See the GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18
19 */
20
21 #ifndef PROGS_H
22 #define PROGS_H
23 #include "pr_comp.h"                    // defs shared with qcc
24
25 #define ENTITYGRIDAREAS 16
26 #define MAX_ENTITYCLUSTERS 16
27
28 #define GEOMTYPE_NONE      -1
29 #define GEOMTYPE_SOLID      0
30 #define GEOMTYPE_BOX            1
31 #define GEOMTYPE_SPHERE         2
32 #define GEOMTYPE_CAPSULE        3
33 #define GEOMTYPE_TRIMESH        4
34 #define GEOMTYPE_CYLINDER       5
35 #define GEOMTYPE_CAPSULE_X      6
36 #define GEOMTYPE_CAPSULE_Y      7
37 #define GEOMTYPE_CAPSULE_Z      8
38 #define GEOMTYPE_CYLINDER_X     9
39 #define GEOMTYPE_CYLINDER_Y     10
40 #define GEOMTYPE_CYLINDER_Z     11
41
42 #define JOINTTYPE_NONE      0
43 #define JOINTTYPE_POINT     1
44 #define JOINTTYPE_HINGE     2
45 #define JOINTTYPE_SLIDER    3
46 #define JOINTTYPE_UNIVERSAL 4
47 #define JOINTTYPE_HINGE2    5
48 #define JOINTTYPE_FIXED    -1
49
50 #define FORCETYPE_NONE       0
51 #define FORCETYPE_FORCE      1
52 #define FORCETYPE_FORCEATPOS 2
53 #define FORCETYPE_TORQUE     3
54
55 #define ODEFUNC_ENABLE          1
56 #define ODEFUNC_DISABLE         2
57 #define ODEFUNC_FORCE       3
58 #define ODEFUNC_TORQUE      4
59
60 typedef struct edict_odefunc_s
61 {
62         int type;
63         vec3_t v1;
64         vec3_t v2;
65         struct edict_odefunc_s *next;
66 }edict_odefunc_t;
67
68 typedef struct edict_engineprivate_s
69 {
70         // true if this edict is unused
71         qboolean free;
72         // sv.time when the object was freed (to prevent early reuse which could
73         // mess up client interpolation or obscure severe QuakeC bugs)
74         float freetime;
75         // mark for the leak detector
76         int mark;
77         // place in the code where it was allocated (for the leak detector)
78         const char *allocation_origin;
79         // initially false to prevent projectiles from moving on their first frame
80         // (even if they were spawned by an synchronous client think)
81         qboolean move;
82
83         // cached cluster links for quick stationary object visibility checking
84         vec3_t cullmins, cullmaxs;
85         int pvs_numclusters;
86         int pvs_clusterlist[MAX_ENTITYCLUSTERS];
87
88         // physics grid areas this edict is linked into
89         link_t areagrid[ENTITYGRIDAREAS];
90         // since the areagrid can have multiple references to one entity,
91         // we should avoid extensive checking on entities already encountered
92         int areagridmarknumber;
93         // mins/maxs passed to World_LinkEdict
94         vec3_t areamins, areamaxs;
95
96         // PROTOCOL_QUAKE, PROTOCOL_QUAKEDP, PROTOCOL_NEHAHRAMOVIE, PROTOCOL_QUAKEWORLD
97         // baseline values
98         entity_state_t baseline;
99
100         // LordHavoc: gross hack to make floating items still work
101         int suspendedinairflag;
102
103         // cached position to avoid redundant SV_CheckWaterTransition calls on monsters
104         qboolean waterposition_forceupdate; // force an update on this entity (set by SV_PushMove code for moving water entities)
105         vec3_t waterposition_origin; // updates whenever this changes
106
107         // used by PushMove to keep track of where objects were before they were
108         // moved, in case they need to be moved back
109         vec3_t moved_from;
110         vec3_t moved_fromangles;
111
112         framegroupblend_t framegroupblend[MAX_FRAMEGROUPBLENDS];
113         frameblend_t frameblend[MAX_FRAMEBLENDS];
114         skeleton_t skeleton;
115
116         // physics parameters
117         qboolean ode_physics;
118         void *ode_body;
119         void *ode_geom;
120         void *ode_joint;
121         float *ode_vertex3f;
122         int *ode_element3i;
123         int ode_numvertices;
124         int ode_numtriangles;
125         edict_odefunc_t *ode_func;
126         vec3_t ode_mins;
127         vec3_t ode_maxs;
128         vec3_t ode_scale;
129         vec_t ode_mass;
130         float ode_friction;
131         vec3_t ode_origin;
132         vec3_t ode_velocity;
133         vec3_t ode_angles;
134         vec3_t ode_avelocity;
135         qboolean ode_gravity;
136         int ode_modelindex;
137         vec_t ode_movelimit; // smallest component of (maxs[]-mins[])
138         matrix4x4_t ode_offsetmatrix;
139         matrix4x4_t ode_offsetimatrix;
140         int ode_joint_type;
141         int ode_joint_enemy;
142         int ode_joint_aiment;
143         vec3_t ode_joint_origin; // joint anchor
144         vec3_t ode_joint_angles; // joint axis
145         vec3_t ode_joint_velocity; // second joint axis
146         vec3_t ode_joint_movedir; // parameters
147         void *ode_massbuf;
148 }
149 edict_engineprivate_t;
150
151 #endif