Class NavMeshFile
Namespace: ValveResourceFormat.NavMesh
Assembly: ValveResourceFormat.dll
Represents a navigation mesh file.
public class NavMeshFileInheritance
Fields
MAGIC
Magic number for navigation mesh files.
public const uint MAGIC = 4277009102Field Value
NoMovableMesh
The value of areas that belong to the static world.
public const uint NoMovableMesh = 4294967295Field Value
Properties
Areas
Gets the navigation mesh areas indexed by area ID.
public Dictionary<uint, NavMeshArea> Areas { get; }Property Value
CustomData
Gets or sets custom data associated with the navigation mesh, only stored when is not zero.
public KVDocument? CustomData { get; set; }Property Value
KVDocument?
Remarks
Counter-Strike 2 stores its bot analysis here, as an arealist array parallel to the areas in file order. Its hidingspotdata is also read into . The area and spot ids in spotencounterdata and order are written from runtime pointers and are not valid ids.
ExtraGenerationParams
Gets or sets extra generation parameters stored as NavGenParams.HullParams, which are also read into
public KVDocument? ExtraGenerationParams { get; set; }Property Value
KVDocument?
GameData
Gets or sets game specific data. Only stored in version 36 and newer.
public KVDocument? GameData { get; set; }Property Value
KVDocument?
Remarks
No known game uses this, files contain an empty table.
GenerationParams
Gets the generation parameters.
public NavMeshGenerationParams? GenerationParams { get; }Property Value
HasUnnamedAreas
Gets whether the navigation mesh contains areas without a place name.
public bool HasUnnamedAreas { get; }Property Value
IsAnalyzed
Gets whether the navigation mesh has been analyzed.
public bool IsAnalyzed { get; }Property Value
Ladders
Gets the ladders in the navigation mesh.
public NavMeshLadder[] Ladders { get; }Property Value
MovableMeshGravityFollowsRotation
Gets whether gravity follows the rotation of each movable nav mesh, parallel to . Read from , so only stored in version 36 and newer.
public bool[] MovableMeshGravityFollowsRotation { get; }Property Value
bool[]
MovableMeshIds
Gets the ids of the movable nav meshes stored in this file. Only stored in version 35 and newer.
public string[] MovableMeshIds { get; }Property Value
string[]
Remarks
Each id is a list of integers separated by colons.
MovableMeshSettings
Gets or sets the movable mesh settings, such as . Only stored in version 36 and newer.
public KVDocument? MovableMeshSettings { get; set; }Property Value
KVDocument?
MovableMeshTransforms
Gets the transform of each movable nav mesh, parallel to .
public Matrix4x4[] MovableMeshTransforms { get; }Property Value
PlaceNames
Gets the place names stored in the place directory of this file.
public string[] PlaceNames { get; }Property Value
string[]
SubVersion
Gets or sets the sub-version.
public uint SubVersion { get; set; }Property Value
TransformedBounds
Gets the transformed bounding boxes stored in this file.
public NavMeshTransformedBounds[] TransformedBounds { get; }Property Value
Version
Gets or sets the file version.
public uint Version { get; set; }Property Value
Methods
GetArea(uint)
Gets a navigation mesh area by its identifier.
public NavMeshArea? GetArea(uint areaId)Parameters
areaId uint
Returns
GetHullAreas(byte)
Gets all navigation mesh areas for the specified hull index.
public List<NavMeshArea>? GetHullAreas(byte hullIndex)Parameters
hullIndex byte
Returns
Read(string)
Reads the navigation mesh from a file.
public void Read(string filename)Parameters
filename string
Read(Stream)
Reads the navigation mesh from a stream.
public void Read(Stream stream)Parameters
stream Stream
Read(BinaryReader)
Reads the navigation mesh from a binary reader.
public void Read(BinaryReader binaryReader)Parameters
binaryReader BinaryReader
ToString()
Returns a string that represents the current object.
public override string ToString()Returns
A string that represents the current object.
Remarks
Returns a formatted summary of the navigation mesh including version, area count, and generation parameters.

