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.

57 lines
1.8 KiB

  1. //========= Copyright c 1996-2008, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: the interface to the old and new physics ragdoll glue code between Entity and Physics systems
  4. //
  5. // $Workfile: $
  6. // $Date: $
  7. // $NoKeywords: $
  8. //=============================================================================//
  9. #ifndef RAGDOLL_INTERFACE_H
  10. #define RAGDOLL_INTERFACE_H
  11. class C_BaseEntity;
  12. class CStudioHdr;
  13. struct mstudiobone_t;
  14. class Vector;
  15. class IPhysicsObject;
  16. class CBoneAccessor;
  17. abstract_class IRagdoll
  18. {
  19. public:
  20. virtual ~IRagdoll() {}
  21. virtual void RagdollBone( C_BaseEntity *ent, mstudiobone_t *pbones, int boneCount, bool *boneSimulated, CBoneAccessor &pBoneToWorld ) = 0;
  22. virtual const Vector& GetRagdollOrigin( ) = 0;
  23. virtual void GetRagdollBounds( Vector &mins, Vector &maxs ) = 0;
  24. virtual int RagdollBoneCount() const = 0;
  25. virtual IPhysicsObject *GetElement( int elementNum ) = 0;
  26. virtual void DrawWireframe( void ) = 0;
  27. virtual void VPhysicsUpdate( IPhysicsObject *pObject ) = 0;
  28. virtual bool AllowStretch() const = 0;
  29. virtual void BuildRagdollBounds( C_BaseEntity *ent ) = 0;
  30. virtual bool SolvePenetrations(IPhysicsObject *pObj0, IPhysicsObject *pObj1) = 0;
  31. virtual datamap_t *GetDataMap() = 0;
  32. virtual void ResetRagdollSleepAfterTime(void) = 0;
  33. virtual float GetLastVPhysicsUpdateTime() const = 0;
  34. ragdoll_t *GetRagdoll( void ) {return NULL;} // the old ragdoll needs this for now
  35. virtual void Init(
  36. C_BaseEntity *ent,
  37. CStudioHdr *pstudiohdr,
  38. const Vector &forceVector,
  39. int forceBone,
  40. const matrix3x4_t *pDeltaBones0,
  41. const matrix3x4_t *pDeltaBones1,
  42. const matrix3x4_t *pCurrentBonePosition,
  43. float boneDt ) = 0;
  44. virtual bool IsValid()const = 0;
  45. };
  46. extern IRagdoll *CreateRagdoll();
  47. extern IRagdoll *CreateRagdoll2();
  48. #endif