# Physics Prediction

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

## Recommended Posts

What is the best way to predict a future position of an object. Assuming there is no collusion, We only have damping and it is implemented as velocity*=(1-damping)*time; / this gets called every update time is the delta time between each update. ----- so I do this. distance_to_add =velocity*(1-damping)*time; predictedPos=currentPos+(distance_to_add*time); i just did what the physics lib does in one update. And found the displacement and added to . But it is off. Any help would be super. Thanks

##### Share on other sites
I don't quite understand why you
are using
velocity*=(1-damping)*time

This equation will result in less damping over a longer period of time.
As you think about it by a bigger delta time the velocity will be multiplied
with a bigger value.
I would propose some like this:
velocity*=(1-damping)/(1+time)

This should devide the factor by a value greater than or equal to 1 and
therefor lead to more damping over a longer period of time.

velocity*=power(1-damping,time*factor+1)

This will lead to a similar behavior like above but will damp harder
by increasing delte time. The factor is your own choice to apply your needs.

Assuming your equation the change in the second part would be:
dinstance_to_add=velocity*(1-damping)*time;predictedPos=currentPos+distance_to_add;

You need to multiply velocity by time to get a distance.
Now you want to add this distance but added a distance multiplied by time.
I hope that should have fixed the problem.

1. 1
2. 2
3. 3
4. 4
Rutin
17
5. 5

• 11
• 30
• 12
• 12
• 11
• ### Forum Statistics

• Total Topics
631408
• Total Posts
2999922
×