Class CCSNavArea
- Namespace
- CounterStrikeSharp.API.Core
- Assembly
- CounterStrikeSharp.API.dll
public class CCSNavArea : NativeObject
- Inheritance
-
objectCCSNavArea
- Inherited Members
Constructors
CCSNavArea(nint)
public CCSNavArea(nint pointer)
Parameters
pointernint
Properties
Area2D
Gets the two-dimensional area size.
public float Area2D { get; }
Property Value
Center
Gets the center position of the nav area.
public Vector Center { get; }
Property Value
Height
Gets the height of the nav area on the Y axis.
public float Height { get; }
Property Value
Id
Gets the nav area identifier.
public uint Id { get; }
Property Value
Max
Gets the maximum bounds of the nav area.
public Vector Max { get; }
Property Value
Min
Gets the minimum bounds of the nav area.
public Vector Min { get; }
Property Value
Normal
Gets the surface normal of the nav area.
public Vector Normal { get; }
Property Value
Width
Gets the width of the nav area on the X axis.
public float Width { get; }
Property Value
Methods
ContainsBox(Vector, Vector, float)
Returns whether the specified box is fully contained inside this nav area.
public bool ContainsBox(Vector mins, Vector maxs, float zTolerance = 32)
Parameters
minsVectorMinimum bounds of the box.
maxsVectorMaximum bounds of the box.
zTolerancefloatAllowed Z distance from the nav area surface.
Returns
ContainsPoint(Vector, float)
Returns whether the specified position is inside this nav area.
public bool ContainsPoint(Vector position, float zTolerance = 32)
Parameters
positionVectorWorld position to test.
zTolerancefloatAllowed Z distance from the nav area surface.
Returns
GetAllNavAreas()
Gets all nav areas from the current nav mesh.
public static IReadOnlyList<CCSNavArea> GetAllNavAreas()
Returns
- IReadOnlyList<CCSNavArea>
All nav areas, or an empty list if the nav mesh is unavailable.
GetClosestNavArea(Vector, float)
Gets the closest nav area to the specified position.
public static CCSNavArea? GetClosestNavArea(Vector position, float maximumDistance = -1)
Parameters
positionVectorWorld position to compare against.
maximumDistancefloatMaximum search distance. A value less than or equal to zero disables the limit.
Returns
- CCSNavArea
The closest nav area, or null if none was found.
GetClosestNavArea(Vector, out float, float)
Gets the closest nav area to the specified position and outputs its distance.
public static CCSNavArea? GetClosestNavArea(Vector position, out float distance, float maximumDistance = -1)
Parameters
positionVectorWorld position to compare against.
distancefloatDistance to the closest nav area, or MaxValue if none was found.
maximumDistancefloatMaximum search distance. A value less than or equal to zero disables the limit.
Returns
- CCSNavArea
The closest nav area, or null if none was found.
GetClosestPoint(Vector)
Gets the closest point on this nav area to the specified position.
public Vector GetClosestPoint(Vector position)
Parameters
positionVectorWorld position to compare against.
Returns
- Vector
The closest point on this nav area.
GetDistanceToPoint(Vector)
Gets the distance from this nav area to the specified position.
public float GetDistanceToPoint(Vector position)
Parameters
positionVectorWorld position to compare against.
Returns
- float
The distance to this nav area.
IntersectsBox(Vector, Vector, float)
Returns whether the specified box intersects this nav area.
public bool IntersectsBox(Vector mins, Vector maxs, float zTolerance = 32)
Parameters
minsVectorMinimum bounds of the box.
maxsVectorMaximum bounds of the box.
zTolerancefloatAllowed Z distance from the nav area surface.