From bdda11b32732c58266c1134d463832666ba706db Mon Sep 17 00:00:00 2001 From: Tom Pittenger Date: Fri, 1 May 2015 22:07:45 -0700 Subject: [PATCH] AP_Math: compiler warning: is_zero special case for vector3.h in a template --- libraries/AP_Math/vector3.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libraries/AP_Math/vector3.h b/libraries/AP_Math/vector3.h index cafa60adff..a00c3fe937 100644 --- a/libraries/AP_Math/vector3.h +++ b/libraries/AP_Math/vector3.h @@ -51,8 +51,10 @@ #define VECTOR3_H #include +#include #include + #if defined(MATH_CHECK_INDEXES) && (MATH_CHECK_INDEXES == 1) #include #endif @@ -154,7 +156,8 @@ public: bool is_inf(void) const; // check if all elements are zero - bool is_zero(void) const { return x==0 && y == 0 && z == 0; } + bool is_zero(void) const { return (fabsf(x) < FLT_EPSILON) && (fabsf(y) < FLT_EPSILON) && (fabsf(z) < FLT_EPSILON); } + // rotate by a standard rotation void rotate(enum Rotation rotation);