-
Notifications
You must be signed in to change notification settings - Fork 101
/
Copy pathPhysics_SurfaceProps.h
56 lines (41 loc) · 1.63 KB
/
Physics_SurfaceProps.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef PHYSICS_SURFACEPROPS_H
#define PHYSICS_SURFACEPROPS_H
#if defined(_MSC_VER) || (defined(__GNUC__) && __GNUC__ > 3)
#pragma once
#endif
enum {
MATERIAL_INDEX_SHADOW = 0xF000,
};
class CSurface {
public:
CUtlSymbol m_name;
surfacedata_t data;
};
class CPhysicsSurfaceProps : public IPhysicsSurfaceProps {
public:
CPhysicsSurfaceProps();
~CPhysicsSurfaceProps();
int ParseSurfaceData(const char *pFilename, const char *pTextfile);
int SurfacePropCount() const;
int GetSurfaceIndex(const char *pSurfacePropName) const;
void GetPhysicsProperties(int surfaceDataIndex, float *density, float *thickness, float *friction, float *elasticity) const;
surfacedata_t * GetSurfaceData(int surfaceDataIndex);
const char * GetString(unsigned short stringTableIndex) const;
const char * GetPropName(int surfaceDataIndex) const;
void SetWorldMaterialIndexTable(int *pMapArray, int mapSize);
void GetPhysicsParameters(int surfaceDataIndex, surfacephysicsparams_t *pParamsOut) const;
private:
int GetReservedSurfaceIndex(const char *pSurfacePropName) const;
CSurface * GetInternalSurface(int materialIndex);
const CSurface * GetInternalSurface(int materialIndex) const;
void CopyPhysicsProperties(CSurface *pOut, int baseIndex);
bool AddFileToDatabase(const char *pFilename);
int FindOrAddSound(CUtlSymbol sym);
private:
CUtlSymbolTable * m_strings;
CUtlVector<CUtlSymbol> m_soundList;
CUtlVector<CSurface> m_props;
CUtlVector<CUtlSymbol> m_fileList;
};
extern CPhysicsSurfaceProps g_SurfaceDatabase;
#endif // PHYSICS_SURFACEPROPS_H