CSphere: Make intersects() a const member function

This member function doesn't modify instance state, so it can be made
const.
This commit is contained in:
Lioncash 2019-09-01 03:59:24 -04:00
parent c5d90a5d5e
commit 61fc6c6fd2
1 changed files with 1 additions and 1 deletions

View File

@ -9,7 +9,7 @@ public:
CVector3f getSurfaceNormal(const CVector3f& coord) const { return (coord - position).normalized(); } CVector3f getSurfaceNormal(const CVector3f& coord) const { return (coord - position).normalized(); }
bool intersects(const CSphere& other) { bool intersects(const CSphere& other) const {
float dist = (position - other.position).magnitude(); float dist = (position - other.position).magnitude();
return dist < (radius + other.radius); return dist < (radius + other.radius);
} }