Game Development Community

Creating an Explosion in Projectile.cc

by Matt "Mr. Pig" Razza · in Torque Game Engine · 02/04/2006 (1:00 pm) · 2 replies

I am trying to create an explosion in Projectile.cc before the projectile hits the ground. I can call the explode function at the right time but because the projectile isn't hitting with anything I can't cast a ray to get the information the explode function needs. Any ideas?

#1
02/04/2006 (2:39 pm)
IIRC the explode function wants a Point3F& position, a Point3F& collision normal, and a U32 collision type ID. If you're exploding the projectile in mid air, the normal and type id are irrelevant. Just pass it the correct position, and fill in default values for the rest. Like:
Point3F up(0,0,1);
explode(mCurrPosition, up, 0);
#2
02/04/2006 (2:43 pm)
I didn't see an explosion when I tried that before. I'll try again, maybe I did something wrong.