henad-core 0.3.0

Model authoring traits, primitives and shared types of Henad, a parallel agent-based modelling engine.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
#define_import_path henad::dims

// Grid size and the display texture size. The two sizes differ once the grid outgrows the texture cap,
// so a display pass reads the cell at `texel * grid / tex`.
struct Dims {
    grid: vec2<u32>,
    tex: vec2<u32>,
}

// Cell a display texel samples. Identity while the grid still fits the texture.
fn cell_at(texel: vec2<u32>, dims: Dims) -> vec2<u32> {
    return texel * dims.grid / dims.tex;
}