intersectsSphere method

bool intersectsSphere(
  1. Sphere sphere
)

Implementation

bool intersectsSphere(Sphere sphere) {
  // Find the point on the AABB closest to the sphere center.
  clampPoint(sphere.center, _vectorBox3);

  // If that point is inside the sphere, the AABB and sphere intersect.
  return _vectorBox3.distanceToSquared(sphere.center) <= (sphere.radius * sphere.radius);
}