intersectsSphere method

bool intersectsSphere(
  1. BoundingSphere sphere
)

Implementation

bool intersectsSphere(BoundingSphere sphere) {
  final planes = this.planes;
  final center = sphere.center;
  final negRadius = -sphere.radius;

  for (int i = 0; i < 6; i++) {
    final distance = planes[i].distanceToPoint(center);
    if (distance < negRadius) {
      return false;
    }
  }

  return true;
}