raytrace method

Iterable<RaycastResult<ShapeHitbox>> raytrace(
  1. Ray2 ray, {
  2. int maxDepth = 10,
  3. List<ShapeHitbox>? ignoreHitboxes,
})

Implementation

Iterable<RaycastResult<ShapeHitbox>> raytrace(
  Ray2 ray, {
  int maxDepth = 10,
  List<ShapeHitbox>? ignoreHitboxes,
}) {
  try {
    return gameRef.raytrace(
      ray,
      maxDepth: maxDepth,
      ignoreHitboxes: [
        ...children.query<ShapeHitbox>(),
        ..._getSensorsHitbox(),
        ...ignoreHitboxes ?? [],
      ],
    );
  } catch (e) {
    return [];
  }
}