Team Fortress 2 Source Code as on 22/4/2020
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.

49 lines
1.6 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Dme version of a hitbox
  4. //
  5. //===========================================================================//
  6. #include "mdlobjects/dmehitbox.h"
  7. #include "datamodel/dmelementfactoryhelper.h"
  8. #include "tier2/renderutils.h"
  9. // memdbgon must be the last include file in a .cpp file!!!
  10. #include "tier0/memdbgon.h"
  11. //-----------------------------------------------------------------------------
  12. // Expose this class to the scene database
  13. //-----------------------------------------------------------------------------
  14. IMPLEMENT_ELEMENT_FACTORY( DmeHitbox, CDmeHitbox );
  15. //-----------------------------------------------------------------------------
  16. // Purpose:
  17. //-----------------------------------------------------------------------------
  18. void CDmeHitbox::OnConstruction()
  19. {
  20. m_SurfaceProperty.Init( this, "surfaceProperty" );
  21. m_Group.Init( this, "groupName" );
  22. m_Bone.Init( this, "boneName" );
  23. m_vecMins.Init( this, "minBounds" );
  24. m_vecMaxs.Init( this, "maxBounds" );
  25. m_RenderColor.InitAndSet( this, "renderColor", Color( 255, 255, 255, 64 ) );
  26. }
  27. void CDmeHitbox::OnDestruction()
  28. {
  29. }
  30. //-----------------------------------------------------------------------------
  31. // Rendering method for the dag
  32. //-----------------------------------------------------------------------------
  33. void CDmeHitbox::Draw( const matrix3x4_t &shapeToWorld, CDmeDrawSettings *pDrawSettings /* = NULL */ )
  34. {
  35. Vector vecOrigin;
  36. QAngle angles;
  37. MatrixAngles( shapeToWorld, angles, vecOrigin );
  38. RenderBox( vecOrigin, angles, m_vecMins, m_vecMaxs, m_RenderColor, true );
  39. }