Debug axes
Former-commit-id: e7d93df67679d1e29014120aef5cc0c3421fd9c2
This commit is contained in:
parent
89e0f631d6
commit
8716daf73c
|
|
@ -28,6 +28,7 @@ class NAZARA_API NzDebugDrawer
|
||||||
static void Draw(const NzOrientedBoxf& orientedBox);
|
static void Draw(const NzOrientedBoxf& orientedBox);
|
||||||
static void Draw(const NzSkeleton* skeleton);
|
static void Draw(const NzSkeleton* skeleton);
|
||||||
static void Draw(const NzVector3f& position, float size = 0.1f);
|
static void Draw(const NzVector3f& position, float size = 0.1f);
|
||||||
|
static void DrawAxes(const NzVector3f& position = NzVector3f::Zero(), float size = 1.f);
|
||||||
static void DrawBinormals(const NzStaticMesh* subMesh);
|
static void DrawBinormals(const NzStaticMesh* subMesh);
|
||||||
static void DrawCone(const NzVector3f& origin, const NzQuaternionf& rotation, float angle, float length);
|
static void DrawCone(const NzVector3f& origin, const NzQuaternionf& rotation, float angle, float length);
|
||||||
static void DrawLine(const NzVector3f& p1, const NzVector3f& p2);
|
static void DrawLine(const NzVector3f& p1, const NzVector3f& p2);
|
||||||
|
|
|
||||||
|
|
@ -367,6 +367,25 @@ void NzDebugDrawer::Draw(const NzVector3f& position, float size)
|
||||||
Draw(NzBoxf(position.x - size*0.5f, position.y - size*0.5f, position.z - size*0.5f, size, size, size));
|
Draw(NzBoxf(position.x - size*0.5f, position.y - size*0.5f, position.z - size*0.5f, size, size, size));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void NzDebugDrawer::DrawAxes(const NzVector3f& position, float size)
|
||||||
|
{
|
||||||
|
NzColor oldPrimaryColor = s_primaryColor;
|
||||||
|
s_primaryColor = NzColor::Red;
|
||||||
|
DrawLine(position, position + NzVector3f::UnitX() * 3.f * size / 4.f);
|
||||||
|
s_primaryColor = NzColor::Green;
|
||||||
|
DrawLine(position, position + NzVector3f::UnitY() * 3.f * size / 4.f);
|
||||||
|
s_primaryColor = NzColor::Blue;
|
||||||
|
DrawLine(position, position + NzVector3f::UnitZ() * 3.f * size / 4.f);
|
||||||
|
|
||||||
|
s_primaryColor = NzColor::Red;
|
||||||
|
DrawCone(position + NzVector3f::UnitX() * size, NzEulerAnglesf(0.f, 90.f, 0.f), 15, size / 4.f);
|
||||||
|
s_primaryColor = NzColor::Green;
|
||||||
|
DrawCone(position + NzVector3f::UnitY() * size, NzEulerAnglesf(-90.f, 0.f, 0.f), 15, size / 4.f);
|
||||||
|
s_primaryColor = NzColor::Blue;
|
||||||
|
DrawCone(position + NzVector3f::UnitZ() * size, NzEulerAnglesf(0.f, 0.f, 0.f), 15, size / 4.f);
|
||||||
|
s_primaryColor = oldPrimaryColor;
|
||||||
|
}
|
||||||
|
|
||||||
void NzDebugDrawer::DrawBinormals(const NzStaticMesh* subMesh)
|
void NzDebugDrawer::DrawBinormals(const NzStaticMesh* subMesh)
|
||||||
{
|
{
|
||||||
if (!Initialize())
|
if (!Initialize())
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue