intersectsSphere method

dynamic intersectsSphere(
  1. dynamic sphere
)

Implementation

intersectsSphere(sphere) {
  // find the point on the OBB closest to the sphere center

  this.clampPoint(sphere.center, closestPoint);

  // if that point is inside the sphere, the OBB and sphere intersect

  return closestPoint.distanceToSquared(sphere.center) <=
      (sphere.radius * sphere.radius);
}