I have a problem with understanding how a propelled projectile (a projectile with rocket thrusters) would act. I'm building a simple simulation for projectiles (something like: https://en.wikipedia.org/wiki/Projectile_motion#/media/File:Mplwp_ballistic_trajectories_velocities.svg) - you shoot a projectile at a certain angle and it should build up velocity from acceleration.
The way that i am currently approaching this problem is:
- Calculate the gravity vector (
mass * gravity), facing down - Calculate the thrust vector (this is just an input value, that is converted to a vector at certain rotation, i was also trying to use Tsiolkovsky Rocket Equation here, but also same result)
- Calculate the drag vector (
1/2 * air density * (velocity^2) * drag coefficient * area), which is facing the exact opposite of current movement - Calculate the acceleration (
adding up the three vectors / mass) - Calculate the velocity/position change (
acceleration * timestep), reduce fuel.
Now, after doing said process im getting really weird results (rocket not flying at all, or speeding up really fast, even when thrust is big), is there something wrong with my steps?