Basic Design Quesion: player's velocity for projectiles?

pra

08-09-2008 19:50:08

This is actually a general game design question, but there is a part about OgreNewt, too:

If the player (or some other character) shoots a projectile (arrow, missile, whatever), should it have the velocity of the player added to it's own?
For Example, i'm walking sideways with constant velocity, and shoot. From my point of view, should the missile stay in the center of my screen, or should it move away?
In vacuum the answer is clear, but how is it with air? I have no idea about aerodynamics, would air compensate this additional velocity?

If air does affect this: I still want to prevent the player from running into his own missiles, so I would like to add the parallel component of his velocity to the missiles velocity. How could I extract this component?

BardockSSJ

08-09-2008 23:31:04

To prevent player running into his missiles you could do that. But i think it is pointless, when arrows/missles are very fast. You can simulate them by simple raycasting. If you plan rocket-lanucher (relativly slow missiles) you have many ways:
- spawn missile near the player instead of creating it inside the player collision model
- ignore all collisions player-missile in material pair callback
- use your method - but I don't think it will help - i.e. stopped player shoots (velocity 0) and now runs - so you are not able to predict the player velocity..

But you should use your method when you are making i.e. space shutter, where the missilies have velocity comparable to ship or less.