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