Game Development Community

Another getAmbient

by John Kabus (BobTheCBuilder) · in Torque Game Engine · 01/03/2004 (12:13 am) · 1 replies

Another getAmbient... fix

I checked this one out I promise. ;)

Anyway if you are having issues with players not retrieving the correct lighting info from interiors and your problem interiors are scaled here's the fix:

SceneObject.cc (approximately line 1849):

// project the collision point into object space
               instance->getWorldTransform().mulP(collision.point);

               PlaneF plane = interior->getPlane(surface.planeIndex);
               if(Interior::planeIsFlipped(surface.planeIndex))
                  plane.neg();

add:

// project the collision point into object space
               instance->getWorldTransform().mulP(collision.point);
               [b]collision.point.convolveInverse(instance->getScale());[/b]

               PlaneF plane = interior->getPlane(surface.planeIndex);
               if(Interior::planeIsFlipped(surface.planeIndex))
                  plane.neg();

The projected collision point was not taking into account the interior's scale.

And yes I will eventually send Tim an email. :) As soon as the laundry list is complete. ;)

John.

#1
01/03/2004 (6:25 pm)
A little clarification is in order. This resolution is for the method SceneObject::getLightingAmbientColor.