summaryrefslogtreecommitdiff
path: root/hammer/gizmo.h
blob: 8e206abb84c90a809465e16dc5aa20f62dbc9f4a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
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