samspade
Member
I have a decent vector based steering behavior library and I'm trying to tie the image angle (top down 2d) to the directional input provided by the steering behaviors but not the objects overall velocity.
For example, lets say the object wants to seek the mouse. The image angle should be equal to the direction of its velocity. However, if I add wind blowing perpendicular to the object the objects final velocity will no longer be directly towards the mouse (or the true seek velocity) as the wind will be pushing it. However, I still want the image angle to be following the true seek velocity - e.g. the directly the object would be heading in sans wind.
This is even more complicated because steering behaviors are capped - e.g. there's only so much thrust an object can apply towards 'its' desired direction (where that could be player or ai controlled) but outside forces have no such cap (e.g. wind, gravity, etc.).
I feel like this is a simple problem and I am missing an obvious solution, but I haven't been able to figure out a method that works.
Combining all forces gives the correct movement direction, but incorrect image angle and its capped, separating steering and other forces gives a correct imagine angle but incorrect movement as the forces don't cancel each other out.
How do I:
For example, lets say the object wants to seek the mouse. The image angle should be equal to the direction of its velocity. However, if I add wind blowing perpendicular to the object the objects final velocity will no longer be directly towards the mouse (or the true seek velocity) as the wind will be pushing it. However, I still want the image angle to be following the true seek velocity - e.g. the directly the object would be heading in sans wind.
This is even more complicated because steering behaviors are capped - e.g. there's only so much thrust an object can apply towards 'its' desired direction (where that could be player or ai controlled) but outside forces have no such cap (e.g. wind, gravity, etc.).
I feel like this is a simple problem and I am missing an obvious solution, but I haven't been able to figure out a method that works.
Combining all forces gives the correct movement direction, but incorrect image angle and its capped, separating steering and other forces gives a correct imagine angle but incorrect movement as the forces don't cancel each other out.
How do I:
- limit the steering force
- cap the steering velocity
- tie image angle to steering velocity angle
- but have no limit on outside forces
- and no cap on final velocity