!I (1670414, 1670415, 1670416, 1670424, 1670431):
[CRYENGINE.git] / Code / Sandbox / EditorQt / Objects / CharAttachHelper.cpp
blobb9db23842298fff5c14b2ee70d782c3fc22cdb7c
1 // Copyright 2001-2018 Crytek GmbH / Crytek Group. All rights reserved.
3 #include "StdAfx.h"
4 #include "CharAttachHelper.h"
5 #include <CryAnimation/ICryAnimation.h>
7 REGISTER_CLASS_DESC(CCharacterAttachHelperObjectClassDesc);
9 IMPLEMENT_DYNCREATE(CCharacterAttachHelperObject, CEntityObject)
11 float CCharacterAttachHelperObject::m_charAttachHelperScale = 1.0f;
13 //////////////////////////////////////////////////////////////////////////
14 CCharacterAttachHelperObject::CCharacterAttachHelperObject()
16 m_entityClass = "CharacterAttachHelper";
17 UseMaterialLayersMask(false);
20 //////////////////////////////////////////////////////////////////////////
21 void CCharacterAttachHelperObject::Display(DisplayContext& dc)
23 __super::Display(dc);
25 dc.SetLineWidth(4.0f);
26 float s = 1.0f * GetHelperScale();
28 if (m_pEntity)
30 Matrix34 tm = m_pEntity->GetWorldTM();
32 if (IsSelected())
33 dc.SetSelectedColor();
34 else
35 dc.SetColor(GetColor());
37 dc.SetLineWidth(4.0f);
38 dc.DrawLine(tm.TransformPoint(Vec3(0, 0, 0)), tm.TransformPoint(Vec3(s, 0, 0)), ColorF(1, 0, 0), ColorF(1, 0, 0));
39 dc.DrawLine(tm.TransformPoint(Vec3(0, 0, 0)), tm.TransformPoint(Vec3(0, s, 0)), ColorF(0, 1, 0), ColorF(0, 1, 0));
40 dc.DrawLine(tm.TransformPoint(Vec3(0, 0, 0)), tm.TransformPoint(Vec3(0, 0, s)), ColorF(0, 0, 1), ColorF(0, 0, 1));
41 dc.SetLineWidth(0);
43 dc.SetColor(ColorB(0, 255, 0, 255));
44 dc.DrawLine(tm.TransformPoint(Vec3(0, 0, 0)), GetWorldPos());
47 const Matrix34& tm = GetWorldTM();
49 if (IsSelected())
50 dc.SetSelectedColor();
51 else
52 dc.SetColor(GetColor());
54 dc.SetLineWidth(4.0f);
55 dc.DrawLine(tm.TransformPoint(Vec3(0, 0, 0)), tm.TransformPoint(Vec3(s, 0, 0)), ColorF(1, 0, 0), ColorF(1, 0, 0));
56 dc.DrawLine(tm.TransformPoint(Vec3(0, 0, 0)), tm.TransformPoint(Vec3(0, s, 0)), ColorF(0, 1, 0), ColorF(0, 1, 0));
57 dc.DrawLine(tm.TransformPoint(Vec3(0, 0, 0)), tm.TransformPoint(Vec3(0, 0, s)), ColorF(0, 0, 1), ColorF(0, 0, 1));
58 dc.SetLineWidth(0);
61 //////////////////////////////////////////////////////////////////////////
62 void CCharacterAttachHelperObject::SetHelperScale(float scale)
64 m_charAttachHelperScale = scale;