- Home /
Predicting trajectory using Equations of Motion considering drag & Magnus effect
Hi everyone,
Problem:
Applying velocity to a gameobject such that it hits a target point, considering the objects drag and applied force via magnus effect.
I can currently perfectly predict where the ball is due to go in time, based on a set velocity, rotation speed, drag and resulting magnus effect. This requires calculating the changes in ball speed for drag and applied force from the magnus effect each frame.
I have a function which will return the magnus force to be applied this frame based on the balls speed and rotational speed.
I currently have two methods to set the ball velocity, of which neither consider object drag, nor my applied magnus force, so are not quite accurate with no magnus effect and entirely wrong with magnus effect: Thread 1 and Thread 2.
Question:
How do I calculate the velocity such that it accounts for the objects drag and also the cumulative displacement of the magnus effect over time?
The ball is moved with the calculated velocity with an AddForce Forcemode.Impulse function. The magnus effect is applied per frame with AddForce Forcemode.Force.