raycastAll method

List<RaycastResult<ShapeHitbox>> raycastAll(
  1. int numberOfRays, {
  2. Vector2? origin,
  3. double? maxDistance,
  4. double startAngle = 0,
  5. double sweepAngle = tau,
  6. List<Ray2>? rays,
  7. List<ShapeHitbox>? ignoreHitboxes,
})

Implementation

List<RaycastResult<ShapeHitbox>> raycastAll(
  int numberOfRays, {
  Vector2? origin,
  double? maxDistance,
  double startAngle = 0,
  double sweepAngle = tau,
  List<Ray2>? rays,
  List<ShapeHitbox>? ignoreHitboxes,
}) {
  try {
    return gameRef.raycastAll(
      origin ?? rectCollision.center.toVector2(),
      numberOfRays: numberOfRays,
      maxDistance: maxDistance,
      startAngle: startAngle,
      sweepAngle: sweepAngle,
      rays: rays,
      ignoreHitboxes: [
        ...children.query<ShapeHitbox>(),
        ..._getSensorsHitbox(),
        ...ignoreHitboxes ?? [],
      ],
    );
  } catch (e) {
    return [];
  }
}