Nuclide
Software Development Kit for id Technology (BETA)
Loading...
Searching...
No Matches
propdata.h
1/*
2 * Copyright (c) 2016-2022 Vera Visions LLC.
3 *
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
13 * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
14 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15*/
16
158
159var string g_curPropData;
160
161typedef enumflags
162{
163 PDFL_BLOCKLOS, /* Does this block an AIs light of sight? */
164 PDFL_AIWALKABLE, /* can AI walk on this? */
165 PDFL_ALLOWSTATIC /* static simulation possible? */
166} propdataFlag_t;
167
168typedef struct
169{
171 int child;
172 float xmin;
173 float xmax;
175 float ymin;
176 float ymax;
178 float zmin;
179 float zmax;
182
183typedef struct
184{
185 int index;
186 string name;
187 string parent;
188 float mass;
190 float damping;
192 float inertia;
193 float volume;
195
197typedef struct
198{
199 string name;
200 string base;
201 float health; /* health until break */
202 propdataFlag_t flags;
203 float damage_bullets; /* dmg multipliers */
206 float explosive_damage; /* once the damage/radius keys are set, make explosion upon break */
208 string breakable_particle; /* name of BreakableModels entry in PropData.txt */
209 string breakable_model; /* name of BreakableModels entry in PropData.txt */
212 float mass;
215 float inertia;
216 float volume;
220 string doll;
221} propdata_t;
222
223/* entity will have to have a .propdata field pointing to a propdata id */
226var hashtable g_hashpropdata;
227
228/* necessary API functions */
229void PropData_Init(void);
230void PropData_Shutdown(void);
231
232int PropData_Load(string); /* called when we read entity data, returns -1 when not found */
233int PropData_ForModel(string); /* called when we set a model, returns -1 when not found */
234//int PropData_Read(string); /* this just handles the contents of a prop_data model string */
235
236void PropData_SetStage(string);
237int PropData_Finish(void);
238
239/* querying API */
261__variant Prop_GetInfo(int, int);
262
264typedef struct
265{
266 string name;
267 string data;
268 float modelindex; /* only used for networking */
269 bool physics; /* differentiate between Source and GS */
271
272/* entity will have a .breakmodel field pointing to a breakmodel id */
276var hashtable g_hashbreakmodel;
277
278
279#ifdef CLIENT
280void BreakModel_SpawnID(vector smins, vector smaxs, vector dir, float speed, int count, int index);
281void BreakModel_Receive(void);
283#else
284void BreakModel_Spawn(vector pos, vector dir, vector spread, float speed, int count, string type);
285void BreakModel_Entity(ncSurfacePropEntity target, vector dir, float speed);
286void BreakModel_SendClientData(entity);
287#endif
288
289 // end of propdata
291
292/* necessary API functions */
293//void BreakModel_Init(void);
294//void BreakModel_Shutdown(void);
295
296//int BreakModel_Load(string); /* called when we precache a model, returns -1 when not found */
297//int BreakModel_Read(string); /* this just handles the contents of a prop_data model string */
This entity represents an ncRenderableEntity with interactive surface properties.
Definition SurfacePropEntity.h:70
void PropData_SetStage(string)
Definition propdata.qc:930
void BreakModel_SpawnID(vector smins, vector smaxs, vector dir, float speed, int count, int index)
Definition propdata.qc:952
var hashtable g_hashbreakmodel
Definition propdata.h:276
breakModel_t * g_breakmodel
Definition propdata.h:273
propinfo_t
Definition propdata.h:241
void BreakModel_Receive(void)
Definition propdata.qc:1098
int PropData_Finish(void)
Definition propdata.qc:936
int PropData_Load(string)
Definition propdata.qc:622
var string g_curPropData
Definition propdata.h:159
var hashtable g_hashpropdata
Definition propdata.h:226
void PropData_Init(void)
Definition propdata.qc:803
void PropData_Shutdown(void)
Definition propdata.qc:84
int g_propdata_count
Definition propdata.h:225
propdata_t * g_propdata
Definition propdata.h:224
__variant Prop_GetInfo(int, int)
Definition propdata.qc:100
int PropData_ForModel(string)
Definition propdata.qc:398
int g_breakmodel_count
Definition propdata.h:274
void BreakModel_ReceiveClientData(void)
Definition propdata.qc:1131
int g_breakmodel_end
Definition propdata.h:275
@ PROPINFO_DMG_BULLET
Definition propdata.h:244
@ PROPINFO_DAMPING_LINEAR
Definition propdata.h:254
@ PROPINFO_EXPLOSIVE_RADIUS
Definition propdata.h:248
@ PROPINFO_DOLL
Definition propdata.h:259
@ PROPINFO_VOLUME
Definition propdata.h:257
@ PROPINFO_INERTIA
Definition propdata.h:256
@ PROPINFO_BREAKMODEL
Definition propdata.h:249
@ PROPINFO_DAMPING_ANGULAR
Definition propdata.h:255
@ PROPINFO_EXPLOSIVE_DMG
Definition propdata.h:247
@ PROPINFO_DMG_MELEE
Definition propdata.h:245
@ PROPINFO_FLAGS
Definition propdata.h:243
@ PROPINFO_SKIN
Definition propdata.h:251
@ PROPINFO_SURFACEPROP
Definition propdata.h:258
@ PROPINFO_HEALTH
Definition propdata.h:242
@ PROPINFO_DMG_EXPLOSIVE
Definition propdata.h:246
@ PROPINFO_BREAKCOUNT
Definition propdata.h:250
@ PROPINFO_MASS
Definition propdata.h:253
Data holding BreakModel entries.
Definition propdata.h:265
string name
Definition propdata.h:266
float modelindex
Definition propdata.h:268
string data
Definition propdata.h:267
bool physics
Definition propdata.h:269
Definition propdata.h:169
float zmax
Definition propdata.h:179
int parent
Definition propdata.h:170
float zmin
Definition propdata.h:178
float xfriction
Definition propdata.h:174
float ymax
Definition propdata.h:176
float xmin
Definition propdata.h:172
float zfriction
Definition propdata.h:180
float xmax
Definition propdata.h:173
float yfriction
Definition propdata.h:177
float ymin
Definition propdata.h:175
int child
Definition propdata.h:171
Definition propdata.h:184
string parent
Definition propdata.h:187
string surfaceprop
Definition propdata.h:189
string name
Definition propdata.h:186
float volume
Definition propdata.h:193
float inertia
Definition propdata.h:192
int index
Definition propdata.h:185
float damping
Definition propdata.h:190
float rotdamping
Definition propdata.h:191
float mass
Definition propdata.h:188
Data holding PropData entries.
Definition propdata.h:198
float damping_linear
Definition propdata.h:213
int solids
Definition propdata.h:218
float volume
Definition propdata.h:216
string surfaceprop
Definition propdata.h:217
float mass
Definition propdata.h:212
float damage_explosive
Definition propdata.h:205
propdataFlag_t flags
Definition propdata.h:202
string breakable_model
Definition propdata.h:209
float health
Definition propdata.h:201
float damage_bullets
Definition propdata.h:203
float breakable_skin
Definition propdata.h:211
string breakable_particle
Definition propdata.h:208
float explosive_radius
Definition propdata.h:207
float damage_melee
Definition propdata.h:204
propdata_solids_t * solidInfo
Definition propdata.h:219
float damping_angular
Definition propdata.h:214
string doll
Definition propdata.h:220
float explosive_damage
Definition propdata.h:206
string base
Definition propdata.h:200
int breakable_count
Definition propdata.h:210
float inertia
Definition propdata.h:215
string name
Definition propdata.h:199