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.

81 lines
2.1 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef PHYSICS_PROP_STATUE_H
  7. #define PHYSICS_PROP_STATUE_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "props.h"
  12. struct outer_collision_obb_t
  13. {
  14. bool bDirty;
  15. Vector vecPos;
  16. Vector vecMins;
  17. Vector vecMaxs;
  18. QAngle angAngles;
  19. CUtlVector<short> iSpheres;
  20. };
  21. //-----------------------------------------------------------------------------
  22. // Purpose: entity class for simple ragdoll physics
  23. //-----------------------------------------------------------------------------
  24. // UNDONE: Move this to a private header
  25. class CStatueProp : public CPhysicsProp
  26. {
  27. DECLARE_CLASS( CStatueProp, CPhysicsProp );
  28. DECLARE_SERVERCLASS();
  29. DECLARE_DATADESC();
  30. public:
  31. CStatueProp( void );
  32. virtual void Spawn( void );
  33. virtual void Precache();
  34. virtual bool CreateVPhysics();
  35. virtual void VPhysicsUpdate( IPhysicsObject *pPhysics );
  36. //virtual float GetAutoAimRadius() { return 24.0f; }
  37. virtual void ComputeWorldSpaceSurroundingBox( Vector *pMins, Vector *pMaxs );
  38. virtual bool TestCollision( const Ray_t &ray, unsigned int fContentsMask, trace_t& tr );
  39. virtual int OnTakeDamage( const CTakeDamageInfo &info );
  40. virtual void Event_Killed( const CTakeDamageInfo &info );
  41. virtual void Freeze( float flFreezeAmount = -1.0f, CBaseEntity *pFreezer = NULL, Ray_t *pFreezeRay = NULL );
  42. void CollisionPartnerThink( void );
  43. private:
  44. bool CreateVPhysicsFromHitBoxes( CBaseAnimating *pInitBaseAnimating );
  45. bool CreateVPhysicsFromOBBs( CBaseAnimating *pInitBaseAnimating );
  46. public:
  47. CNetworkHandle( CBaseAnimating, m_hInitBaseAnimating );
  48. CNetworkVar( bool, m_bShatter );
  49. CNetworkVar( int, m_nShatterFlags );
  50. CNetworkVector( m_vShatterPosition );
  51. CNetworkVector( m_vShatterForce );
  52. const CUtlVector<outer_collision_obb_t> *m_pInitOBBs;
  53. };
  54. CBaseEntity *CreateServerStatue( CBaseAnimating *pAnimating, int collisionGroup );
  55. CBaseEntity *CreateServerStatueFromOBBs( const CUtlVector<outer_collision_obb_t> &vecSphereOrigins, CBaseAnimating *pChildEntity );
  56. #endif // PHYSICS_PROP_STATUE_H