From 3bf9df6b2785fa6d951086978a3e66f49427166a Mon Sep 17 00:00:00 2001 From: FluorescentCIAAfricanAmerican <0934gj3049fk@protonmail.com> Date: Wed, 22 Apr 2020 12:56:21 -0400 Subject: 1 --- mdlobjects/dmehitbox.cpp | 49 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 mdlobjects/dmehitbox.cpp (limited to 'mdlobjects/dmehitbox.cpp') 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 ); +} + -- cgit v1.2.3