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 /hammer/gizmo.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'hammer/gizmo.h')
| -rw-r--r-- | hammer/gizmo.h | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/hammer/gizmo.h b/hammer/gizmo.h new file mode 100644 index 0000000..8e206ab --- /dev/null +++ b/hammer/gizmo.h @@ -0,0 +1,78 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $Workfile: $ +// $Date: $ +// +//----------------------------------------------------------------------------- +// $Log: $ +// +// $NoKeywords: $ +//=============================================================================// + +#ifndef GIZMO_H +#define GIZMO_H +#pragma once + +#include "MapAtom.h" + + +#define GIZMO_AXIS_X 0x10 +#define GIZMO_AXIS_Y 0x20 +#define GIZMO_AXIS_Z 0x40 + +#define GIZMO_HANDLE_SCALE 0x01 +#define GIZMO_HANDLE_ROTATE 0x02 +#define GIZMO_HANDLE_TRANSLATE 0x04 +#define GIZMO_HANDLE_UNIFORM_SCALE 0x08 + + +class CGizmo : public CMapAtom +{ + public: + + CGizmo(void); + CGizmo(float x, float y, float z); + + void Initialize(void); + + void Render(CRender3D *pRender); + + inline void SetAxisLength(float fLength); + inline void SetPosition(float x, float y, float z); + + void DrawGizmoAxis(CRender3D *pRender, Vector& Origin, Vector& EndPoint, int red, int green, int blue, unsigned int uAxisHandle); + + protected: + + Vector m_Position; + float m_fAxisLength; +}; + + +//----------------------------------------------------------------------------- +// Purpose: Sets the length of the gizmo's axes. +// Input : fLength - Axis length in world units. +//----------------------------------------------------------------------------- +void CGizmo::SetAxisLength(float fLength) +{ + m_fAxisLength = fLength; +} + + +//----------------------------------------------------------------------------- +// Purpose: Sets the gizmo's position. +// Input : x - +// y - +// z - +//----------------------------------------------------------------------------- +void CGizmo::SetPosition(float x, float y, float z) +{ + m_Position[0] = x; + m_Position[1] = y; + m_Position[2] = z; +} + + +#endif // GIZMO_H |