From 7c47a93a72d51be27b1f8f03e7cebaea9dd25022 Mon Sep 17 00:00:00 2001 From: Lynix Date: Sat, 3 Jan 2015 22:31:25 +0100 Subject: [PATCH] Renamed Corner enum to BoxCorner Added RectCorner and Rect::GetCorner method Former-commit-id: dc99823ceb17f6e91cdf12779c982ab7e024ec24 --- include/Nazara/Math/Box.hpp | 2 +- include/Nazara/Math/Box.inl | 18 +++--- include/Nazara/Math/Enums.hpp | 30 ++++++--- include/Nazara/Math/Frustum.hpp | 4 +- include/Nazara/Math/Frustum.inl | 50 +++++++-------- include/Nazara/Math/OrientedBox.hpp | 4 +- include/Nazara/Math/OrientedBox.inl | 30 ++++----- include/Nazara/Math/Ray.inl | 6 +- include/Nazara/Math/Rect.hpp | 2 + include/Nazara/Math/Rect.inl | 22 +++++++ src/Nazara/Renderer/DebugDrawer.cpp | 96 ++++++++++++++--------------- 11 files changed, 149 insertions(+), 115 deletions(-) diff --git a/include/Nazara/Math/Box.hpp b/include/Nazara/Math/Box.hpp index 0409caffc..1705f25df 100644 --- a/include/Nazara/Math/Box.hpp +++ b/include/Nazara/Math/Box.hpp @@ -38,7 +38,7 @@ class NzBox NzBox& ExtendTo(const NzVector3& point); NzSphere GetBoundingSphere() const; - NzVector3 GetCorner(nzCorner corner) const; + NzVector3 GetCorner(nzBoxCorner corner) const; NzVector3 GetCenter() const; NzVector3 GetLengths() const; NzVector3 GetMaximum() const; diff --git a/include/Nazara/Math/Box.inl b/include/Nazara/Math/Box.inl index 651a6de13..11578f605 100644 --- a/include/Nazara/Math/Box.inl +++ b/include/Nazara/Math/Box.inl @@ -117,32 +117,32 @@ NzBox& NzBox::ExtendTo(const NzVector3& point) } template -NzVector3 NzBox::GetCorner(nzCorner corner) const +NzVector3 NzBox::GetCorner(nzBoxCorner corner) const { switch (corner) { - case nzCorner_FarLeftBottom: + case nzBoxCorner_FarLeftBottom: return NzVector3(x, y, z); - case nzCorner_FarLeftTop: + case nzBoxCorner_FarLeftTop: return NzVector3(x, y + height, z); - case nzCorner_FarRightBottom: + case nzBoxCorner_FarRightBottom: return NzVector3(x + width, y, z); - case nzCorner_FarRightTop: + case nzBoxCorner_FarRightTop: return NzVector3(x + width, y + height, z); - case nzCorner_NearLeftBottom: + case nzBoxCorner_NearLeftBottom: return NzVector3(x, y, z + depth); - case nzCorner_NearLeftTop: + case nzBoxCorner_NearLeftTop: return NzVector3(x, y + height, z + depth); - case nzCorner_NearRightBottom: + case nzBoxCorner_NearRightBottom: return NzVector3(x + width, y, z + depth); - case nzCorner_NearRightTop: + case nzBoxCorner_NearRightTop: return NzVector3(x + width, y + height, z + depth); } diff --git a/include/Nazara/Math/Enums.hpp b/include/Nazara/Math/Enums.hpp index efa249643..214c9958c 100644 --- a/include/Nazara/Math/Enums.hpp +++ b/include/Nazara/Math/Enums.hpp @@ -7,18 +7,18 @@ #ifndef NAZARA_ENUMS_MATH_HPP #define NAZARA_ENUMS_MATH_HPP -enum nzCorner +enum nzBoxCorner { - nzCorner_FarLeftBottom, - nzCorner_FarLeftTop, - nzCorner_FarRightBottom, - nzCorner_FarRightTop, - nzCorner_NearLeftBottom, - nzCorner_NearLeftTop, - nzCorner_NearRightBottom, - nzCorner_NearRightTop, + nzBoxCorner_FarLeftBottom, + nzBoxCorner_FarLeftTop, + nzBoxCorner_FarRightBottom, + nzBoxCorner_FarRightTop, + nzBoxCorner_NearLeftBottom, + nzBoxCorner_NearLeftTop, + nzBoxCorner_NearRightBottom, + nzBoxCorner_NearRightTop, - nzCorner_Max = nzCorner_NearRightTop + nzBoxCorner_Max = nzBoxCorner_NearRightTop }; enum nzExtend @@ -51,4 +51,14 @@ enum nzIntersectionSide nzIntersectionSide_Max = nzIntersectionSide_Outside }; +enum nzRectCorner +{ + nzRectCorner_LeftBottom, + nzRectCorner_LeftTop, + nzRectCorner_RightBottom, + nzRectCorner_RightTop, + + nzRectCorner_Max = nzRectCorner_RightTop +}; + #endif // NAZARA_ENUMS_MATH_HPP diff --git a/include/Nazara/Math/Frustum.hpp b/include/Nazara/Math/Frustum.hpp index e5de19b50..f94c229b0 100644 --- a/include/Nazara/Math/Frustum.hpp +++ b/include/Nazara/Math/Frustum.hpp @@ -37,7 +37,7 @@ class NzFrustum NzFrustum& Extract(const NzMatrix4& clipMatrix); NzFrustum& Extract(const NzMatrix4& view, const NzMatrix4& projection); - const NzVector3& GetCorner(nzCorner corner) const; + const NzVector3& GetCorner(nzBoxCorner corner) const; const NzPlane& GetPlane(nzFrustumPlane plane) const; nzIntersectionSide Intersect(const NzBoundingVolume& volume) const; @@ -52,7 +52,7 @@ class NzFrustum NzString ToString() const; private: - NzVector3 m_corners[nzCorner_Max+1]; + NzVector3 m_corners[nzBoxCorner_Max+1]; NzPlane m_planes[nzFrustumPlane_Max+1]; }; diff --git a/include/Nazara/Math/Frustum.inl b/include/Nazara/Math/Frustum.inl index 0a7b02215..336f5ad0a 100644 --- a/include/Nazara/Math/Frustum.inl +++ b/include/Nazara/Math/Frustum.inl @@ -44,23 +44,23 @@ NzFrustum& NzFrustum::Build(T angle, T ratio, T zNear, T zFar, const NzVec NzVector3 fc = eye + f * zFar; // Calcul du frustum - m_corners[nzCorner_FarLeftBottom] = fc - u*farH - s*farW; - m_corners[nzCorner_FarLeftTop] = fc + u*farH - s*farW; - m_corners[nzCorner_FarRightTop] = fc + u*farH + s*farW; - m_corners[nzCorner_FarRightBottom] = fc - u*farH + s*farW; + m_corners[nzBoxCorner_FarLeftBottom] = fc - u*farH - s*farW; + m_corners[nzBoxCorner_FarLeftTop] = fc + u*farH - s*farW; + m_corners[nzBoxCorner_FarRightTop] = fc + u*farH + s*farW; + m_corners[nzBoxCorner_FarRightBottom] = fc - u*farH + s*farW; - m_corners[nzCorner_NearLeftBottom] = nc - u*nearH - s*nearW; - m_corners[nzCorner_NearLeftTop] = nc + u*nearH - s*nearW; - m_corners[nzCorner_NearRightTop] = nc + u*nearH + s*nearW; - m_corners[nzCorner_NearRightBottom] = nc - u*nearH + s*nearW; + m_corners[nzBoxCorner_NearLeftBottom] = nc - u*nearH - s*nearW; + m_corners[nzBoxCorner_NearLeftTop] = nc + u*nearH - s*nearW; + m_corners[nzBoxCorner_NearRightTop] = nc + u*nearH + s*nearW; + m_corners[nzBoxCorner_NearRightBottom] = nc - u*nearH + s*nearW; // Construction des plans du frustum - m_planes[nzFrustumPlane_Bottom].Set(m_corners[nzCorner_NearLeftBottom], m_corners[nzCorner_NearRightBottom], m_corners[nzCorner_FarRightBottom]); - m_planes[nzFrustumPlane_Far].Set(m_corners[nzCorner_FarRightTop], m_corners[nzCorner_FarLeftTop], m_corners[nzCorner_FarLeftBottom]); - m_planes[nzFrustumPlane_Left].Set(m_corners[nzCorner_NearLeftTop], m_corners[nzCorner_NearLeftBottom], m_corners[nzCorner_FarLeftBottom]); - m_planes[nzFrustumPlane_Near].Set(m_corners[nzCorner_NearLeftTop], m_corners[nzCorner_NearRightTop], m_corners[nzCorner_NearRightBottom]); - m_planes[nzFrustumPlane_Right].Set(m_corners[nzCorner_NearRightBottom], m_corners[nzCorner_NearRightTop], m_corners[nzCorner_FarRightBottom]); - m_planes[nzFrustumPlane_Top].Set(m_corners[nzCorner_NearRightTop], m_corners[nzCorner_NearLeftTop], m_corners[nzCorner_FarLeftTop]); + m_planes[nzFrustumPlane_Bottom].Set(m_corners[nzBoxCorner_NearLeftBottom], m_corners[nzBoxCorner_NearRightBottom], m_corners[nzBoxCorner_FarRightBottom]); + m_planes[nzFrustumPlane_Far].Set(m_corners[nzBoxCorner_FarRightTop], m_corners[nzBoxCorner_FarLeftTop], m_corners[nzBoxCorner_FarLeftBottom]); + m_planes[nzFrustumPlane_Left].Set(m_corners[nzBoxCorner_NearLeftTop], m_corners[nzBoxCorner_NearLeftBottom], m_corners[nzBoxCorner_FarLeftBottom]); + m_planes[nzFrustumPlane_Near].Set(m_corners[nzBoxCorner_NearLeftTop], m_corners[nzBoxCorner_NearRightTop], m_corners[nzBoxCorner_NearRightBottom]); + m_planes[nzFrustumPlane_Right].Set(m_corners[nzBoxCorner_NearRightBottom], m_corners[nzBoxCorner_NearRightTop], m_corners[nzBoxCorner_FarRightBottom]); + m_planes[nzFrustumPlane_Top].Set(m_corners[nzBoxCorner_NearRightTop], m_corners[nzBoxCorner_NearLeftTop], m_corners[nzBoxCorner_FarLeftTop]); return *this; } @@ -272,56 +272,56 @@ NzFrustum& NzFrustum::Extract(const NzMatrix4& clipMatrix) corner = invClipMatrix.Transform(corner); corner.Normalize(); - m_corners[nzCorner_FarLeftBottom] = NzVector3(corner.x, corner.y, corner.z); + m_corners[nzBoxCorner_FarLeftBottom] = NzVector3(corner.x, corner.y, corner.z); // FarLeftTop corner.Set(F(-1.0), F(1.0), F(1.0)); corner = invClipMatrix.Transform(corner); corner.Normalize(); - m_corners[nzCorner_FarLeftTop] = NzVector3(corner.x, corner.y, corner.z); + m_corners[nzBoxCorner_FarLeftTop] = NzVector3(corner.x, corner.y, corner.z); // FarRightBottom corner.Set(F(1.0), F(-1.0), F(1.0)); corner = invClipMatrix.Transform(corner); corner.Normalize(); - m_corners[nzCorner_FarRightBottom] = NzVector3(corner.x, corner.y, corner.z); + m_corners[nzBoxCorner_FarRightBottom] = NzVector3(corner.x, corner.y, corner.z); // FarRightTop corner.Set(F(1.0), F(1.0), F(1.0)); corner = invClipMatrix.Transform(corner); corner.Normalize(); - m_corners[nzCorner_FarRightTop] = NzVector3(corner.x, corner.y, corner.z); + m_corners[nzBoxCorner_FarRightTop] = NzVector3(corner.x, corner.y, corner.z); // NearLeftBottom corner.Set(F(-1.0), F(-1.0), F(0.0)); corner = invClipMatrix.Transform(corner); corner.Normalize(); - m_corners[nzCorner_NearLeftBottom] = NzVector3(corner.x, corner.y, corner.z); + m_corners[nzBoxCorner_NearLeftBottom] = NzVector3(corner.x, corner.y, corner.z); // NearLeftTop corner.Set(F(-1.0), F(1.0), F(0.0)); corner = invClipMatrix.Transform(corner); corner.Normalize(); - m_corners[nzCorner_NearLeftTop] = NzVector3(corner.x, corner.y, corner.z); + m_corners[nzBoxCorner_NearLeftTop] = NzVector3(corner.x, corner.y, corner.z); // NearRightBottom corner.Set(F(1.0), F(-1.0), F(0.0)); corner = invClipMatrix.Transform(corner); corner.Normalize(); - m_corners[nzCorner_NearRightBottom] = NzVector3(corner.x, corner.y, corner.z); + m_corners[nzBoxCorner_NearRightBottom] = NzVector3(corner.x, corner.y, corner.z); // NearRightTop corner.Set(F(1.0), F(1.0), F(0.0)); corner = invClipMatrix.Transform(corner); corner.Normalize(); - m_corners[nzCorner_NearRightTop] = NzVector3(corner.x, corner.y, corner.z); + m_corners[nzBoxCorner_NearRightTop] = NzVector3(corner.x, corner.y, corner.z); } else NazaraWarning("Clip matrix is not invertible, failed to compute frustum corners"); @@ -339,10 +339,10 @@ NzFrustum& NzFrustum::Extract(const NzMatrix4& view, const NzMatrix4 } template -const NzVector3& NzFrustum::GetCorner(nzCorner corner) const +const NzVector3& NzFrustum::GetCorner(nzBoxCorner corner) const { #ifdef NAZARA_DEBUG - if (corner > nzCorner_Max) + if (corner > nzBoxCorner_Max) { NazaraError("Corner not handled (0x" + NzString::Number(corner, 16) + ')'); @@ -481,7 +481,7 @@ template template NzFrustum& NzFrustum::Set(const NzFrustum& frustum) { - for (unsigned int i = 0; i <= nzCorner_Max; ++i) + for (unsigned int i = 0; i <= nzBoxCorner_Max; ++i) m_corners[i].Set(frustum.m_corners[i]); for (unsigned int i = 0; i <= nzFrustumPlane_Max; ++i) diff --git a/include/Nazara/Math/OrientedBox.hpp b/include/Nazara/Math/OrientedBox.hpp index 9f5b711b6..b6ea75fd7 100644 --- a/include/Nazara/Math/OrientedBox.hpp +++ b/include/Nazara/Math/OrientedBox.hpp @@ -24,7 +24,7 @@ class NzOrientedBox NzOrientedBox(const NzOrientedBox& orientedBox) = default; ~NzOrientedBox() = default; - const NzVector3& GetCorner(nzCorner corner) const; + const NzVector3& GetCorner(nzBoxCorner corner) const; bool IsValid() const; @@ -59,7 +59,7 @@ class NzOrientedBox NzBox localBox; private: - NzVector3 m_corners[nzCorner_Max+1]; // Ne peuvent pas être modifiés directement + NzVector3 m_corners[nzBoxCorner_Max+1]; // Ne peuvent pas être modifiés directement }; template diff --git a/include/Nazara/Math/OrientedBox.inl b/include/Nazara/Math/OrientedBox.inl index 992698bad..8d242d52e 100644 --- a/include/Nazara/Math/OrientedBox.inl +++ b/include/Nazara/Math/OrientedBox.inl @@ -37,10 +37,10 @@ NzOrientedBox::NzOrientedBox(const NzOrientedBox& orientedBox) } template -const NzVector3& NzOrientedBox::GetCorner(nzCorner corner) const +const NzVector3& NzOrientedBox::GetCorner(nzBoxCorner corner) const { #ifdef NAZARA_DEBUG - if (corner > nzCorner_Max) + if (corner > nzBoxCorner_Max) { NazaraError("Corner not handled (0x" + NzString::Number(corner, 16) + ')'); @@ -102,7 +102,7 @@ template template NzOrientedBox& NzOrientedBox::Set(const NzOrientedBox& orientedBox) { - for (unsigned int i = 0; i <= nzCorner_Max; ++i) + for (unsigned int i = 0; i <= nzBoxCorner_Max; ++i) m_corners[i].Set(orientedBox.m_corners[i]); localBox = orientedBox.localBox; @@ -115,21 +115,21 @@ NzString NzOrientedBox::ToString() const { NzStringStream ss; - return ss << "OrientedBox(FLB: " << m_corners[nzCorner_FarLeftBottom].ToString() << "\n" - << " FLT: " << m_corners[nzCorner_FarLeftTop].ToString() << "\n" - << " FRB: " << m_corners[nzCorner_FarRightBottom].ToString() << "\n" - << " FRT: " << m_corners[nzCorner_FarRightTop].ToString() << "\n" - << " NLB: " << m_corners[nzCorner_NearLeftBottom].ToString() << "\n" - << " NLT: " << m_corners[nzCorner_NearLeftTop].ToString() << "\n" - << " NRB: " << m_corners[nzCorner_NearRightBottom].ToString() << "\n" - << " NRT: " << m_corners[nzCorner_NearRightTop].ToString() << ")\n"; + return ss << "OrientedBox(FLB: " << m_corners[nzBoxCorner_FarLeftBottom].ToString() << "\n" + << " FLT: " << m_corners[nzBoxCorner_FarLeftTop].ToString() << "\n" + << " FRB: " << m_corners[nzBoxCorner_FarRightBottom].ToString() << "\n" + << " FRT: " << m_corners[nzBoxCorner_FarRightTop].ToString() << "\n" + << " NLB: " << m_corners[nzBoxCorner_NearLeftBottom].ToString() << "\n" + << " NLT: " << m_corners[nzBoxCorner_NearLeftTop].ToString() << "\n" + << " NRB: " << m_corners[nzBoxCorner_NearRightBottom].ToString() << "\n" + << " NRT: " << m_corners[nzBoxCorner_NearRightTop].ToString() << ")\n"; } template void NzOrientedBox::Update(const NzMatrix4& transformMatrix) { - for (unsigned int i = 0; i <= nzCorner_Max; ++i) - m_corners[i] = transformMatrix.Transform(localBox.GetCorner(static_cast(i))); + for (unsigned int i = 0; i <= nzBoxCorner_Max; ++i) + m_corners[i] = transformMatrix.Transform(localBox.GetCorner(static_cast(i))); } template @@ -148,7 +148,7 @@ template NzVector3& NzOrientedBox::operator()(unsigned int i) { #if NAZARA_MATH_SAFE - if (i > nzCorner_Max) + if (i > nzBoxCorner_Max) { NzStringStream ss; ss << "Index out of range: (" << i << " >= 3)"; @@ -165,7 +165,7 @@ template NzVector3 NzOrientedBox::operator()(unsigned int i) const { #if NAZARA_MATH_SAFE - if (i > nzCorner_Max) + if (i > nzBoxCorner_Max) { NzStringStream ss; ss << "Index out of range: (" << i << " >= 3)"; diff --git a/include/Nazara/Math/Ray.inl b/include/Nazara/Math/Ray.inl index ec4802bca..900ec2bbf 100644 --- a/include/Nazara/Math/Ray.inl +++ b/include/Nazara/Math/Ray.inl @@ -204,9 +204,9 @@ bool NzRay::Intersect(const NzBox& box, const NzMatrix4& transform, T* template bool NzRay::Intersect(const NzOrientedBox& orientedBox, T* closestHit, T* farthestHit) const { - NzVector3 width = (orientedBox.GetCorner(nzCorner_NearLeftBottom) - orientedBox.GetCorner(nzCorner_FarLeftBottom)).Normalize(); - NzVector3 height = (orientedBox.GetCorner(nzCorner_FarLeftTop) - orientedBox.GetCorner(nzCorner_FarLeftBottom)).Normalize(); - NzVector3 depth = (orientedBox.GetCorner(nzCorner_FarRightBottom) - orientedBox.GetCorner(nzCorner_FarLeftBottom)).Normalize(); + NzVector3 width = (orientedBox.GetCorner(nzBoxCorner_NearLeftBottom) - orientedBox.GetCorner(nzBoxCorner_FarLeftBottom)).Normalize(); + NzVector3 height = (orientedBox.GetCorner(nzBoxCorner_FarLeftTop) - orientedBox.GetCorner(nzBoxCorner_FarLeftBottom)).Normalize(); + NzVector3 depth = (orientedBox.GetCorner(nzBoxCorner_FarRightBottom) - orientedBox.GetCorner(nzBoxCorner_FarLeftBottom)).Normalize(); // Construction de la matrice de transformation de l'OBB NzMatrix4 matrix(width.x, height.x, depth.x, F(0.0), diff --git a/include/Nazara/Math/Rect.hpp b/include/Nazara/Math/Rect.hpp index a91c7b0e9..424d69079 100644 --- a/include/Nazara/Math/Rect.hpp +++ b/include/Nazara/Math/Rect.hpp @@ -8,6 +8,7 @@ #define NAZARA_RECT_HPP #include +#include #include template @@ -33,6 +34,7 @@ class NzRect NzRect& ExtendTo(const NzRect& rect); NzVector2 GetCenter() const; + NzVector2 GetCorner(nzRectCorner corner) const; NzVector2 GetLengths() const; NzVector2 GetMaximum() const; NzVector2 GetMinimum() const; diff --git a/include/Nazara/Math/Rect.inl b/include/Nazara/Math/Rect.inl index 3d1908b83..5cee6602d 100644 --- a/include/Nazara/Math/Rect.inl +++ b/include/Nazara/Math/Rect.inl @@ -109,6 +109,28 @@ NzVector2 NzRect::GetCenter() const return GetPosition() + GetLengths() / F(2.0); } +template +NzVector2 NzRect::GetCorner(nzRectCorner corner) const +{ + switch (corner) + { + case nzRectCorner_LeftBottom: + return NzVector2(x, y + height); + + case nzRectCorner_LeftTop: + return NzVector2(x, y); + + case nzRectCorner_RightBottom: + return NzVector2(x + width, y + height); + + case nzRectCorner_RightTop: + return NzVector2(x + width, y); + } + + NazaraError("Corner not handled (0x" + NzString::Number(corner, 16) + ')'); + return NzVector2(); +} + template NzVector2 NzRect::GetLengths() const { diff --git a/src/Nazara/Renderer/DebugDrawer.cpp b/src/Nazara/Renderer/DebugDrawer.cpp index 066566bc1..f0ee2e133 100644 --- a/src/Nazara/Renderer/DebugDrawer.cpp +++ b/src/Nazara/Renderer/DebugDrawer.cpp @@ -159,64 +159,64 @@ void NzDebugDrawer::Draw(const NzFrustumf& frustum) NzBufferMapper mapper(s_vertexBuffer, nzBufferAccess_DiscardAndWrite, 0, 24); NzVertexStruct_XYZ* vertex = reinterpret_cast(mapper.GetPointer()); - vertex->position.Set(frustum.GetCorner(nzCorner_NearLeftBottom)); + vertex->position.Set(frustum.GetCorner(nzBoxCorner_NearLeftBottom)); vertex++; - vertex->position.Set(frustum.GetCorner(nzCorner_NearRightBottom)); + vertex->position.Set(frustum.GetCorner(nzBoxCorner_NearRightBottom)); vertex++; - vertex->position.Set(frustum.GetCorner(nzCorner_NearLeftBottom)); + vertex->position.Set(frustum.GetCorner(nzBoxCorner_NearLeftBottom)); vertex++; - vertex->position.Set(frustum.GetCorner(nzCorner_NearLeftTop)); + vertex->position.Set(frustum.GetCorner(nzBoxCorner_NearLeftTop)); vertex++; - vertex->position.Set(frustum.GetCorner(nzCorner_NearLeftBottom)); + vertex->position.Set(frustum.GetCorner(nzBoxCorner_NearLeftBottom)); vertex++; - vertex->position.Set(frustum.GetCorner(nzCorner_FarLeftBottom)); + vertex->position.Set(frustum.GetCorner(nzBoxCorner_FarLeftBottom)); vertex++; - vertex->position.Set(frustum.GetCorner(nzCorner_FarRightTop)); + vertex->position.Set(frustum.GetCorner(nzBoxCorner_FarRightTop)); vertex++; - vertex->position.Set(frustum.GetCorner(nzCorner_FarLeftTop)); + vertex->position.Set(frustum.GetCorner(nzBoxCorner_FarLeftTop)); vertex++; - vertex->position.Set(frustum.GetCorner(nzCorner_FarRightTop)); + vertex->position.Set(frustum.GetCorner(nzBoxCorner_FarRightTop)); vertex++; - vertex->position.Set(frustum.GetCorner(nzCorner_FarRightBottom)); + vertex->position.Set(frustum.GetCorner(nzBoxCorner_FarRightBottom)); vertex++; - vertex->position.Set(frustum.GetCorner(nzCorner_FarRightTop)); + vertex->position.Set(frustum.GetCorner(nzBoxCorner_FarRightTop)); vertex++; - vertex->position.Set(frustum.GetCorner(nzCorner_NearRightTop)); + vertex->position.Set(frustum.GetCorner(nzBoxCorner_NearRightTop)); vertex++; - vertex->position.Set(frustum.GetCorner(nzCorner_FarLeftBottom)); + vertex->position.Set(frustum.GetCorner(nzBoxCorner_FarLeftBottom)); vertex++; - vertex->position.Set(frustum.GetCorner(nzCorner_FarRightBottom)); + vertex->position.Set(frustum.GetCorner(nzBoxCorner_FarRightBottom)); vertex++; - vertex->position.Set(frustum.GetCorner(nzCorner_FarLeftBottom)); + vertex->position.Set(frustum.GetCorner(nzBoxCorner_FarLeftBottom)); vertex++; - vertex->position.Set(frustum.GetCorner(nzCorner_FarLeftTop)); + vertex->position.Set(frustum.GetCorner(nzBoxCorner_FarLeftTop)); vertex++; - vertex->position.Set(frustum.GetCorner(nzCorner_NearLeftTop)); + vertex->position.Set(frustum.GetCorner(nzBoxCorner_NearLeftTop)); vertex++; - vertex->position.Set(frustum.GetCorner(nzCorner_NearRightTop)); + vertex->position.Set(frustum.GetCorner(nzBoxCorner_NearRightTop)); vertex++; - vertex->position.Set(frustum.GetCorner(nzCorner_NearLeftTop)); + vertex->position.Set(frustum.GetCorner(nzBoxCorner_NearLeftTop)); vertex++; - vertex->position.Set(frustum.GetCorner(nzCorner_FarLeftTop)); + vertex->position.Set(frustum.GetCorner(nzBoxCorner_FarLeftTop)); vertex++; - vertex->position.Set(frustum.GetCorner(nzCorner_NearRightBottom)); + vertex->position.Set(frustum.GetCorner(nzBoxCorner_NearRightBottom)); vertex++; - vertex->position.Set(frustum.GetCorner(nzCorner_NearRightTop)); + vertex->position.Set(frustum.GetCorner(nzBoxCorner_NearRightTop)); vertex++; - vertex->position.Set(frustum.GetCorner(nzCorner_NearRightBottom)); + vertex->position.Set(frustum.GetCorner(nzBoxCorner_NearRightBottom)); vertex++; - vertex->position.Set(frustum.GetCorner(nzCorner_FarRightBottom)); + vertex->position.Set(frustum.GetCorner(nzBoxCorner_FarRightBottom)); vertex++; mapper.Unmap(); @@ -241,64 +241,64 @@ void NzDebugDrawer::Draw(const NzOrientedBoxf& orientedBox) NzBufferMapper mapper(s_vertexBuffer, nzBufferAccess_DiscardAndWrite, 0, 24); NzVertexStruct_XYZ* vertex = reinterpret_cast(mapper.GetPointer()); - vertex->position.Set(orientedBox.GetCorner(nzCorner_NearLeftBottom)); + vertex->position.Set(orientedBox.GetCorner(nzBoxCorner_NearLeftBottom)); vertex++; - vertex->position.Set(orientedBox.GetCorner(nzCorner_NearRightBottom)); + vertex->position.Set(orientedBox.GetCorner(nzBoxCorner_NearRightBottom)); vertex++; - vertex->position.Set(orientedBox.GetCorner(nzCorner_NearLeftBottom)); + vertex->position.Set(orientedBox.GetCorner(nzBoxCorner_NearLeftBottom)); vertex++; - vertex->position.Set(orientedBox.GetCorner(nzCorner_NearLeftTop)); + vertex->position.Set(orientedBox.GetCorner(nzBoxCorner_NearLeftTop)); vertex++; - vertex->position.Set(orientedBox.GetCorner(nzCorner_NearLeftBottom)); + vertex->position.Set(orientedBox.GetCorner(nzBoxCorner_NearLeftBottom)); vertex++; - vertex->position.Set(orientedBox.GetCorner(nzCorner_FarLeftBottom)); + vertex->position.Set(orientedBox.GetCorner(nzBoxCorner_FarLeftBottom)); vertex++; - vertex->position.Set(orientedBox.GetCorner(nzCorner_FarRightTop)); + vertex->position.Set(orientedBox.GetCorner(nzBoxCorner_FarRightTop)); vertex++; - vertex->position.Set(orientedBox.GetCorner(nzCorner_FarLeftTop)); + vertex->position.Set(orientedBox.GetCorner(nzBoxCorner_FarLeftTop)); vertex++; - vertex->position.Set(orientedBox.GetCorner(nzCorner_FarRightTop)); + vertex->position.Set(orientedBox.GetCorner(nzBoxCorner_FarRightTop)); vertex++; - vertex->position.Set(orientedBox.GetCorner(nzCorner_FarRightBottom)); + vertex->position.Set(orientedBox.GetCorner(nzBoxCorner_FarRightBottom)); vertex++; - vertex->position.Set(orientedBox.GetCorner(nzCorner_FarRightTop)); + vertex->position.Set(orientedBox.GetCorner(nzBoxCorner_FarRightTop)); vertex++; - vertex->position.Set(orientedBox.GetCorner(nzCorner_NearRightTop)); + vertex->position.Set(orientedBox.GetCorner(nzBoxCorner_NearRightTop)); vertex++; - vertex->position.Set(orientedBox.GetCorner(nzCorner_FarLeftBottom)); + vertex->position.Set(orientedBox.GetCorner(nzBoxCorner_FarLeftBottom)); vertex++; - vertex->position.Set(orientedBox.GetCorner(nzCorner_FarRightBottom)); + vertex->position.Set(orientedBox.GetCorner(nzBoxCorner_FarRightBottom)); vertex++; - vertex->position.Set(orientedBox.GetCorner(nzCorner_FarLeftBottom)); + vertex->position.Set(orientedBox.GetCorner(nzBoxCorner_FarLeftBottom)); vertex++; - vertex->position.Set(orientedBox.GetCorner(nzCorner_FarLeftTop)); + vertex->position.Set(orientedBox.GetCorner(nzBoxCorner_FarLeftTop)); vertex++; - vertex->position.Set(orientedBox.GetCorner(nzCorner_NearLeftTop)); + vertex->position.Set(orientedBox.GetCorner(nzBoxCorner_NearLeftTop)); vertex++; - vertex->position.Set(orientedBox.GetCorner(nzCorner_NearRightTop)); + vertex->position.Set(orientedBox.GetCorner(nzBoxCorner_NearRightTop)); vertex++; - vertex->position.Set(orientedBox.GetCorner(nzCorner_NearLeftTop)); + vertex->position.Set(orientedBox.GetCorner(nzBoxCorner_NearLeftTop)); vertex++; - vertex->position.Set(orientedBox.GetCorner(nzCorner_FarLeftTop)); + vertex->position.Set(orientedBox.GetCorner(nzBoxCorner_FarLeftTop)); vertex++; - vertex->position.Set(orientedBox.GetCorner(nzCorner_NearRightBottom)); + vertex->position.Set(orientedBox.GetCorner(nzBoxCorner_NearRightBottom)); vertex++; - vertex->position.Set(orientedBox.GetCorner(nzCorner_NearRightTop)); + vertex->position.Set(orientedBox.GetCorner(nzBoxCorner_NearRightTop)); vertex++; - vertex->position.Set(orientedBox.GetCorner(nzCorner_NearRightBottom)); + vertex->position.Set(orientedBox.GetCorner(nzBoxCorner_NearRightBottom)); vertex++; - vertex->position.Set(orientedBox.GetCorner(nzCorner_FarRightBottom)); + vertex->position.Set(orientedBox.GetCorner(nzBoxCorner_FarRightBottom)); vertex++; mapper.Unmap();