diff --git a/libraries/AP_Math/vector2.h b/libraries/AP_Math/vector2.h index e87ac40fcd..ba00110a3f 100644 --- a/libraries/AP_Math/vector2.h +++ b/libraries/AP_Math/vector2.h @@ -31,7 +31,7 @@ struct Vector2 T x, y; // trivial ctor - Vector2() {memset(this, 0, sizeof(*this));} + Vector2() { x = y = 0; } // setting ctor Vector2(const T x0, const T y0): x(x0), y(y0) {} diff --git a/libraries/AP_Math/vector3.h b/libraries/AP_Math/vector3.h index 214928896a..35c375917a 100644 --- a/libraries/AP_Math/vector3.h +++ b/libraries/AP_Math/vector3.h @@ -51,7 +51,7 @@ public: T x, y, z; // trivial ctor - Vector3() {memset(this, 0, sizeof(*this));} + Vector3() { x = y = x = 0; } // setting ctor Vector3(const T x0, const T y0, const T z0): x(x0), y(y0), z(z0) {}