Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface TerrainMesh

Represents a decoded terrain mesh used for rendering elevation data.

This structure contains the raw vertex and index buffers necessary to construct a 3D surface mesh, as well as optional per-vertex normals.

Hierarchy

  • TerrainMesh

Index

Properties

Properties

indices

indices: Uint16Array | Uint32Array

Triangle indices defining the mesh connectivity. Each group of three indices forms a triangle, referencing the vertices array.

Use Uint16Array if the number of vertices is ≤ 65535, otherwise Uint32Array.

Optional normals

normals: Float32Array

Optional flat array of per-vertex normals for lighting and shading. The array is structured as [nx0, ny0, nz0, nx1, ny1, nz1, ..., nxn, nyn, nzn].

If not provided, normals can be computed from geometry or defaulted.

vertices

vertices: Float32Array

Flat array of vertex positions in 3D space. The array is structured as [x0, y0, z0, x1, y1, z1, ..., xn, yn, zn].

Coordinate units:

  • x/y are in tile-local pixel space (typically 0 to tileSize, e.g., 0–256)
  • z is in meters above sea level (or relative to a defined datum)

Generated using TypeDoc