Revert "Sdk/DebugSystem: Fix OBB drawing"

This reverts commit a12c72186f.
This commit is contained in:
Lynix 2018-08-05 15:09:26 +02:00
parent 602992609f
commit 5bb16ab016
1 changed files with 8 additions and 5 deletions

View File

@ -59,6 +59,7 @@ namespace Ndk
{ {
NazaraAssert(m_entityOwner, "DebugRenderable has no owner"); NazaraAssert(m_entityOwner, "DebugRenderable has no owner");
const DebugComponent& entityDebug = m_entityOwner->GetComponent<DebugComponent>();
const GraphicsComponent& entityGfx = m_entityOwner->GetComponent<GraphicsComponent>(); const GraphicsComponent& entityGfx = m_entityOwner->GetComponent<GraphicsComponent>();
Nz::Boxf aabb = entityGfx.GetBoundingVolume().aabb; Nz::Boxf aabb = entityGfx.GetBoundingVolume().aabb;
@ -85,14 +86,16 @@ namespace Ndk
{ {
NazaraAssert(m_entityOwner, "DebugRenderable has no owner"); NazaraAssert(m_entityOwner, "DebugRenderable has no owner");
const DebugComponent& entityDebug = m_entityOwner->GetComponent<DebugComponent>();
const GraphicsComponent& entityGfx = m_entityOwner->GetComponent<GraphicsComponent>(); const GraphicsComponent& entityGfx = m_entityOwner->GetComponent<GraphicsComponent>();
Nz::OrientedBoxf entityObb = entityGfx.GetBoundingVolume().obb; Nz::Boxf obb = entityGfx.GetBoundingVolume().obb.localBox;
Nz::Boxf obb(entityObb.GetCorner(Nz::BoxCorner_NearLeftTop), entityObb.GetCorner(Nz::BoxCorner_FarRightBottom));
Nz::Matrix4f transformMatrix = Nz::Matrix4f::Identity(); Nz::Matrix4f transformMatrix = instanceData.transformMatrix;
transformMatrix.SetScale(obb.GetLengths()); Nz::Vector3f obbCenter = transformMatrix.Transform(obb.GetCenter(), 0.f); //< Apply rotation/scale to obb center, to display it at a correct position
transformMatrix.SetTranslation(obb.GetCenter());
transformMatrix.ApplyScale(obb.GetLengths());
transformMatrix.ApplyTranslation(obbCenter);
renderQueue->AddMesh(0, m_material, m_meshData, Nz::Boxf::Zero(), transformMatrix, scissorRect); renderQueue->AddMesh(0, m_material, m_meshData, Nz::Boxf::Zero(), transformMatrix, scissorRect);
} }