# Smooth arrivals at targets with preset deceleration rates

This topic is 3084 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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!

##### Share on other sites
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.

##### Share on other sites
I knew it should be simple... Thanks!!

##### Share on other sites
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.

1. 1
2. 2
Rutin
19
3. 3
khawk
18
4. 4
5. 5
A4L
11

• 9
• 12
• 16
• 26
• 10
• ### Forum Statistics

• Total Topics
633768
• Total Posts
3013753
×

## Important Information

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!