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.

56 lines
1.8 KiB

  1. //====== Copyright � 1996-2004, Valve Corporation, All rights reserved. =====//
  2. //
  3. // Dme version of a hitbox
  4. //
  5. //===========================================================================//
  6. // Valve includes
  7. #include "datamodel/dmelementfactoryhelper.h"
  8. #include "mdlobjects/dmehitbox.h"
  9. #include "tier2/renderutils.h"
  10. // memdbgon must be the last include file in a .cpp file!!!
  11. #include "tier0/memdbgon.h"
  12. //-----------------------------------------------------------------------------
  13. // Expose this class to the scene database
  14. //-----------------------------------------------------------------------------
  15. IMPLEMENT_ELEMENT_FACTORY( DmeHitbox, CDmeHitbox );
  16. //-----------------------------------------------------------------------------
  17. // Purpose:
  18. //-----------------------------------------------------------------------------
  19. void CDmeHitbox::OnConstruction()
  20. {
  21. m_sSurfaceProperty.Init( this, "surfaceProperty" );
  22. m_nGroupId.Init( this, "groupId" );
  23. m_sBoneName.Init( this, "boneName" );
  24. m_cRenderColor.InitAndSet( this, "renderColor", Color( 255, 255, 255, 64 ) );
  25. // Set by CDmeBBox to FLT_MAX, -FLT_MAX
  26. m_vMinBounds = Vector( 0.0f, 0.0f, 0.0f );
  27. m_vMaxBounds = Vector( 0.0f, 0.0f, 0.0f );
  28. }
  29. //-----------------------------------------------------------------------------
  30. //
  31. //-----------------------------------------------------------------------------
  32. void CDmeHitbox::OnDestruction()
  33. {
  34. }
  35. //-----------------------------------------------------------------------------
  36. // Rendering method for the dag
  37. //-----------------------------------------------------------------------------
  38. void CDmeHitbox::Draw( const matrix3x4_t &shapeToWorld, CDmeDrawSettings *pDrawSettings /* = NULL */ )
  39. {
  40. Vector vecOrigin;
  41. QAngle angles;
  42. MatrixAngles( shapeToWorld, angles, vecOrigin );
  43. RenderBox( vecOrigin, angles, m_vMinBounds, m_vMaxBounds, m_cRenderColor, true );
  44. }