A solid shape placed in world pixels, for collision.
form is {:rectangle, width, height}, every pixel solid, or {:mask, mask}, the
solid pixels of a Cauldron2D.Mask. It is placed as a picture is drawn by
Cauldron2D.Blend.draw/6: its origin lands on position, scaled per axis by
scale (negative mirrors) and turned by angle degrees counter-clockwise.
shape = Cauldron2D.Shape.new({:mask, mask}, {120, 88}, origin: {9, 28}, scale: {-1, 1})
Cauldron2D.Shape.contains?(shape, {121.5, 80.5})A world point is inside the shape when the shape's pixel it falls on is solid; a
pixel covers [x, x + 1) by [y, y + 1) of the shape's own pixels.
Summary
Functions
The world rectangle {left, top, right, bottom} the shape lies within; nil for a
shape scaled to nothing.
Whether the world point {x, y} is inside the shape.
form placed at position, with :origin, :scale and :angle as above.
Types
Functions
The world rectangle {left, top, right, bottom} the shape lies within; nil for a
shape scaled to nothing.
Whether the world point {x, y} is inside the shape.
form placed at position, with :origin, :scale and :angle as above.