Expand description
Wave Function Collapse
Provides an implementation of the wave function collapse algorithm.
Wave function collapse works by iteratively “collapsing” a collecion of cells (such as a square grid) from all possible states to only the states possible with a given ruleset, selecting randomly where ambiguous.
Modules§
Traits§
- AllState
- Describes states which have a known “All-possibilities” state
- Collapse
Rule - Collapse rules define the relationships between a cell’s possible state based on it’s neighbors.
- Invert
Delta - Represents coordinate deltas which have an inverse - the delta which undoes the change represented by this delta.
- SetState
- Represents set-like states
- Space
- Defines the space or “world” to run WFC on.
- State
- Cell state - represents all possible states a cell can take on
Functions§
- collapse
- Perform the wave function collapse algorithm on a given state-space with the provided collapse rule.