mwg API
    Preparing search index...

    Function heightAt

    • a cell's own height (grid-height units, before heightStep scaling), or null for a world position with no cell at all - a hole in the grid, blocking just like a wall would

      Parameters

      • index: ReadonlyMap<string, number>
      • shape: GridShape3D
      • x: number
      • z: number
      • tileSize: number = 1

      Returns number | null

      import { buildHeightIndex, heightAt } from '@datamoc/mwg/3d';

      const heights = buildHeightIndex([{ x: 0, y: 0, height: 1 }]);
      console.log(heightAt(heights, 'square', 0, 0), heightAt(heights, 'square', 5, 5)); // 1 null