Projectile Shadows
by Faraz Ahmed · in Torque Game Engine · 01/24/2006 (5:32 am) · 2 replies
Hi, is there a quick method for enabling projectile shadows? I am using the lighting pack but projectiles are not casting shadows. If the engine code needs modification, it would be great to have some general directions to the nature of changes required (in projectile.cc I suppose) before I start breaking everything in the code!
Thanks.
Thanks.
#2
Static shapes use the void ShapeBase::renderShadow(F32 dist, F32 fogAmount) in sgShadow.cc.
Simply replicate this function for projectiles, i.e., Projectile::renderShadow(F32 dist, F32 fogAmount) in sgShadow.cc. Remove the bit of code in the function that handles shapebase mounts and the rest is done by compiler errors which guide you as to what needs to be included in projectile.h and the couple of variables that need renaming.
Also note that the 'shadowLen' variable in the function determines how far the ground or target object can be for the system to create a shadow. It is set to a small amount so pump it up if you want floaters at a distance above the ground to cast shadows.
Cheers.
01/24/2006 (9:39 pm)
Its for a game that involves a relatively slow moving ball that stays along the ground mostly. I have the projectile shadows working now:Static shapes use the void ShapeBase::renderShadow(F32 dist, F32 fogAmount) in sgShadow.cc.
Simply replicate this function for projectiles, i.e., Projectile::renderShadow(F32 dist, F32 fogAmount) in sgShadow.cc. Remove the bit of code in the function that handles shapebase mounts and the rest is done by compiler errors which guide you as to what needs to be included in projectile.h and the couple of variables that need renaming.
Also note that the 'shadowLen' variable in the function determines how far the ground or target object can be for the system to create a shadow. It is set to a small amount so pump it up if you want floaters at a distance above the ground to cast shadows.
Cheers.
Torque 3D Owner Jonathon Stevens