Skip to content

Commit

Permalink
simplify ((M^-1)^T)^-1 == M^T
Browse files Browse the repository at this point in the history
  • Loading branch information
paroj committed Dec 13, 2016
1 parent e43561c commit 6547947
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions OgreMain/src/OgreGpuProgramParams.cpp
Expand Up @@ -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
Expand All @@ -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);
Expand Down

0 comments on commit 6547947

Please sign in to comment.