Quote:Original post by ExcessNeo
Mr. Accident Acceleration is constant yes being -9.81m/s/s however you can't just decide to end acceleration mid-air until you have reached terminal velocity, rip-off's example is a bit strange though having another look.
But either way, gravitational acceleration should be subtracted from
velocity, not the player's acceleration. If you subtract 9.81m/s^2 from the player's acceleration every frame, it is no longer an acceleration constant, but a jerk constant. Not counting air resistance, gravitation produces a constant acceleration, so the player's acceleration should not change unless another force acts upon them (for example, the ground).
For simple jumping physics, air resistance isn't going to be a significant factor. But if you did want to add it to your model, you wouldn't do it by subtracting
g from the object's acceleration every frame; for a decent approximation you could introduce an opposing force that scales linearly with the velocity of the object, and just add that to the gravitational acceleration vector to determine the object's acceleration at any given time.