Smooth arrivals at targets with preset deceleration rates

Started by
2 comments, last by Ezbez 13 years, 9 months ago
I have an objects travelling at various velocities. Each of these objects also has an associated deceleration value (so when decelerating, their velocities go down by this deceleration value each physics step).

I want to implement smooth arrivals at targets, but I'm having trouble knowing when the objects should begin their deceleration. I want the objects to decelerate at different rates (that's why they each have their own deceleration value), and so they need to begin decelerating at different times, but I'm having trouble figuring out how to go about calculating these times.

Any reasonably efficient suggestions towards this end? Thanks!
Advertisement
For an object traveling with initial velocity v and constant acceleration a, velocity is defined by this equation:

v = v0 + a * t

where v0 is the initial velocity. Now you know that at the end velocity should be 0.

0 = v0 + a * t

So just solve for t.
I knew it should be simple... Thanks!!
Or if you want to know the distance, rather than time, away to start decelerating:

d = a/2*t^2 + v*t, and
0 = v + a*t, so
t = -v/a

Plug in and solve.
d = a/2*(v/a)^2 + -v*v/a = 1/2 v^2 / a

Just check the algebra.

Edit: Oops wrong sign.

This topic is closed to new replies.

Advertisement