0

Hi I'm doing a bit of mobile phone game development using a physics engine and have come across a mathematics problem thats stumped me.

basically

object A has a velocity vector of dx:0, d:300

object B has a velocity vector of dx:0, dy:300

object A leads object B by 200 points

something happens to object B and its velocity reduces to dx:0 dy:0

And here is what the problem:

I need to reduce the velocity of object A over time, so that after 0.25 seconds object A has travelled 150 points and its velocity matches that of object B.

I don't know how to calculate by how much I should reduce the velocity of object A for any point of deltaTime.

If it was straight interpolation then I can get it but because the changing velocity changes the distance and keeping it the 0.25 seconds I'm stuck!

I really hope this problem makes sense and some one can either show or just direct me to what I need to learn to figure this out

BR

Danny

hoboBob
  • 143
  • Are you looking for a constant acceleration? Do you want $A$ to move in a straight line? Will the objects always begin on parallel paths as in your example? – amd May 04 '20 at 21:34
  • No the acceleration varies over time, its nearly like I'm trying to differentiate acceleration with respect to the distance travelled but I'm not sure. And without pouring over countless maths notes from uni, I'm a little stuck. I can't really explain it better then above either. The objects are not always parallel though. Object B can have a positive and negative dx component. Object A (A camera!) will always have dx:0, dy:+. – hoboBob May 04 '20 at 21:51
  • Actually a constant acceleration would do it. As long as I can find the value for any point in delta time, which it takes to decelerate to 0, while moving 150 points, in 0.25 seconds. yes A always moves in a straight line – hoboBob May 04 '20 at 21:54

0 Answers0