Header menu logo Mibo.Raylib

GridOccluders Module

Helpers for generating shadow-casting occluders from grid-based levels.

Types

Type Description

Edge

Flags specifying which edges of a grid cell should generate shadow-casting occluders.

Functions and values

Function or value Description

fromCellGrid isSolid edges grid

Full Usage: fromCellGrid isSolid edges grid

Parameters:
    isSolid : 'T -> bool - Predicate that returns true for solid/obstacle cell contents.
    edges : Edge - Which cell edges may produce occluders (e.g. Edge.Bottom ||| Edge.Left ||| Edge.Right for platformers, Edge.All for top-down).
    grid : CellGrid2D<'T> - The grid to scan.

Returns: Occluder2D[]

Generates Occluder2D line segments for exposed edges of solid cells in a CellGrid2D, filtering to only the requested edges.

isSolid : 'T -> bool

Predicate that returns true for solid/obstacle cell contents.

edges : Edge

Which cell edges may produce occluders (e.g. Edge.Bottom ||| Edge.Left ||| Edge.Right for platformers, Edge.All for top-down).

grid : CellGrid2D<'T>

The grid to scan.

Returns: Occluder2D[]

Type something to start searching.