libgdx / gdx-ai

Artificial Intelligence framework for games based on libGDX or not. Features: Steering Behaviors, Formation Motion, Pathfinding, Behavior Trees and Finite State Machines
Apache License 2.0
1.18k stars 241 forks source link

Do not let the predicted position affect steering. #68

Closed Reloecc closed 8 years ago

Reloecc commented 8 years ago

While predicting, steering.linear is set from current position, leaving the agent to follow a direction away from 0,0[,0]. Especially visible when dealing with a zero flowVector if linear acceleration calculation is skipped. Clearing a steering after the flowField.lookup does the right thing, I believe.

davebaol commented 8 years ago

Good catch! Thanks