I asked this question (as a reply) before here:
http://www.gamedev.net/topic/636970-shooting-accuracy/
But I think this question should be separated since it's not related to the accuracy.
In real life the bullet will arrive to the target based on the speed and distance.
So, I'm trying to find a way to delay the bullet arrival time for certain amount of time in milliseconds (depends on how far is the target).
The following should do the trick but definitely it will not only delay the bullet arrival but it will delay rendering as well:
while(...)
{
// Delay until the bullet arrive (based on the bullet speed and the distance)
}
// SHOOT
Raycasting(...);
Maybe I can create a thread for shooting and do the above code in that thread then use a callback method to get the shooting result?
I need suggestion on what is the best way to do it without affecting the rendering, BTW I'm using a single method that I call for shooting and it should get me the shooting results every time I call it.