diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /mdlobjects/dmehitbox.cpp | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'mdlobjects/dmehitbox.cpp')
| -rw-r--r-- | mdlobjects/dmehitbox.cpp | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/mdlobjects/dmehitbox.cpp b/mdlobjects/dmehitbox.cpp new file mode 100644 index 0000000..cabc504 --- /dev/null +++ b/mdlobjects/dmehitbox.cpp @@ -0,0 +1,49 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Dme version of a hitbox +// +//===========================================================================// + +#include "mdlobjects/dmehitbox.h" +#include "datamodel/dmelementfactoryhelper.h" +#include "tier2/renderutils.h" + +// memdbgon must be the last include file in a .cpp file!!! +#include "tier0/memdbgon.h" + + +//----------------------------------------------------------------------------- +// Expose this class to the scene database +//----------------------------------------------------------------------------- +IMPLEMENT_ELEMENT_FACTORY( DmeHitbox, CDmeHitbox ); + + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +void CDmeHitbox::OnConstruction() +{ + m_SurfaceProperty.Init( this, "surfaceProperty" ); + m_Group.Init( this, "groupName" ); + m_Bone.Init( this, "boneName" ); + m_vecMins.Init( this, "minBounds" ); + m_vecMaxs.Init( this, "maxBounds" ); + m_RenderColor.InitAndSet( this, "renderColor", Color( 255, 255, 255, 64 ) ); +} + +void CDmeHitbox::OnDestruction() +{ +} + + +//----------------------------------------------------------------------------- +// Rendering method for the dag +//----------------------------------------------------------------------------- +void CDmeHitbox::Draw( const matrix3x4_t &shapeToWorld, CDmeDrawSettings *pDrawSettings /* = NULL */ ) +{ + Vector vecOrigin; + QAngle angles; + MatrixAngles( shapeToWorld, angles, vecOrigin ); + RenderBox( vecOrigin, angles, m_vecMins, m_vecMaxs, m_RenderColor, true ); +} + |