use a stricter tolerance to check for equal points

add method IsEqual to Vector3 class to support user-defined tolerance
This commit is contained in:
wmayer
2016-08-15 14:09:26 +02:00
parent e2345374ca
commit aea769af3d
9 changed files with 70 additions and 28 deletions

View File

@@ -204,7 +204,13 @@ bool Vector3<_Precision>::operator == (const Vector3<_Precision>& rcVct) const
return (fabs (x - rcVct.x) <= traits_type::epsilon()) &&
(fabs (y - rcVct.y) <= traits_type::epsilon()) &&
(fabs (z - rcVct.z) <= traits_type::epsilon());
}
}
template <class _Precision>
bool Vector3<_Precision>::IsEqual(const Vector3<_Precision> &rclPnt, _Precision tol) const
{
return Distance(*this, rclPnt) <= tol;
}
template <class _Precision>
Vector3<_Precision>& Vector3<_Precision>::ProjectToPlane (const Vector3<_Precision> &rclBase,