CNavArea
An object returned by navmesh functions.
Methods
CNavArea:AddAttributes( number attribs )
Adds given attributes to given CNavArea. See CNavArea:HasAttributes and CNavArea:SetAttributes.
Adds a hiding spot onto this nav area.
There's a limit of 255 hiding spots per area.
CNavArea:AddToClosedList()
Adds this CNavArea to the closed list, a list of areas that have been checked by A* pathfinding algorithm.
Used in pathfinding via the A* algorithm.
More information can be found on the Simple Pathfinding page.
CNavArea:AddToOpenList()
Adds this CNavArea to the Open List.
Used in pathfinding via the A* algorithm.
More information can be found on the Simple Pathfinding page.
CNavArea:ClearSearchLists()
Clears the open and closed lists for a new search.
Used in pathfinding via the A* algorithm.
More information can be found on the Simple Pathfinding page.
Returns the height difference between the edges of two connected navareas.
Returns the NavDir enum direction that the given vector faces on this CNavArea.
Returns the height difference on the Z axis of the two CNavAreas. This is calculated from the center most point on both CNavAreas.
Connects this CNavArea to another CNavArea or CNavLadder with a one way connection. ( From this area to the target )
See CNavLadder:ConnectTo for making the connection from ladder to area.
CNavArea:Disconnect( CNavArea area )
Disconnects this nav area from given area or ladder. (Only disconnects one way)
CNavArea:Draw()
Draws this navarea on debug overlay.
CNavArea:DrawSpots()
Draws the hiding spots on debug overlay. This includes sniper/exposed spots too!
Returns a list of all the CNavAreas that have a one-way connection to this CNavArea and their pre-computed distances.
If an area has a one-way incoming connection to this CNavArea, then it will not be returned from this function, use CNavArea:GetIncomingConnectionDistances to get all one-way incoming connections.
table CNavArea:GetAdjacentAreas()
Returns a list of all the CNavAreas that have a (one and two way) connection from this CNavArea.
If an area has a one-way incoming connection to this CNavArea, then it will not be returned from this function, use CNavArea:GetIncomingConnections to get all one-way incoming connections.
See CNavArea:GetAdjacentAreasAtSide for a function that only returns areas from one side/direction.
Returns a table of all the CNavAreas that have a ( one and two way ) connection from this CNavArea in given direction.
If an area has a one-way incoming connection to this CNavArea, then it will not be returned from this function, use CNavArea:GetIncomingConnections to get all incoming connections.
See CNavArea:GetAdjacentAreas for a function that returns all areas from all sides/directions.
number CNavArea:GetAdjacentCount()
Returns the amount of CNavAreas that have a connection ( one and two way ) from this CNavArea.
See CNavArea:GetAdjacentCountAtSide for a function that only returns area count from one side/direction.
Returns the amount of CNavAreas that have a connection ( one or two way ) from this CNavArea in given direction.
See CNavArea:GetAdjacentCount for a function that returns CNavArea count from/in all sides/directions.
number CNavArea:GetAttributes()
Returns the attribute mask for the given CNavArea.
Returns the closest point of this Nav Area from the given position.
Returns the vector position of the corner for the given CNavArea.
number CNavArea:GetCostSoFar()
Returns the cost from starting area this area when pathfinding. Set by CNavArea:SetCostSoFar.
Used in pathfinding via the A* algorithm.
More information can be found on the Simple Pathfinding page.
table CNavArea:GetExposedSpots()
Returns a table of very bad hiding spots in this area.
See also CNavArea:GetHidingSpots.
table CNavArea:GetExtentInfo()
Returns size info about the nav area.
Returns a table of good hiding spots in this area.
See also CNavArea:GetExposedSpots.
Returns a table of all the CNavAreas that have a one-way connection to this CNavArea and their pre-computed distances.
If a CNavArea has a two-way connection to or from this CNavArea then it will not be returned from this function, use CNavArea:GetAdjacentAreaDistances to get outgoing (one and two way) connections.
table CNavArea:GetIncomingConnections()
Returns a table of all the CNavAreas that have a one-way connection to this CNavArea.
If a CNavArea has a two-way connection to or from this CNavArea then it will not be returned from this function, use CNavArea:GetAdjacentAreas to get outgoing ( one and two way ) connections.
See CNavArea:GetIncomingConnectionsAtSide for a function that returns one-way incoming connections from only one side/direction.
Returns a table of all the CNavAreas that have a one-way connection to this CNavArea from given direction.
If a CNavArea has a two-way connection to or from this CNavArea then it will not be returned from this function, use CNavArea:GetAdjacentAreas to get outgoing ( one and two way ) connections.
See CNavArea:GetIncomingConnections for a function that returns one-way incoming connections from all sides/directions.
table CNavArea:GetLadders()
Returns all CNavLadders that have a ( one or two way ) connection from this CNavArea.
See CNavArea:GetLaddersAtSide for a function that only returns CNavLadders in given direction.
Returns all CNavLadders that have a ( one or two way ) connection from ( one and two way ) this CNavArea in given direction.
See CNavArea:GetLadders for a function that returns CNavLadder from/in all sides/directions.
number CNavArea:GetParentHow()
Returns how this CNavArea is connected to its parent.
Returns a random CNavArea that has an outgoing ( one or two way ) connection from this CNavArea in given direction.
Vector CNavArea:GetRandomPoint()
Returns a random point on the nav area.
table CNavArea:GetSpotEncounters()
Returns all possible path segments through a CNavArea, and the dangerous spots to look at as we traverse that path segment.
number CNavArea:GetTotalCost()
Returns the total cost when passing from starting area to the goal area through this node. Set by CNavArea:SetTotalCost.
Used in pathfinding via the A* algorithm.
More information can be found on the Simple Pathfinding page.
table CNavArea:GetVisibleAreas()
Returns all CNavAreas that are visible from this CNavArea.
Returns true if the given CNavArea has this attribute flag set.
Returns whether the nav area is blocked or not, i. e. whether it can be walked through or not.
Returns whether this node is in the Closed List.
Used in pathfinding via the A* algorithm.
More information can be found on the Simple Pathfinding page.
Returns whether this CNavArea can completely (i. e. all corners of this area can see all corners of the given area) see the given CNavArea.
Returns whether this CNavArea has an outgoing ( one or two way ) connection to given CNavArea.
See CNavArea:IsConnectedAtSide for a function that only checks for outgoing connections in one direction.
Returns whether this CNavArea has an outgoing ( one or two way ) connection to given CNavArea in given direction.
See CNavArea:IsConnected for a function that checks all sides.
Returns whether this Nav Area is in the same plane as the given one.
boolean CNavArea:IsDamaging()
Returns whether the CNavArea would damage if traversed, as set by CNavArea:MarkAsDamaging.
Returns whether this Nav Area is flat within the tolerance of the nav_coplanar_slope_limit_displacement and nav_coplanar_slope_limit convars.
Returns whether this area is in the Open List.
Used in pathfinding via the A* algorithm.
More information can be found on the Simple Pathfinding page.
boolean CNavArea:IsOpenListEmpty()
Returns whether the Open List is empty or not.
Used in pathfinding via the A* algorithm.
More information can be found on the Simple Pathfinding page.
Returns if this position overlaps the Nav Area within the given tolerance.
Returns true if this CNavArea is overlapping the given CNavArea.
Returns whether this CNavArea can see given position.
Returns whether this CNavArea can potentially see the given CNavArea.
boolean CNavArea:IsRoughlySquare()
Returns if we're shaped like a square.
boolean CNavArea:IsUnderwater()
Whether this Nav Area is placed underwater.
Returns whether we can be seen from the given position.
CNavArea:MarkAsBlocked( number teamID = -2 )
Marks the area as blocked and unable to be traversed. See CNavArea:IsBlocked and CNavArea:MarkAsUnblocked.
CNavArea:MarkAsDamaging( number duration )
Marks the area as damaging if traversed, for example when, for example having poisonous or no atmosphere, or a temporary fire present. See CNavArea:IsDamaging.
CNavArea:MarkAsUnblocked( number teamID = -2 )
Unblocked this area if it was previously blocked by CNavArea:MarkAsBlocked.
CNavArea:PlaceOnGround( number corner )
Drops a corner or all corners of a CNavArea to the ground below it.
CNavArea CNavArea:PopOpenList()
Removes a CNavArea from the Open List with the lowest cost to traverse to from the starting node, and returns it.
Used in pathfinding via the A* algorithm.
More information can be found on the Simple Pathfinding page.
CNavArea:Remove()
Removes the given nav area.
CNavArea:RemoveAttributes( number attribs )
Removes given attributes from given CNavArea. See also CNavArea:SetAttributes.
CNavArea:RemoveFromClosedList()
We advise against using this. It may be changed or removed in a future update.
Does nothing
Removes this node from the Closed List.
Used in pathfinding via the A* algorithm.
More information can be found on the Simple Pathfinding page.
CNavArea:SetAttributes( number attribs )
Sets the attributes for given CNavArea. See CNavArea:HasAttributes.
CNavArea:SetCostSoFar( number cost )
Sets the cost from starting area this area when pathfinding.
Used in pathfinding via the A* algorithm.
More information can be found on the Simple Pathfinding page.
Sets the Place of the nav area.
There is a limit of 256 unique places per . nav file.
CNavArea:SetTotalCost( number cost )
Sets the total cost when passing from starting area to the goal area through this node.
Used in pathfinding via the A* algorithm.
More information can be found on the Simple Pathfinding page.
CNavArea:UpdateOnOpenList()
Moves this open list to appropriate position based on its CNavArea:GetTotalCost compared to the total cost of other areas in the open list.
Used in pathfinding via the A* algorithm.
More information can be found on the Simple Pathfinding page.