reckfellENGINE

NavigationObstacle3D

3D obstacle used to affect navigation mesh baking or constrain velocities of avoidance controlled agents.

On this page
class NavigationObstacle3DReckfellSharpInherits Entity3D

3D obstacle used to affect navigation mesh baking or constrain velocities of avoidance controlled agents.

An obstacle needs a navigation map and outline NavigationObstacle3D.Vertices defined to work correctly. The outlines can not cross or overlap and are restricted to a plane projection. This means the y-axis of the vertices is ignored, instead the obstacle's global y-axis position is used for placement. The projected shape is extruded by the obstacles height along the y-axis. Obstacles can be included in the navigation mesh baking process when NavigationObstacle3D.AffectNavigationMesh is enabled. They do not add walkable geometry, instead their role is to discard other source geometry inside the shape. This can be used to prevent navigation mesh from appearing in unwanted places, e.g. inside "solid" geometry or on top of it. If NavigationObstacle3D.CarveNavigationMesh is enabled the baked shape will not be affected by offsets of the navigation mesh baking, e.g. the agent radius. With NavigationObstacle3D.AvoidanceEnabled the obstacle can constrain the avoidance velocities of avoidance using agents. If the obstacle's vertices are wound in clockwise order, avoidance agents will be pushed in by the obstacle, otherwise, avoidance agents will be pushed out. Obstacles using vertices and avoidance can warp to a new position but should not be moved every single frame as each change requires a rebuild of the avoidance map.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

NavigationObstacle3DConstructor
# NavigationObstacle3D
C#
public NavigationObstacle3D();

Properties9

AffectNavigationMeshProperty
# AffectNavigationMesh
C#
public bool AffectNavigationMesh { get; set; }

If enabled and parsed in a navigation mesh baking process the obstacle will discard source geometry inside its NavigationObstacle3D.Vertices and NavigationObstacle3D.Height defined shape.

AvoidanceEnabledProperty
# AvoidanceEnabled
C#
public bool AvoidanceEnabled { get; set; }

If true the obstacle affects avoidance using agents.

AvoidanceLayersProperty
# AvoidanceLayers
C#
public uint AvoidanceLayers { get; set; }

A bitfield determining the avoidance layers for this obstacle. Agents with a matching bit on the their avoidance mask will avoid this obstacle.

CarveNavigationMeshProperty
# CarveNavigationMesh
C#
public bool CarveNavigationMesh { get; set; }

If enabled the obstacle vertices will carve into the baked navigation mesh with the shape unaffected by additional offsets (e.g. agent radius). It will still be affected by further postprocessing of the baking process, like edge and polygon simplification. Requires NavigationObstacle3D.AffectNavigationMesh to be enabled.

HeightProperty
# Height
C#
public float Height { get; set; }

Sets the obstacle height used in 2D avoidance. 2D avoidance using agents ignore obstacles that are below or above them.

RadiusProperty
# Radius
C#
public float Radius { get; set; }

Sets the avoidance radius for the obstacle.

Use3DAvoidanceProperty
# Use3DAvoidance
C#
public bool Use3DAvoidance { get; set; }

If true the obstacle affects 3D avoidance using agents with obstacle NavigationObstacle3D.Radius. If false the obstacle affects 2D avoidance using agents with both obstacle NavigationObstacle3D.Vertices as well as obstacle NavigationObstacle3D.Radius.

VelocityProperty
# Velocity
C#
public Vector3 Velocity { get; set; }

The wanted velocity for the obstacle, used by other agents to better predict the obstacle if it is moved with a velocity regularly (every frame), instead of warped to a new position. Note: This property only affects avoidance for the obstacle's NavigationObstacle3D.Radius. Does nothing for the obstacle's static vertices.

VerticesProperty
# Vertices
C#
public Vector3[] Vertices { get; set; }

The outline vertices of the obstacle. If the vertices are winded in clockwise order, agents will be pushed in by the obstacle, otherwise they will be pushed out. Outlines cannot be crossed or overlap. If the obstacle is warped to a new position, agents cannot predict this movement and may get trapped inside the obstacle.

Methods24

