Arrow behavior
by Peter Daunt · in Technical Issues · 03/11/2007 (9:44 am) · 1 replies
Hi.
I'm starting with TGE and have some questions.
How can I add a real arrow behaviour, i mean gravity, the wind affect, bouncing off the concrete or stuck into wood or sth?
I'm starting with TGE and have some questions.
How can I add a real arrow behaviour, i mean gravity, the wind affect, bouncing off the concrete or stuck into wood or sth?
Torque Owner Ishbuu
Arrow behavior is interesting, i'll assess them piece by piece.
Gravity is already in the engine for projectile objects (look at the gravityMod and isBallistic in the projectile DB). They also have drag, slowing them over time, while its not very noticeable as they're aerodynamic, adding that may or may not be useful.
Wind has an effect on the arrows. I can't post the exact source here, being a public thread, but look at Precipitation::getWindVelocity, and adapt it to the Projectile class (copy/paste add it to header, and modify the class from Precipitation to Projectile). Your other questions are a bit more pressing. How you differentiate between wood and concrete is a discussion thats best left for an engine owners thread, I'll suggest you repost there so we could be of more help.