Code: Select all
case ACT_LIGHT_DIRECTION_OBJECT_SPACE:
// We need the inverse of the inverse transpose
source->getInverseTransposeWorldMatrix().inverse().extract3x3Matrix(m3);
vec3 = m3 * source->getLightDirection(i->data);
vec3.normalise();
// Set as 4D vector for compatibility
_writeRawConstant(i->physicalIndex, Vector4(vec3.x, vec3.y, vec3.z, 0.0f), i->elementCount);
break;
(A^-1)^t = (A^t)^-1
((A^-1) ^t)^-1 = ((A^t)^-1)^-1 = A^t
so :
source->getInverseTransposeWorldMatrix().inverse() is just the same as source->getTransposeWorldMatrix()
This also happens for case ACT_LIGHT_DIRECTION_OBJECT_SPACE_ARRAY