1 // Copyright 2001-2018 Crytek GmbH / Crytek Group. All rights reserved.
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
)
25 dc
.SetLineWidth(4.0f
);
26 float s
= 1.0f
* GetHelperScale();
30 Matrix34 tm
= m_pEntity
->GetWorldTM();
33 dc
.SetSelectedColor();
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));
43 dc
.SetColor(ColorB(0, 255, 0, 255));
44 dc
.DrawLine(tm
.TransformPoint(Vec3(0, 0, 0)), GetWorldPos());
47 const Matrix34
& tm
= GetWorldTM();
50 dc
.SetSelectedColor();
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));
61 //////////////////////////////////////////////////////////////////////////
62 void CCharacterAttachHelperObject::SetHelperScale(float scale
)
64 m_charAttachHelperScale
= scale
;