I also worked on trajectory plannings of static objects. I sat down and wrote out the physics equations to get the trajectories to work the way I would want them to. I was able to add constraints to the trajectory of objects using a cubic interpolation. The equation I came up with to make smooth transitions used the constraints:
- Initial Position = q_0
- End Position = q_1
- Initial Velocity = End Velocity = 0
- Time Table = 0 .. 1
- Position at time 0.5 = (q_0 + q_1)/2
- Acceleration at time 0.5 = 0
The final equation solving for these constraints is:
q(t) = q_0 + (q_1 - q_0(3t^3 - 2t^3)
I'm excited to use these next few days to make dynamic moving objects in the game using this equation inside of the game.
No comments:
Post a Comment