Base: [skip ci] add method to check for null vector
This commit is contained in:
@@ -416,6 +416,13 @@ Vector3<_Precision> & Vector3<_Precision>::Normalize (void)
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <class _Precision>
|
||||
bool Vector3<_Precision>::IsNull() const
|
||||
{
|
||||
_Precision n{0.0};
|
||||
return (x == n) && (y == n) && (z == n);
|
||||
}
|
||||
|
||||
template <class _Precision>
|
||||
_Precision Vector3<_Precision>::GetAngle (const Vector3 &rcVect) const
|
||||
{
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user