Force

A common way to change the velocity of something is to apply a force to it. This force will produce an acceleration, in accordance with Newton's second law of motion:

            Force = Mass * Acceleration

which means that the acceleration of an object is proportional to the force applied to the object, and the object's mass.

Acceleration is just the change in an object's velocity over time.
If velocity is represented as a vector, then we can also use a vector for acceleration (and for force).

E.g., the vector (0, -9.8, 0) could represent an acceleration of 9.8 meters/second/second due to gravity.

Then, we can compute the velocity V as a function of acceleration and time, in the same way as we computed position as a function of velocity and time.

For a constant acceleration:

            V(t) = V0 + t * A

For a frame-by-frame approximation, of a possibly varying acceleration:

      V(t1) = V(t0) + (t1 - t0) * A

The basic code for moving an object would then look like:

        A = computeCurrentAcceleration()
        V = V + dt * A
        P = P + dt * V

Example: gravbounce.cpp