summaryrefslogtreecommitdiff
path: root/utils/hlmv/physmesh.h
diff options
context:
space:
mode:
Diffstat (limited to 'utils/hlmv/physmesh.h')
-rw-r--r--utils/hlmv/physmesh.h72
1 files changed, 72 insertions, 0 deletions
diff --git a/utils/hlmv/physmesh.h b/utils/hlmv/physmesh.h
new file mode 100644
index 0000000..1695ed6
--- /dev/null
+++ b/utils/hlmv/physmesh.h
@@ -0,0 +1,72 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//=============================================================================//
+
+#ifndef PHYSMESH_H
+#define PHYSMESH_H
+
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include "datacache/imdlcache.h"
+#include "vphysics_interface.h"
+#include "vcollide_parse.h"
+
+
+struct studiohdr_t;
+
+struct hlmvsolid_t : public solid_t
+{
+ float massBias;
+ int surfacePropIndex;
+};
+
+struct merge_t
+{
+ int parent;
+ int child;
+};
+
+struct editparams_t
+{
+ float totalMass;
+ char rootName[128];
+ int concave;
+ int mergeCount;
+ merge_t mergeList[32]; // there are never very many of these, so don't bother doing anything dynamic
+};
+
+class CPhysmesh
+{
+public:
+ void Clear( void );
+
+ char m_boneName[64];
+ int m_vertCount;
+ Vector *m_pVerts;
+ matrix3x4_t m_matrix;
+
+ hlmvsolid_t m_solid;
+ constraint_ragdollparams_t m_constraint;
+ ICollisionQuery *m_pCollisionModel;
+};
+
+class IStudioPhysics
+{
+public:
+ virtual ~IStudioPhysics( void ) {}
+
+ virtual char *DumpQC( void ) = 0;
+ virtual int Count( void ) = 0;
+ virtual CPhysmesh *GetMesh( int index ) = 0;
+ virtual float GetMass( void ) = 0;
+};
+
+IStudioPhysics *LoadPhysics( MDLHandle_t mdlHandle );
+void DestroyPhysics( IStudioPhysics *pStudioPhysics );
+
+#endif // PHYSMESH_H