]> git.xonotic.org Git - xonotic/darkplaces.git/blob - progs.h
Cumulative patch:
[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_BOX            1
29 #define GEOMTYPE_SPHERE         2
30 #define GEOMTYPE_CAPSULE        3
31 #define GEOMTYPE_TRIMESH        4
32 #define GEOMTYPE_CYLINDER       5
33
34 #define JOINTTYPE_POINT 1
35 #define JOINTTYPE_HINGE 2
36 #define JOINTTYPE_SLIDER 3
37 #define JOINTTYPE_UNIVERSAL 4
38 #define JOINTTYPE_HINGE2 5
39 #define JOINTTYPE_FIXED -1
40
41 #define ODEFUNC_ENABLE                  1
42 #define ODEFUNC_DISABLE                 2
43 #define ODEFUNC_RELFORCEATPOS   3
44 #define ODEFUNC_RELTORQUE               4
45
46 typedef struct edict_odefunc_s
47 {
48         int type;
49         vec3_t v1;
50         vec3_t v2;
51         struct edict_odefunc_s *next;
52 }edict_odefunc_t;
53
54 typedef struct edict_engineprivate_s
55 {
56         // true if this edict is unused
57         qboolean free;
58         // sv.time when the object was freed (to prevent early reuse which could
59         // mess up client interpolation or obscure severe QuakeC bugs)
60         float freetime;
61         // mark for the leak detector
62         int mark;
63         // place in the code where it was allocated (for the leak detector)
64         const char *allocation_origin;
65         // initially false to prevent projectiles from moving on their first frame
66         // (even if they were spawned by an synchronous client think)
67         qboolean move;
68
69         // cached cluster links for quick stationary object visibility checking
70         vec3_t cullmins, cullmaxs;
71         int pvs_numclusters;
72         int pvs_clusterlist[MAX_ENTITYCLUSTERS];
73
74         // physics grid areas this edict is linked into
75         link_t areagrid[ENTITYGRIDAREAS];
76         // since the areagrid can have multiple references to one entity,
77         // we should avoid extensive checking on entities already encountered
78         int areagridmarknumber;
79         // mins/maxs passed to World_LinkEdict
80         vec3_t areamins, areamaxs;
81
82         // PROTOCOL_QUAKE, PROTOCOL_QUAKEDP, PROTOCOL_NEHAHRAMOVIE, PROTOCOL_QUAKEWORLD
83         // baseline values
84         entity_state_t baseline;
85
86         // LordHavoc: gross hack to make floating items still work
87         int suspendedinairflag;
88
89         // cached position to avoid redundant SV_CheckWaterTransition calls on monsters
90         qboolean waterposition_forceupdate; // force an update on this entity (set by SV_PushMove code for moving water entities)
91         vec3_t waterposition_origin; // updates whenever this changes
92
93         // used by PushMove to keep track of where objects were before they were
94         // moved, in case they need to be moved back
95         vec3_t moved_from;
96         vec3_t moved_fromangles;
97
98         framegroupblend_t framegroupblend[MAX_FRAMEGROUPBLENDS];
99         frameblend_t frameblend[MAX_FRAMEBLENDS];
100         skeleton_t skeleton;
101
102         // physics parameters
103         qboolean ode_physics;
104         void *ode_body;
105         void *ode_geom;
106         void *ode_joint;
107         float *ode_vertex3f;
108         int *ode_element3i;
109         int ode_numvertices;
110         int ode_numtriangles;
111         edict_odefunc_t *ode_func;
112         vec3_t ode_mins;
113         vec3_t ode_maxs;
114         vec_t ode_mass;
115         float ode_friction;
116         vec3_t ode_origin;
117         vec3_t ode_velocity;
118         vec3_t ode_angles;
119         vec3_t ode_avelocity;
120         qboolean ode_gravity;
121         int ode_modelindex;
122         vec_t ode_movelimit; // smallest component of (maxs[]-mins[])
123         matrix4x4_t ode_offsetmatrix;
124         matrix4x4_t ode_offsetimatrix;
125         int ode_joint_type;
126         int ode_joint_enemy;
127         int ode_joint_aiment;
128         vec3_t ode_joint_origin; // joint anchor
129         vec3_t ode_joint_angles; // joint axis
130         vec3_t ode_joint_velocity; // second joint axis
131         vec3_t ode_joint_movedir; // parameters
132         void *ode_massbuf;
133 }
134 edict_engineprivate_t;
135
136 #endif