Shooting A Projectile Help

yellowmonsta

17-03-2009 12:43:48

Hi there.. my game is as such:

A car travelling on the z direction
Use the mouse to move the car left and right on the X direction
I have used NxOgre to shoot a physics object from the car node...

There's a moving mouse target cursor...
How would I go about making my physics object shoot at the direction of where i point the target cursor?

Thanks a lot :)

nargil

17-03-2009 14:48:46

raycast

spacegaier

17-03-2009 14:50:29

The first thing that comes to my mind: Basically like RayCasting (OgreRaycastingTutorial).

Get the position of your cursor and the position of your camera and the resulting vector between them should be the vector that you should use to apply as a force to your projectile. Not totally sure, but probably worth a try...