raycastShape static method

RaycastHit<Shape>? raycastShape(
  1. Ray ray,
  2. Shape shape
)

Implementation

static RaycastHit<Shape>? raycastShape(Ray ray, Shape shape) {
  if (shape is Circle) return raycastCircle(ray, shape);
  if (shape is AABB) return raycastAABB(ray, shape);
  if (shape is Line) return raycastLine(ray, shape);
  return null;
}