Table of Contents

Class CCSNavArea

Namespace
CounterStrikeSharp.API.Core
Assembly
CounterStrikeSharp.API.dll
public class CCSNavArea : NativeObject
Inheritance
object
CCSNavArea
Inherited Members

Constructors

CCSNavArea(nint)

public CCSNavArea(nint pointer)

Parameters

pointer nint

Properties

Area2D

Gets the two-dimensional area size.

public float Area2D { get; }

Property Value

float

Center

Gets the center position of the nav area.

public Vector Center { get; }

Property Value

Vector

Height

Gets the height of the nav area on the Y axis.

public float Height { get; }

Property Value

float

Id

Gets the nav area identifier.

public uint Id { get; }

Property Value

uint

Max

Gets the maximum bounds of the nav area.

public Vector Max { get; }

Property Value

Vector

Min

Gets the minimum bounds of the nav area.

public Vector Min { get; }

Property Value

Vector

Normal

Gets the surface normal of the nav area.

public Vector Normal { get; }

Property Value

Vector

Width

Gets the width of the nav area on the X axis.

public float Width { get; }

Property Value

float

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

mins Vector

Minimum bounds of the box.

maxs Vector

Maximum bounds of the box.

zTolerance float

Allowed Z distance from the nav area surface.

Returns

bool

true if the box is contained inside this nav area; otherwise, false.

ContainsPoint(Vector, float)

Returns whether the specified position is inside this nav area.

public bool ContainsPoint(Vector position, float zTolerance = 32)

Parameters

position Vector

World position to test.

zTolerance float

Allowed Z distance from the nav area surface.

Returns

bool

true if the position is inside this nav area; otherwise, false.

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

position Vector

World position to compare against.

maximumDistance float

Maximum 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

position Vector

World position to compare against.

distance float

Distance to the closest nav area, or MaxValue if none was found.

maximumDistance float

Maximum 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

position Vector

World 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

position Vector

World 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

mins Vector

Minimum bounds of the box.

maxs Vector

Maximum bounds of the box.

zTolerance float

Allowed Z distance from the nav area surface.

Returns

bool

true if the box intersects this nav area; otherwise, false.