sphereOverlapsSphere function Physics
Whether the closed ball at center of radius overlaps a sphere of
otherRadius centered at otherCenter.
Implementation
bool sphereOverlapsSphere(
Vector3 center,
double radius,
Vector3 otherCenter,
double otherRadius,
) {
final sum = radius + otherRadius;
return (center - otherCenter).length2 <= sum * sum;
}