How will I use this code (posted by JP)
but instead use the current direction of the camera?core::vector3df direction = (endPos - startPos).normalize; // unit vector in the direction it should travel
fireball->setPosition(fireball->getPosition() + direction * FACTOR); // add on the unit direction to the current position and multiply it by FACTOR
I am using a completely flat surface now (collisions with mesh got out of hand) and just want to create a 3d projectile ( a box, in this instance) to shoot out from the camera and fly in whatever direction the camera is pointing at. I don't want it to stop for some reason (like the code I have now) and just want it to KEEP going (until draw distance hit). I also need to be able to implement it in my current code, and use it upon a keypress (already implemented keypress). If you want to look at my current code. just ask. I will use collision detection with the cube as well (should be do-able).
If I (you ) can get this working, next I will attempt to use a crosshair for aiming.
Thanks.