Game Development Community

Scaled Vehicles Shadows Issue

by Kirk Haynes · in Torque Game Engine · 12/04/2006 (3:57 pm) · 3 replies

I'm making a street car racing game. I've recently moved from 1.4 to 1.5. I tried to scale the vehicle and noticed that only the body scaled.

I added the following in WheeledVehicle::renderImage

just after dglMultMatrix( &getRenderTransform());


glScalef( mObjScale.x, mObjScale.y, mObjScale.z); // KWH 20061108


And that fixed the mounted object scaling.

Shadows still are drawn unscalled. I followed the code path into the lighting kit, and it seems shadows are handled in there now.


Any idea what it would take to scale the wheeled vehicle shadows for a car as well?

#1
12/04/2006 (9:17 pm)
Sounds like a bug. Try changing line 342 in sgObjectShadows.cc from:

shadow->renderToBitmap(wheel->shapeInstance, m, pos, Point3F(1,1,1));

To:

shadow->renderToBitmap(wheel->shapeInstance, m, pos, scale);

Let me know if that helps.
#2
12/05/2006 (7:57 am)
Thank you John.

Yes, that helps.

I guess the cars (from a car pack) and buggy (default) aren't set up to scale, because they float above the ground. The wheel shadows are noticably 'detached' from the body shadow. But for the most part, they scale now.
#3
12/05/2006 (8:12 am)
Cool all fixed in svn - next release this change will be in.