Add CAABox::intersectionRadius()

This commit is contained in:
Jack Andersen 2017-03-06 19:34:54 -10:00
parent 505696e4a3
commit 11ba10b557
1 changed files with 6 additions and 0 deletions

View File

@ -106,6 +106,12 @@ public:
return distanceFromPointSquared(other.position) <= other.radius * other.radius;
}
float intersectionRadius(const CSphere& other) const
{
float dist = distanceFromPoint(other.position);
return (dist < other.radius) ? dist : -1.f;
}
inline CAABox booleanIntersection(const CAABox& other) const
{
CVector3f minVec = CVector3f::skZero;