Expand description
The DayZ .nm navmesh set file and its Detour tile layout (spec 8.1, 9 and 7.2).
A .nm file (NavMeshSet) is a header, an offset table and tile records. Each record holds one
Detour tile blob (TileData): standard Detour tile data (version 12, 64-bit polygon refs) with a
4-byte header extension, 44-byte off-mesh connections and a trailing extra section
(TileExtra). All integers and floats are little-endian.
Every reader treats its input as hostile: counts are checked with checked arithmetic against the bytes available before anything is allocated, and errors are returned instead of panics.
Structs§
- BvNode
- A
dtBVNode(16 bytes). - Create
Params - The inputs of
create_tile_data, mirroringdtNavMeshCreateParams. - Link
- A
dtLink(16 bytes). - Mesh
Header - The 104-byte
dtMeshHeaderof a tile (spec 9.3). - NavMesh
- A tiled Detour navigation mesh (
dtNavMesh) with 64-bit polygon references: salt 16 bits, tile 28 bits, polygon 20 bits (spec 8.1). - NavMesh
Params dtNavMeshParamsas stored in the set header.- NavMesh
Set - A
.nmfile: the mesh parameters and the tile records in file order. - Obstacle
- A tree obstacle of the extra section (16 bytes).
- OffMesh
Connection - A DayZ
dtOffMeshConnection(44 bytes). - OffMesh
Input - One off-mesh connection of the input (a jump, climb or ladder link).
- Poly
- A
dtPoly(32 bytes). - SetTile
- One tile record of a set file (spec 9.2).
- Tile
Data - The sections of one Detour tile blob, in file order (spec 9.3).
- Tile
Extra - The extra section of a tile blob (spec 7.2).
- Tile
Part - A
TilePartof the extra section: one object part (16 bytes). - Tile
Part Poly - A
TilePartPolyof the extra section (8 bytes).
Constants§
- NAVMESH_
MAGIC - The tile magic
'DNAV'; the stored bytes areVAND. - NAVMESH_
VERSION - The Detour tile version DayZ uses.
- SET_
MAGIC - The set file magic: the bytes
TESM. - SET_
VERSION - The set version DayZ 1.30 accepts; the only one written.
- SET_
VERSION_ OLD - The set version of DayZ 1.29 and earlier. Same layout; accepted when reading.
Functions§
- create_
tile_ data - Builds one Detour tile (version 12) from a poly mesh, the DayZ way (spec 7.3).
- decode_
poly_ ref - Splits a polygon reference into
(salt, tile, poly). - encode_
poly_ ref - Packs a 64-bit polygon reference:
salt << 48 | tile << 20 | poly(16, 28 and 20 bits; wider values are masked). - find_
nearest_ poly dtNavMeshQuery::findNearestPoly: the polygon of the mesh nearest tocenterwithin the boxcenterplus or minushalf_extents, and the nearest point on it.