Whether placed shapes (Cauldron2D.Shape) touch each other, a point, a rectangle, a
circle or a line.
Two shapes overlap when some world pixel's centre, {x + 0.5, y + 0.5}, lies inside
both. A rectangle query is a shape like any other; a circle covers the pixel centres
within its radius; a line is sampled every half pixel along its length, both ends
included.
Cauldron2D.Overlap.shapes?(player, wall)
Cauldron2D.Overlap.line?(wall, {0, 10}, {200, 10})
Summary
Functions
Whether shape shares a pixel with the circle of radius around {x, y}.
Whether the segment from from to to passes through shape.
Whether the world point {x, y} is inside shape.
Whether shape shares a pixel with the rectangle {left, top, right, bottom}.
Whether first and second share a pixel.
Functions
@spec circle?(Cauldron2D.Shape.t(), {number(), number()}, number()) :: boolean()
Whether shape shares a pixel with the circle of radius around {x, y}.
Whether the segment from from to to passes through shape.
@spec point?(Cauldron2D.Shape.t(), {number(), number()}) :: boolean()
Whether the world point {x, y} is inside shape.
Whether shape shares a pixel with the rectangle {left, top, right, bottom}.
@spec shapes?(Cauldron2D.Shape.t(), Cauldron2D.Shape.t()) :: boolean()
Whether first and second share a pixel.