hex-world
    Preparing search index...

    Interface HexUnitOptions

    interface HexUnitOptions {
        col: number;
        row: number;
        travelSpeed?: number;
        heightOffset?: number;
        fogRevealRange?: number;
        surfaceOptions?: CellSurfaceOptions;
        domain?: MovementDomain;
        isLiquid?: (terrain: number) => boolean;
    }
    Index

    Properties

    col: number
    row: number
    travelSpeed?: number

    Cells per second. Default 4.

    heightOffset?: number

    Y offset applied above the terrain surface, in world units. Set to half the model's height when the pivot is at the model center, or a small value (e.g. 0.05) when the pivot is at the model's foot. Default 0.

    fogRevealRange?: number

    BFS fog-of-war reveal radius in cells. 0 = unit does not reveal fog. Default 0.

    surfaceOptions?: CellSurfaceOptions

    Surface height parameters — pass the same values you gave the terrain geometry (elevationScale, noiseScale, elevPerturbStrength) if you customized them, plus an isWater predicate if units should ride the water surface instead of the seabed. Defaults match the default terrain.

    Where this unit can go — see MovementDomain. Informational on the unit itself (the cost function you hand findPath is what enforces it — build one with createDomainCost), but it is what a game reads to pick that cost function, and what the editor and save files carry. Default 'land'.

    isLiquid?: (terrain: number) => boolean

    Which terrains are liquid, for embark/disembark detection and for riding the water surface: when set and surfaceOptions.isWater is not, it is used as that predicate too, so a ship floats at the surface instead of standing on the sea bed. HexWorld.isWater is the usual value.