Navigation · interface

PolyMesh

Explained in Navigation.

interface PolyMesh
import type { PolyMesh } from '@driftengine/nav';

Properties

NameTypeDescription
verticesreadonlyInt32Arrayx,z per vertex, in cell units. originX, originZ and cellSize turn them into metres.
vertexCountreadonlynumber
polysreadonlyInt32ArraymaxVertsPerPoly slots per polygon, padded with -1.
neighboursreadonlyInt32ArrayThe polygon across each edge, or -1. Same layout as polys: edge i leaves vertex i.
polyCountreadonlynumber
maxVertsPerPolyreadonlynumber
polyRegionreadonlyInt32ArrayWhich region each polygon came from.
originXreadonlynumberWhere the mesh stands, kept with it. The field it was built from knew and the mesh used to drop it, so a query given positions in metres compared them with cell indices and answered in a mixture of the two — invisible to every test that built its field at the origin with one-unit cells, where the two are the same number.
originZreadonlynumber
cellSizereadonlynumber