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
137typedef struct
138{
139 string m_strBase;
148
158 string m_sndRoll;
160
164
165/* entity will have to have a .surfdata field pointing to an id */
168var hashtable g_hashsurfdata;
169
170/* querying API */
171typedef enum
172{
195
196class
198{
199 /* initialized SurfData */
200 nonvirtual void Init(void);
201
202 /* Prepares an object for SurfData initialization */
203 nonvirtual void SetStage(string type);
204
205 /* Finishes initialization, returns valid SurfData id */
206 nonvirtual int Finish(void);
207 nonvirtual int TexToSurfData(string tex_name);
208
209 /* Call an impact effect against an entity surface */
210 nonvirtual void Impact(entity e, vector org, vector ang);
211
212 /* Get information from a Surface */
213 nonvirtual __variant GetInfo(int, int);
214
215 #ifdef CLIENT
216 nonvirtual void Impact_Parse(void);
217 nonvirtual void ImpactID_Parse(void);
218 #endif
219
220 nonvirtual void ImpactOfType(int materialID, vector worldPosition, vector impactNormal);
221 nonvirtual void ImpactOfNamedType(string materialName, vector worldPosition, vector impactNormal);
222};
223 // end of surfdata
Definition: surfaceproperties.h:198
surfaceData_t * g_surfdata
Definition: surfaceproperties.h:166
int g_surfdata_count
Definition: surfaceproperties.h:167
surfinfo_t
Definition: surfaceproperties.h:172
var hashtable g_hashsurfdata
Definition: surfaceproperties.h:168
@ SURFDATA_SND_STEPLEFT
Definition: surfaceproperties.h:181
@ SURFDATA_SND_STEPRIGHT
Definition: surfaceproperties.h:182
@ SURFDATA_SND_BULLETIMPACT
Definition: surfaceproperties.h:183
@ SURFDATA_SND_SCRAPEROUGH
Definition: surfaceproperties.h:184
@ SURFDATA_SND_IMPACTSOFT
Definition: surfaceproperties.h:187
@ SURFDATA_FX_BULLETIMPACTID
Definition: surfaceproperties.h:193
@ SURFDATA_SND_SHAKE
Definition: surfaceproperties.h:188
@ SURFDATA_MATERIAL
Definition: surfaceproperties.h:173
@ SURFDATA_MAXSPEEDFACTOR
Definition: surfaceproperties.h:180
@ SURFDATA_DAMPENING
Definition: surfaceproperties.h:178
@ SURFDATA_SND_STRAIN
Definition: surfaceproperties.h:189
@ SURFDATA_THICKNESS
Definition: surfaceproperties.h:174
@ SURFDATA_DENSITY
Definition: surfaceproperties.h:175
@ SURFDATA_SND_IMPACTHARD
Definition: surfaceproperties.h:186
@ SURFDATA_SND_BREAK
Definition: surfaceproperties.h:191
@ SURFDATA_FX_BULLETIMPACT
Definition: surfaceproperties.h:192
@ SURFDATA_JUMPFACTOR
Definition: surfaceproperties.h:179
@ SURFDATA_FRICTION
Definition: surfaceproperties.h:177
@ SURFDATA_ELASTICITY
Definition: surfaceproperties.h:176
@ SURFDATA_SND_SCRAPESOFT
Definition: surfaceproperties.h:185
@ SURFDATA_SND_ROLL
Definition: surfaceproperties.h:190
Definition: surfaceproperties.h:138
string m_sndShake
Definition: surfaceproperties.h:156
string m_sndRoll
Definition: surfaceproperties.h:158
float m_flThickness
Definition: surfaceproperties.h:141
float m_flElasticity
Definition: surfaceproperties.h:143
float m_flFriction
Definition: surfaceproperties.h:144
string m_sndScrapeRough
Definition: surfaceproperties.h:152
float m_fxBulletImpactID
Definition: surfaceproperties.h:162
string m_sndBulletImpact
Definition: surfaceproperties.h:151
string m_sndStepLeft
Definition: surfaceproperties.h:149
string m_sndBreak
Definition: surfaceproperties.h:159
string m_sndImpactHard
Definition: surfaceproperties.h:154
float m_flMaxSpeedFactor
Definition: surfaceproperties.h:147
string m_sndStepRight
Definition: surfaceproperties.h:150
string m_sndScrapeSoft
Definition: surfaceproperties.h:153
float m_flDampening
Definition: surfaceproperties.h:145
float m_flDensity
Definition: surfaceproperties.h:142
string m_fxBulletImpact
Definition: surfaceproperties.h:161
string m_sndStrain
Definition: surfaceproperties.h:157
string m_strBase
Definition: surfaceproperties.h:139
float m_flJumpFactor
Definition: surfaceproperties.h:146
float m_flMaterial
Definition: surfaceproperties.h:140
string m_sndImpactSoft
Definition: surfaceproperties.h:155