GetAffectNavigationMeshbool
# GetAffectNavigationMesh
C#
public bool GetAffectNavigationMesh();
Returns bool
GetAvoidanceEnabledbool
# GetAvoidanceEnabled
C#
public bool GetAvoidanceEnabled();
Returns bool
GetAvoidanceLayerValuebool
# GetAvoidanceLayerValue
C#
public bool GetAvoidanceLayerValue(int layerNumber);

Returns whether or not the specified layer of the NavigationObstacle3D.AvoidanceLayers bitmask is enabled, given a layer_number between 1 and 32.

Parameters
NameTypeDefault
layerNumberint—
Returns bool
GetAvoidanceLayersuint
# GetAvoidanceLayers
C#
public uint GetAvoidanceLayers();
Returns uint
GetCarveNavigationMeshbool
# GetCarveNavigationMesh
C#
public bool GetCarveNavigationMesh();
Returns bool
GetHeightfloat
# GetHeight
C#
public float GetHeight();
Returns float
GetNavigationMapRid
# GetNavigationMap
C#
public Rid GetNavigationMap();

Returns the Rid of the navigation map for this NavigationObstacle node. This function returns always the map set on the NavigationObstacle node and not the map of the abstract obstacle on the NavigationServer. If the obstacle map is changed directly with the NavigationServer API the NavigationObstacle node will not be aware of the map change. Use NavigationObstacle3D.SetNavigationMap to change the navigation map for the NavigationObstacle and also update the obstacle on the NavigationServer.

Returns Rid
GetRadiusfloat
# GetRadius
C#
public float GetRadius();
Returns float
GetRidRid
# GetRid
C#
public Rid GetRid();

Returns the Rid of this obstacle on the NavigationServer3D.

Returns Rid
GetUse3DAvoidancebool
# GetUse3DAvoidance
C#
public bool GetUse3DAvoidance();
Returns bool
GetVelocityVector3
# GetVelocity
C#
public Vector3 GetVelocity();
Returns Vector3
GetVerticesVector3[]
# GetVertices
C#
public Vector3[] GetVertices();
Returns Vector3[]
SetAffectNavigationMeshvoid
# SetAffectNavigationMesh
C#
public void SetAffectNavigationMesh(bool enabled);
Parameters
NameTypeDefault
enabledbool—
SetAvoidanceEnabledvoid
# SetAvoidanceEnabled
C#
public void SetAvoidanceEnabled(bool enabled);
Parameters
NameTypeDefault
enabledbool—
SetAvoidanceLayerValuevoid
# SetAvoidanceLayerValue
C#
public void SetAvoidanceLayerValue(int layerNumber, bool value);

Based on value, enables or disables the specified layer in the NavigationObstacle3D.AvoidanceLayers bitmask, given a layer_number between 1 and 32.

Parameters
NameTypeDefault
layerNumberint—
valuebool—
SetAvoidanceLayersvoid
# SetAvoidanceLayers
C#
public void SetAvoidanceLayers(uint layers);
Parameters
NameTypeDefault
layersuint—
SetCarveNavigationMeshvoid
# SetCarveNavigationMesh
C#
public void SetCarveNavigationMesh(bool enabled);
Parameters
NameTypeDefault
enabledbool—
SetHeightvoid
# SetHeight
C#
public void SetHeight(float height);
Parameters
NameTypeDefault
heightfloat—
SetNavigationMapvoid
# SetNavigationMap
C#
public void SetNavigationMap(Rid navigationMap);

Sets the Rid of the navigation map this NavigationObstacle node should use and also updates the obstacle on the NavigationServer.

Parameters
NameTypeDefault
navigationMapRid—
SetRadiusvoid
# SetRadius
C#
public void SetRadius(float radius);
Parameters
NameTypeDefault
radiusfloat—
SetUse3DAvoidancevoid
# SetUse3DAvoidance
C#
public void SetUse3DAvoidance(bool enabled);
Parameters
NameTypeDefault
enabledbool—
SetVelocityvoid
# SetVelocity
C#
public void SetVelocity(Vector3 velocity);
Parameters
NameTypeDefault
velocityVector3—
SetVertices2 overloads
# SetVertices · 1/2
C#
public void SetVertices(Vector3[] vertices);
Parameters
NameTypeDefault
verticesVector3[]—
# SetVertices · 2/2
C#
public void SetVertices(ReadOnlySpan<Vector3> vertices);
Parameters
NameTypeDefault
verticesReadOnlySpan<Vector3>—
Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.