threejs-worldgen
    Preparing search index...

    Class GridEnvironment

    A usable band sampled on a small square grid (e.g. riverbed and water surface around a school's home). Conservative: each cell's floor is the highest of its four corners, its top the lowest, and a cell is usable only if all four corners are and the band is at least minThickness thick. Outside the grid is an obstacle, so flocks never wander off what was sampled.

    Implements

    Index
    • Builds the conservative per-cell bands from per-sample floors and tops.

      Parameters

      • x0: number

        World x of the grid's first corner.

      • z0: number

        World z of the grid's first corner.

      • cell: number

        Cell size, metres.

      • n: number

        Samples per side (cells per side + 1).

      • floors: ArrayLike<number>

        Floor at each sample (row-major, n × n); NaN where unusable.

      • tops: ArrayLike<number>

        Top at each sample; NaN where unusable.

      • minThickness: number

        Thinnest usable band.

      Returns GridEnvironment

    cell: number

    Cell size, metres.

    cells: number

    Cells per side.

    floor: Float64Array

    Per-cell floor (row-major, z then x). NaN = obstacle.

    top: Float64Array

    Per-cell top.

    x0: number

    World x of the grid's first corner.

    z0: number

    World z of the grid's first corner.