]> git.xonotic.org Git - xonotic/darkplaces.git/blob - progs.h
csqc: Implement builtin #177 "localsound"
[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 #ifdef USEODE
61 typedef struct edict_odefunc_s
62 {
63         int type;
64         vec3_t v1;
65         vec3_t v2;
66         struct edict_odefunc_s *next;
67 }edict_odefunc_t;
68 #endif
69
70 typedef struct edict_engineprivate_s
71 {
72         // mark for the leak detector
73         int mark;
74         // place in the code where it was allocated (for the leak detector)
75         const char *allocation_origin;
76
77         // initially false to prevent projectiles from moving on their first frame
78         // (even if they were spawned by an synchronous client think)
79         qbool move;
80
81         // cached cluster links for quick stationary object visibility checking
82         vec3_t cullmins, cullmaxs;
83         int pvs_numclusters;
84         int pvs_clusterlist[MAX_ENTITYCLUSTERS];
85
86         // physics grid areas this edict is linked into
87         link_t areagrid[ENTITYGRIDAREAS];
88         // since the areagrid can have multiple references to one entity,
89         // we should avoid extensive checking on entities already encountered
90         int areagridmarknumber;
91         // mins/maxs passed to World_LinkEdict
92         vec3_t areamins, areamaxs;
93
94         // PROTOCOL_QUAKE, PROTOCOL_QUAKEDP, PROTOCOL_NEHAHRAMOVIE, PROTOCOL_QUAKEWORLD
95         // baseline values
96         entity_state_t baseline;
97
98         // LadyHavoc: gross hack to make floating items still work
99         int suspendedinairflag;
100
101         // cached position to avoid redundant SV_CheckWaterTransition calls on monsters
102         qbool waterposition_forceupdate; // force an update on this entity (set by SV_PushMove code for moving water entities)
103         vec3_t waterposition_origin; // updates whenever this changes
104
105         // used by PushMove to keep track of where objects were before they were
106         // moved, in case they need to be moved back
107         vec3_t moved_from;
108         vec3_t moved_fromangles;
109
110         framegroupblend_t framegroupblend[MAX_FRAMEGROUPBLENDS];
111         frameblend_t frameblend[MAX_FRAMEBLENDS];
112         skeleton_t skeleton;
113
114 #ifdef USEODE
115         // physics parameters
116         qbool ode_physics;
117         void *ode_body;
118         void *ode_geom;
119         void *ode_joint;
120         float *ode_vertex3f;
121         int *ode_element3i;
122         int ode_numvertices;
123         int ode_numtriangles;
124         edict_odefunc_t *ode_func;
125         vec3_t ode_mins;
126         vec3_t ode_maxs;
127         vec3_t ode_scale;
128         vec_t ode_mass;
129         float ode_friction;
130         vec3_t ode_origin;
131         vec3_t ode_velocity;
132         vec3_t ode_angles;
133         vec3_t ode_avelocity;
134         qbool ode_gravity;
135         int ode_modelindex;
136         vec_t ode_movelimit; // smallest component of (maxs[]-mins[])
137         matrix4x4_t ode_offsetmatrix;
138         matrix4x4_t ode_offsetimatrix;
139         int ode_joint_type;
140         int ode_joint_enemy;
141         int ode_joint_aiment;
142         vec3_t ode_joint_origin; // joint anchor
143         vec3_t ode_joint_angles; // joint axis
144         vec3_t ode_joint_velocity; // second joint axis
145         vec3_t ode_joint_movedir; // parameters
146         void *ode_massbuf;
147 #endif
148 }
149 edict_engineprivate_t;
150
151 #endif