X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FSphere.hh;h=319a3ae24a32b5a36b5d130134fc5bfca5e915aa;hp=d6903564eac5309c59f6f793eef60e8ea0c0844b;hb=8a1acac01b444dccf8b57cedf08392ada2e473c1;hpb=bffc879fc8ee8167bb123310d39fad4e2f426ffd diff --git a/src/Moof/Sphere.hh b/src/Moof/Sphere.hh index d690356..319a3ae 100644 --- a/src/Moof/Sphere.hh +++ b/src/Moof/Sphere.hh @@ -75,6 +75,13 @@ struct Sphere : public Cullable, public Drawable }; +inline bool checkCollision(const Sphere& a, const Sphere& b) +{ + Scalar d = (a.point - b.point).length(); + return d < (a.radius + b.radius); +} + + } // namespace Mf #endif // _MOOF_SPHERE_HH_