diff --git a/src/Base/Vector3D.cpp b/src/Base/Vector3D.cpp index 03920ed72d..98abe07092 100644 --- a/src/Base/Vector3D.cpp +++ b/src/Base/Vector3D.cpp @@ -416,6 +416,13 @@ Vector3<_Precision> & Vector3<_Precision>::Normalize (void) return *this; } +template +bool Vector3<_Precision>::IsNull() const +{ + _Precision n{0.0}; + return (x == n) && (y == n) && (z == n); +} + template _Precision Vector3<_Precision>::GetAngle (const Vector3 &rcVect) const { diff --git a/src/Base/Vector3D.h b/src/Base/Vector3D.h index 13651fc49a..feb3c58aae 100644 --- a/src/Base/Vector3D.h +++ b/src/Base/Vector3D.h @@ -161,6 +161,8 @@ public: _Precision Sqr (void) const; /// Set length to 1. Vector3 & Normalize (void); + /// Checks whether this is the null vector + bool IsNull() const; /// Get angle between both vectors. The returned value lies in the interval [0,pi]. _Precision GetAngle (const Vector3 &rcVect) const; /** Transforms this point to the coordinate system defined by origin \a rclBase,