In the tech demo, in CDemo.cpp, there is a 'struct' called SParticleImpact. I worked out that this is what is instantiated to make a "shoot" bullet, that fires when you press Space.
These variables are created inside it.
core::vector3df pos;
core::vector3df outVector;
I'm assuming they are to help make the ball travel.
What I want to know is; how are they used?
Also, where is the fireball destroyed?? I can see where it is added to the array; Impacts.push_back(imp); but when is it removed??
Lastly, I got this version of "shoot" working perfectly in my project - a Faerie shoots the bullet billboards from her body when you press space.
But because the bullets use the collision animator to go between 2 points, there's nothing in there for testing collision with a moving object.
So if I want to be able to shoot moving objects, what's the best way to go about doing that?
I was going to iterate through the array of bullets, and test for overlap between all the moving objects.
But 2 things stopped me.
First, I don't really understand where all the bullets are being stored. The only thing I could see is Impacts.push_back(imp); but I wasn't sure if it contains the entire bullet, since there's nothing there about the node variable.
Also, in http://irrlicht.sourceforge.net/phpBB2/ ... php?t=1972
Electron said;
It sounds really cool, and I probably wouldn't need to manage them in an array that way - just deal with them in the callback event they create.I think it would probably be easier to use Newton with projectiles, because one can set a callback for when the bullets collide, rather than having to constantly test them yourself.
Does anyone else agree?