Garry's Mod Wiki
The navigation mesh library. To be used with CNavArea.
The navigation mesh is used by NextBot to calculate path to its target.
Methods
Add this position and normal to the list of walkable positions, used before map generation with navmesh. BeginGeneration
navmesh.BeginGeneration()
Starts the generation of a new navmesh.
This process is highly resource intensive and it's not wise to use during normal gameplay
navmesh.ClearWalkableSeeds()
Clears all the walkable positions, used before calling navmesh. BeginGeneration.
Creates a new CNavArea.
CNavLadder navmesh.CreateNavLadder( Vector top, Vector bottom, number width, Vector dir, number maxHeightAboveTopArea = 0 )
Creates a new CNavLadder.
Returns a list of areas within distance, used to find hiding spots by NextBots for example.
Returns a list of CNavAreas overlapping the given cube extents.
table navmesh.GetAllNavAreas()
Returns an integer indexed table of all CNavAreas on the current map. If the map doesn't have a navmesh generated then this will return an empty table.
table navmesh.GetBlockedAreas()
Returns a table of all blocked CNavAreas on the current map. See CNavArea:MarkAsBlocked.
Vector navmesh.GetEditCursorPosition()
Returns the position of the edit cursor when nav_edit is set to 1.
Finds the closest standable ground at, above, or below the provided position.
The ground must have at least 32 units of empty space above it to be considered by this function, unless 16 layers are tested without finding valid ground.
CNavArea navmesh.GetMarkedArea()
Returns the currently marked CNavArea, for use with editing console commands.
CNavLadder navmesh.GetMarkedLadder()
Returns the currently marked CNavLadder, for use with editing console commands.
Returns the Nav Area contained in this position that also satisfies the elevation limit.
This function will properly see blocked CNavAreas. See navmesh. GetNearestNavArea.
Returns a CNavArea by the given ID.
Avoid calling this function every frame, as internally it does a lookup trough all the CNavAreas, call this once and store the result
number navmesh.GetNavAreaCount()
Returns the total count of nav areas on the map. If you want to get all nav areas, use navmesh. GetAllNavAreas instead as nav areas IDs are not always sequential.
Returns a CNavLadder by the given ID.
CNavArea navmesh.GetNearestNavArea( Vector pos, boolean anyZ = false, number maxDist = 10000, boolean checkLOS = false, boolean checkGround = true, number team = TEAM_ANY=-2 )
Returns the closest CNavArea to given position at the same height, or beneath it.
This function will ignore blocked CNavAreas. See navmesh. GetNavArea for a function that does see blocked areas.
string navmesh.GetPlayerSpawnName()
Returns the classname of the player spawn entity.
boolean navmesh.IsGenerating()
Whether we're currently generating a new navmesh with navmesh. BeginGeneration.
navmesh.Load()
Loads a new navmesh from the . nav file for current map discarding any changes made to the navmesh previously.
Calling this function too soon, causes the Server to crash!
navmesh.Reset()
Deletes every CNavArea and CNavLadder on the map without saving the changes.
navmesh.Save()
Saves any changes made to navmesh to the . nav file.
navmesh.SetMarkedArea( CNavArea area )
Sets the CNavArea as marked, so it can be used with editing console commands.
navmesh.SetMarkedLadder( CNavLadder area )
Sets the CNavLadder as marked, so it can be used with editing console commands.
navmesh.SetPlayerSpawnName( string spawnPointClass )
Sets the classname of the default spawn point entity, used before generating a new navmesh with navmesh. BeginGeneration.
This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.
Page content is automatically updated twice a day. Edits and history are not available.
Last Parsed: Loading...