Skip to content
Snippets Groups Projects
Commit ec79b2f8 authored by Dennis Mannhart's avatar Dennis Mannhart Committed by Beat Küng
Browse files

ControlMath: don't consider sign when vector length is 0

parent bd37c274
No related branches found
No related tags found
No related merge requests found
......@@ -154,7 +154,7 @@ void constrainPIDu(matrix::Vector3f &u, bool stop_I[2], const float Ulimits[2],
* since we do not know better. (no direction given)
*/
if (u.length() < 0.0001f) {
u = matrix::Vector3f(0.0f, 0.0f, math::sign(u(2)) * Ulimits[1]);
u = matrix::Vector3f(0.0f, 0.0f, -Ulimits[1]);
} else {
u = u.normalized() * Ulimits[1];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment