Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
1.3 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef PHYSMESH_H
  8. #define PHYSMESH_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "datacache/imdlcache.h"
  13. #include "vphysics_interface.h"
  14. #include "vcollide_parse.h"
  15. struct studiohdr_t;
  16. struct hlmvsolid_t : public solid_t
  17. {
  18. float massBias;
  19. int surfacePropIndex;
  20. };
  21. struct merge_t
  22. {
  23. int parent;
  24. int child;
  25. };
  26. struct editparams_t
  27. {
  28. float totalMass;
  29. char rootName[128];
  30. int concave;
  31. int mergeCount;
  32. merge_t mergeList[32]; // there are never very many of these, so don't bother doing anything dynamic
  33. };
  34. class CPhysmesh
  35. {
  36. public:
  37. void Clear( void );
  38. char m_boneName[64];
  39. int m_vertCount;
  40. Vector *m_pVerts;
  41. matrix3x4_t m_matrix;
  42. hlmvsolid_t m_solid;
  43. constraint_ragdollparams_t m_constraint;
  44. ICollisionQuery *m_pCollisionModel;
  45. };
  46. class IStudioPhysics
  47. {
  48. public:
  49. virtual ~IStudioPhysics( void ) {}
  50. virtual char *DumpQC( void ) = 0;
  51. virtual int Count( void ) = 0;
  52. virtual CPhysmesh *GetMesh( int index ) = 0;
  53. virtual float GetMass( void ) = 0;
  54. };
  55. IStudioPhysics *LoadPhysics( MDLHandle_t mdlHandle );
  56. void DestroyPhysics( IStudioPhysics *pStudioPhysics );
  57. #endif // PHYSMESH_H