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