Skip to main content

Generator

Trait Generator 

Source
pub trait Generator {
    type Params;

    // Required method
    fn generate(&self, params: &Self::Params, vsid: u32) -> Vxl;
}
Expand description

Procedural world generator. Implementors produce a Vxl from CaveParams (or their own typed parameter struct).

generate is expected to be deterministic in its parameters: the same params + vsid MUST produce a byte-stable Vxl across runs (within the same toolchain — like the rasterizer’s tests, cross-CPU FP determinism is best-effort).

Required Associated Types§

Source

type Params

Parameter type. Most generators alias this to CaveParams.

Required Methods§

Source

fn generate(&self, params: &Self::Params, vsid: u32) -> Vxl

Build a vsid × vsid × MAXZDIM voxel world per params. vsid MUST be a power of two and >= 4 (smaller worlds don’t have room for the central air carve).

Implementors§