sphereCast method
The first thing a sphere of radius swept from origin along
direction hits within maxDistance, or null (a camera keeping out
of walls, a thick bullet).
Implementation
PhysicsHit3D? sphereCast(
Vector3 origin,
double radius,
Vector3 direction, {
double maxDistance = 1000,
int layerMask = 0xFFFF,
Entity? ignore,
bool includeSensors = false,
}) => shapeCast(
SphereShape3D(radius),
origin,
Quaternion.identity(),
direction,
maxDistance: maxDistance,
layerMask: layerMask,
ignore: ignore,
includeSensors: includeSensors,
);