Convert normal from object to world space

Properly doing this is a bit more complicated because it has to be normalized and pointing in the right direction. Just applying the inverse of the transform matrix doesn't quite do it.
This commit is contained in:
Eryn Wells 2014-08-20 10:04:38 -07:00
parent cb0933ab51
commit 07e75c663d

View file

@ -88,7 +88,8 @@ Vector4
Object::Normal(const Vector4& p)
const
{
return FromObjectSpace(DoNormal(ToObjectSpace(p)));
Vector4 norm = Transpose(mTranslation) * DoNormal(ToObjectSpace(p));
return norm;
}