From 65479475721bb44ed0d9725c666fe2fa27da757e Mon Sep 17 00:00:00 2001 From: Pavel Rojtberg Date: Tue, 13 Dec 2016 14:17:33 +0100 Subject: [PATCH] simplify ((M^-1)^T)^-1 == M^T --- OgreMain/src/OgreGpuProgramParams.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OgreMain/src/OgreGpuProgramParams.cpp b/OgreMain/src/OgreGpuProgramParams.cpp index 07b2104c2db..4e4f84afe7b 100644 --- a/OgreMain/src/OgreGpuProgramParams.cpp +++ b/OgreMain/src/OgreGpuProgramParams.cpp @@ -2676,7 +2676,7 @@ namespace Ogre break; case ACT_LIGHT_DIRECTION_OBJECT_SPACE: // We need the inverse of the inverse transpose - source->getInverseTransposeWorldMatrix().inverse().extract3x3Matrix(m3); + source->getTransposeWorldMatrix().extract3x3Matrix(m3); vec3 = m3 * source->getLightDirection(i->data); vec3.normalise(); // Set as 4D vector for compatibility @@ -2696,7 +2696,7 @@ namespace Ogre case ACT_LIGHT_DIRECTION_OBJECT_SPACE_ARRAY: // We need the inverse of the inverse transpose - source->getInverseTransposeWorldMatrix().inverse().extract3x3Matrix(m3); + source->getTransposeWorldMatrix().extract3x3Matrix(m3); for (size_t l = 0; l < i->data; ++l) { vec3 = m3 * source->getLightDirection(l);