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