mirror of https://github.com/AxioDL/zeus.git
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:
parent
c5d90a5d5e
commit
61fc6c6fd2
|
@ -9,7 +9,7 @@ public:
|
|||
|
||||
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();
|
||||
return dist < (radius + other.radius);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue