Ok so consider we have a vehicle like the one I described in my answer to this question, with a 2D position, velocity, angular velocity, and drag/friction. It can accelerate and break by a variable amount, but not stop dead instantly or reach top speed instantly. How can I make it move to a particular point and stop - in the fastest time possible - without overshooting or oscillating?
I was thinking something like:
- turn towards target position.
- accelerate
- look 1 tick ahead, asking "If I applied the breaks next tick, would I overshoot the target?"
- If it would overshoot, apply the breaks now by some amount.
I'm sure this is a solved problem and there is a probably a better method than the one I described.
No comments:
Post a Comment