From ea3644ef442a1ec22e4b4325bcd53edf72525ff8 Mon Sep 17 00:00:00 2001 From: Lynix Date: Sat, 19 Sep 2015 15:13:00 +0200 Subject: [PATCH] Ndk: Optimize coordinate system matrix concatenation Since both matrix are affine Former-commit-id: e2e35ad9af0183291b7345229f9af4425cb523fb --- SDK/src/NDK/Components/GraphicsComponent.cpp | 2 +- SDK/src/NDK/Systems/RenderSystem.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/SDK/src/NDK/Components/GraphicsComponent.cpp b/SDK/src/NDK/Components/GraphicsComponent.cpp index ee5658e18..606a93d21 100644 --- a/SDK/src/NDK/Components/GraphicsComponent.cpp +++ b/SDK/src/NDK/Components/GraphicsComponent.cpp @@ -69,7 +69,7 @@ namespace Ndk Ndk::RenderSystem& renderSystem = m_entity->GetWorld()->GetSystem(); - m_transformMatrix = renderSystem.GetCoordinateSystemMatrix() * m_entity->GetComponent().GetTransformMatrix(); + m_transformMatrix = NzMatrix4f::ConcatenateAffine(renderSystem.GetCoordinateSystemMatrix(), m_entity->GetComponent().GetTransformMatrix()); m_transformMatrixUpdated = true; } diff --git a/SDK/src/NDK/Systems/RenderSystem.cpp b/SDK/src/NDK/Systems/RenderSystem.cpp index 35aae1403..6e7c714fe 100644 --- a/SDK/src/NDK/Systems/RenderSystem.cpp +++ b/SDK/src/NDK/Systems/RenderSystem.cpp @@ -91,7 +91,7 @@ namespace Ndk NodeComponent& drawableNode = light->GetComponent(); ///TODO: Cache somehow? - lightComponent.AddToRenderQueue(renderQueue, m_coordinateSystemMatrix * drawableNode.GetTransformMatrix()); + lightComponent.AddToRenderQueue(renderQueue, NzMatrix4f::ConcatenateAffine(m_coordinateSystemMatrix, drawableNode.GetTransformMatrix())); } NzSceneData sceneData;