Nuclide
Software Development Kit for id Technology
surfaceproperties.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
138typedef struct
139{
140 string m_strBase;
149
159 string m_sndRoll;
161
165
166/* entity will have to have a .surfdata field pointing to an id */
169var hashtable g_hashsurfdata;
170
171/* querying API */
172typedef enum
173{
196
197/* initialized SurfaceKit */
198void SurfData_Init(void);
199
200/* Prepares an object for SurfaceKit initialization */
201void SurfData_SetStage(string type);
202
203/* Finishes initialization, returns valid SurfaceKit id */
204int SurfData_Finish(void);
205
206int SurfData_TexToSurfData(string tex_name);
207
208/* Call an impact effect against an entity surface */
209void SurfData_Impact(entity e, vector org, vector ang);
210
211/* Get information from a Surface */
212__variant SurfData_GetInfo(int, int);
213
214#ifdef CLIENT
215void SurfData_Impact_Parse(void);
216void SurfData_ImpactID_Parse(void);
217#endif
218
219void SurfData_ImpactOfType(int materialID, vector worldPosition, vector impactNormal);
220
221void SurfData_ImpactOfNamedType(string materialName, vector worldPosition, vector impactNormal);
222 // end of surfdata
void SurfData_Impact(entity e, vector org, vector ang)
Definition: surfaceproperties.qc:687
int SurfData_TexToSurfData(string tex_name)
Definition: surfaceproperties.qc:227
void SurfData_ImpactOfNamedType(string materialName, vector worldPosition, vector impactNormal)
Definition: surfaceproperties.qc:727
void SurfData_SetStage(string type)
Definition: surfaceproperties.qc:571
void SurfData_Impact_Parse(void)
Called by EV_SURFIMPACT.
Definition: surfaceproperties.qc:626
surfaceData_t * g_surfdata
Definition: surfaceproperties.h:167
__variant SurfData_GetInfo(int, int)
Definition: surfaceproperties.qc:237
int g_surfdata_count
Definition: surfaceproperties.h:168
surfinfo_t
Definition: surfaceproperties.h:173
int SurfData_Finish(void)
Definition: surfaceproperties.qc:581
void SurfData_Init(void)
Definition: surfaceproperties.qc:349
void SurfData_ImpactOfType(int materialID, vector worldPosition, vector impactNormal)
Definition: surfaceproperties.qc:717
void SurfData_ImpactID_Parse(void)
Called by EV_SURFIMPACTID.
Definition: surfaceproperties.qc:659
var hashtable g_hashsurfdata
Definition: surfaceproperties.h:169
@ SURFDATA_SND_STEPLEFT
Definition: surfaceproperties.h:182
@ SURFDATA_SND_STEPRIGHT
Definition: surfaceproperties.h:183
@ SURFDATA_SND_BULLETIMPACT
Definition: surfaceproperties.h:184
@ SURFDATA_SND_SCRAPEROUGH
Definition: surfaceproperties.h:185
@ SURFDATA_SND_IMPACTSOFT
Definition: surfaceproperties.h:188
@ SURFDATA_FX_BULLETIMPACTID
Definition: surfaceproperties.h:194
@ SURFDATA_SND_SHAKE
Definition: surfaceproperties.h:189
@ SURFDATA_MATERIAL
Definition: surfaceproperties.h:174
@ SURFDATA_MAXSPEEDFACTOR
Definition: surfaceproperties.h:181
@ SURFDATA_DAMPENING
Definition: surfaceproperties.h:179
@ SURFDATA_SND_STRAIN
Definition: surfaceproperties.h:190
@ SURFDATA_THICKNESS
Definition: surfaceproperties.h:175
@ SURFDATA_DENSITY
Definition: surfaceproperties.h:176
@ SURFDATA_SND_IMPACTHARD
Definition: surfaceproperties.h:187
@ SURFDATA_SND_BREAK
Definition: surfaceproperties.h:192
@ SURFDATA_FX_BULLETIMPACT
Definition: surfaceproperties.h:193
@ SURFDATA_JUMPFACTOR
Definition: surfaceproperties.h:180
@ SURFDATA_FRICTION
Definition: surfaceproperties.h:178
@ SURFDATA_ELASTICITY
Definition: surfaceproperties.h:177
@ SURFDATA_SND_SCRAPESOFT
Definition: surfaceproperties.h:186
@ SURFDATA_SND_ROLL
Definition: surfaceproperties.h:191
Definition: surfaceproperties.h:139
string m_sndShake
Definition: surfaceproperties.h:157
string m_sndRoll
Definition: surfaceproperties.h:159
float m_flThickness
Definition: surfaceproperties.h:142
float m_flElasticity
Definition: surfaceproperties.h:144
float m_flFriction
Definition: surfaceproperties.h:145
string m_sndScrapeRough
Definition: surfaceproperties.h:153
float m_fxBulletImpactID
Definition: surfaceproperties.h:163
string m_sndBulletImpact
Definition: surfaceproperties.h:152
string m_sndStepLeft
Definition: surfaceproperties.h:150
string m_sndBreak
Definition: surfaceproperties.h:160
string m_sndImpactHard
Definition: surfaceproperties.h:155
float m_flMaxSpeedFactor
Definition: surfaceproperties.h:148
string m_sndStepRight
Definition: surfaceproperties.h:151
string m_sndScrapeSoft
Definition: surfaceproperties.h:154
float m_flDampening
Definition: surfaceproperties.h:146
float m_flDensity
Definition: surfaceproperties.h:143
string m_fxBulletImpact
Definition: surfaceproperties.h:162
string m_sndStrain
Definition: surfaceproperties.h:158
string m_strBase
Definition: surfaceproperties.h:140
float m_flJumpFactor
Definition: surfaceproperties.h:147
float m_flMaterial
Definition: surfaceproperties.h:141
string m_sndImpactSoft
Definition: surfaceproperties.h:156