2 Copyright (C) 1996-1997 Id Software, Inc.
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.
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.
13 See the GNU General Public License for more details.
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.
23 #include "pr_comp.h" // defs shared with qcc
25 #define ENTITYGRIDAREAS 16
26 #define MAX_ENTITYCLUSTERS 16
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
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
50 #define FORCETYPE_NONE 0
51 #define FORCETYPE_FORCE 1
52 #define FORCETYPE_FORCEATPOS 2
53 #define FORCETYPE_TORQUE 3
55 #define ODEFUNC_ENABLE 1
56 #define ODEFUNC_DISABLE 2
57 #define ODEFUNC_FORCE 3
58 #define ODEFUNC_TORQUE 4
60 typedef struct edict_odefunc_s
65 struct edict_odefunc_s *next;
68 typedef struct edict_engineprivate_s
70 // mark for the leak detector
72 // place in the code where it was allocated (for the leak detector)
73 const char *allocation_origin;
75 // initially false to prevent projectiles from moving on their first frame
76 // (even if they were spawned by an synchronous client think)
79 // cached cluster links for quick stationary object visibility checking
80 vec3_t cullmins, cullmaxs;
82 int pvs_clusterlist[MAX_ENTITYCLUSTERS];
84 // physics grid areas this edict is linked into
85 link_t areagrid[ENTITYGRIDAREAS];
86 // since the areagrid can have multiple references to one entity,
87 // we should avoid extensive checking on entities already encountered
88 int areagridmarknumber;
89 // mins/maxs passed to World_LinkEdict
90 vec3_t areamins, areamaxs;
92 // PROTOCOL_QUAKE, PROTOCOL_QUAKEDP, PROTOCOL_NEHAHRAMOVIE, PROTOCOL_QUAKEWORLD
94 entity_state_t baseline;
96 // LadyHavoc: gross hack to make floating items still work
97 int suspendedinairflag;
99 // cached position to avoid redundant SV_CheckWaterTransition calls on monsters
100 qbool waterposition_forceupdate; // force an update on this entity (set by SV_PushMove code for moving water entities)
101 vec3_t waterposition_origin; // updates whenever this changes
103 // used by PushMove to keep track of where objects were before they were
104 // moved, in case they need to be moved back
106 vec3_t moved_fromangles;
108 framegroupblend_t framegroupblend[MAX_FRAMEGROUPBLENDS];
109 frameblend_t frameblend[MAX_FRAMEBLENDS];
112 // physics parameters
120 int ode_numtriangles;
121 edict_odefunc_t *ode_func;
130 vec3_t ode_avelocity;
133 vec_t ode_movelimit; // smallest component of (maxs[]-mins[])
134 matrix4x4_t ode_offsetmatrix;
135 matrix4x4_t ode_offsetimatrix;
138 int ode_joint_aiment;
139 vec3_t ode_joint_origin; // joint anchor
140 vec3_t ode_joint_angles; // joint axis
141 vec3_t ode_joint_velocity; // second joint axis
142 vec3_t ode_joint_movedir; // parameters
145 edict_engineprivate_t;