procedurals
Procedural generation building blocks
Loading...
Searching...
No Matches
WaveFunctionCollapse Class Reference

#include <WaveFunctionCollapse.hpp>

Classes

struct  Rules
 User-defined adjacency rules. Tile IDs are indices 0..neighbors.size()-1. neighbors[t] = list of tile IDs allowed next to tile t (any 4-dir). More...
 

Static Public Member Functions

static std::vector< std::vector< int > > collapse (int width, int height, const Rules &rules, uint64_t seed=0)
 Generate a width x height tile map. Best-effort: returns a complete grid even if a few adjacencies end up violating the rules (contradictions are skipped locally).
 

Member Function Documentation

◆ collapse()

static std::vector< std::vector< int > > WaveFunctionCollapse::collapse ( int  width,
int  height,
const Rules &  rules,
uint64_t  seed = 0 
)
inlinestatic

Generate a width x height tile map. Best-effort: returns a complete grid even if a few adjacencies end up violating the rules (contradictions are skipped locally).


The documentation for this class was generated from the following file: