sphereCast method

PhysicsHit3D? sphereCast(
  1. Vector3 origin,
  2. double radius,
  3. Vector3 direction, {
  4. double maxDistance = 1000,
  5. int layerMask = 0xFFFF,
  6. Entity? ignore,
  7. bool includeSensors = false,
})

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,
);