Projectile velocity correction to always hit stationary spot
Hey there. I have an issue I'm struggling to internalize, and I'd like you to coin in on it.
I have a projectile that moves at a set velocity vector, a point I know it is going to hit if it moves with said velocity vector, even an arc displaying the trajectory. The issue is - before the projectile actually starts travelling, it can move. It must, in fact - because it's moving out of your hand in VR. So between the moment I have the end point and velocity calculated and the point the projectile starts moving at that velocity, it is guaranteed to change initial launch spot, which of course means that it's guaranteed to miss the target.
I need an algorithm that will correct the projectile's velocity vector once it does move so that the end point of travel is always going to be the end point calculated earlier, before it starts travelling.
The question is: how the hell do I do that? Predicting end point of a stationary projectile is easy, ensuring it seems a little out of my grasp.
(If anyone's interested, I calculate the end point by launching a ghost projectile and simulating its movement in a separate physics scene, so if that can be hijacked further, that's an idea)
It doesn't have to be velocity that changes if converting it to something else will result in a desired outcome.