summaryrefslogtreecommitdiff
path: root/mdlobjects/dmehitbox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mdlobjects/dmehitbox.cpp')
-rw-r--r--mdlobjects/dmehitbox.cpp49
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 );
+}
+