Photon Quantum 2.1.1

Classes | Functions
Navigation API

The Quantum.Navigation class encapsulates most of the important navigation API calls like FindPath(), LineOfSight() and Raycast2D. It is ticked each frame by calling the Update() method (NavMeshAgentSystem).
More...

Classes

class  Quantum.Navigation.Constants
 Global navigation constants. More...
 
interface  Quantum.ISignalOnNavMeshMoveAgent
 Signal is called when the agent should move. The desired direction is influence by avoidance. More...
 
interface  Quantum.ISignalOnNavMeshSearchFailed
 Signal is fired when the agent could not find a path in the agent update after using NavMeshSteeringAgent.SetTarget(Core.FrameBase, FPVector2, NavMesh, bool) More...
 
interface  Quantum.ISignalOnNavMeshWaypointReached
 Signal is fired when an agent reaches a waypoint. More...
 
class  Quantum.Navigation
 Navigation API More...
 
class  Quantum.NavMeshAgentConfig
 The configuration file for navmesh agent components. More...
 
struct  Quantum.NavMeshPathfinder
 The NavMeshAgent is an entity component for automated navmesh navigation and steering. More...
 
struct  Quantum.NavMeshSteeringAgent
 Requires NavMeshPathfinder component. More...
 

Functions

FindPathResult Quantum.Navigation.FindPath (FrameThreadSafe frame, FPVector2 start, FPVector2 end, NavMesh navmesh, NavMeshRegionMask regionMask)
 Find a path (thread-safe). More...
 
FindPathResult Quantum.Navigation.FindPath (FrameThreadSafe frame, FPVector2 start, FPVector2 end, NavMesh navmesh, NavMeshRegionMask regionMask, bool automaticTargetCorrection, FP automaticTargetCorrectionRadius, PathQuality quality)
 Find a path (thread-safe). More...
 
Navigation.FindPathResult Quantum.Navigation.FindPath (FrameThreadSafe frame, FPVector3 start, FPVector3 end, NavMesh navmesh, NavMeshRegionMask regionMask)
 Find a path (thread-safe). Uses automatic target correction with radius 1 and PathQualtiy Good. More...
 
Navigation.FindPathResult Quantum.Navigation.FindPath (FrameThreadSafe frame, FPVector3 start, FPVector3 end, NavMesh navmesh, NavMeshRegionMask regionMask, bool automaticTargetCorrection, FP automaticTargetCorrectionRadius, PathQuality quality=PathQuality.Good)
 Find a path (thread-safe). More...
 
unsafe Boolean Quantum.Navigation.LineOfSight (FPVector2 positionStart, FPVector2 positionDestination, NavMeshRegionMask regionMask, NavMesh navmesh, int triangleStart=-1, int triangleDestination=-1)
 Check line of sight inside the navmesh. This also works in 3D and creates a funnel through the navmesh triangles. Start and destination must be inside the navmesh. More...
 
unsafe Boolean Quantum.Navigation.LineOfSight (FPVector3 positionStart, FPVector3 positionDestination, NavMeshRegionMask regionMask, NavMesh navmesh, int triangleStart=-1, int triangleDestination=-1)
 Check line of sight inside the navmesh. This also works in 3D and creates a funnel through the navmesh triangles. Start and destination must be inside the navmesh. More...
 

Detailed Description

The Quantum.Navigation class encapsulates most of the important navigation API calls like FindPath(), LineOfSight() and Raycast2D. It is ticked each frame by calling the Update() method (NavMeshAgentSystem).

The Quantum.NavMesh (navigation mesh) is the data structure made up of triangles that agents can walk on.

The Quantum.NavMeshPathfinder is an entity component that will make an entity find paths through the navigation mesh.

The Quantum.NavMeshSteeringAgent is an entity component that will make an entity find paths through the navigation mesh.

The Quantum.NavMeshSteeringAgent is an entity component that will make an entity find paths through the navigation mesh.

Function Documentation

◆ FindPath() [1/4]

Navigation.FindPathResult Quantum.Navigation.FindPath ( FrameThreadSafe  frame,
FPVector3  start,
FPVector3  end,
NavMesh  navmesh,
NavMeshRegionMask  regionMask 
)
inline

Find a path (thread-safe). Uses automatic target correction with radius 1 and PathQualtiy Good.

Parameters
frameFrame object.
startStarting position
endTarget position
navmeshThe navmesh to operate on
regionMaskRegion mask is used to check if navmesh parts are active or inactive
Returns
The corrected start position

◆ FindPath() [2/4]

Navigation.FindPathResult Quantum.Navigation.FindPath ( FrameThreadSafe  frame,
FPVector3  start,
FPVector3  end,
NavMesh  navmesh,
NavMeshRegionMask  regionMask,
bool  automaticTargetCorrection,
FP  automaticTargetCorrectionRadius,
PathQuality  quality = PathQuality.Good 
)
inline

Find a path (thread-safe).

Parameters
frameFrame object.
startStarting position
endTarget position
navmeshThe navmesh to operate on
regionMaskRegion mask is used to check if navmesh parts are active or inactive
automaticTargetCorrectionIf the target is outside the navmesh the position will be tried to be corrected.
automaticTargetCorrectionRadiusThe range to validated the start and target position.
qualityThe path quality
Returns
The corrected start position

◆ FindPath() [3/4]

FindPathResult Quantum.Navigation.FindPath ( FrameThreadSafe  frame,
FPVector2  start,
FPVector2  end,
NavMesh  navmesh,
NavMeshRegionMask  regionMask 
)
inline

Find a path (thread-safe).

Parameters
frameFrame object
startStarting position
endTarget position
navmeshThe navmesh to operate on
regionMaskRegion mask is used to check if navmesh parts are active or inactive
Returns
The corrected start position

◆ FindPath() [4/4]

FindPathResult Quantum.Navigation.FindPath ( FrameThreadSafe  frame,
FPVector2  start,
FPVector2  end,
NavMesh  navmesh,
NavMeshRegionMask  regionMask,
bool  automaticTargetCorrection,
FP  automaticTargetCorrectionRadius,
PathQuality  quality 
)
inline

Find a path (thread-safe).

Parameters
frameFrame object
startStarting position
endTarget position
navmeshThe navmesh to operate on
regionMaskRegion mask is used to check if navmesh parts are active or inactive
automaticTargetCorrectionIf the target is outside the navmesh the position will be tried to be corrected.
automaticTargetCorrectionRadiusThe range to validated the start and target position.
qualityThe path quality
Returns
The corrected start position

◆ LineOfSight() [1/2]

unsafe Boolean Quantum.Navigation.LineOfSight ( FPVector3  positionStart,
FPVector3  positionDestination,
NavMeshRegionMask  regionMask,
NavMesh  navmesh,
int  triangleStart = -1,
int  triangleDestination = -1 
)
inline

Check line of sight inside the navmesh. This also works in 3D and creates a funnel through the navmesh triangles. Start and destination must be inside the navmesh.

Parameters
positionStartStart position
positionDestinationTarget position
regionMaskRegion mask to identify enabled or disabled regions
navmeshNavmesh to check
triangleStartOptionally provide the triangle that the start position is on
triangleDestinationOptionally provide the triangle that the destination position is on
Returns
True if there is a unobstructed line of sight on the navmesh

◆ LineOfSight() [2/2]

unsafe Boolean Quantum.Navigation.LineOfSight ( FPVector2  positionStart,
FPVector2  positionDestination,
NavMeshRegionMask  regionMask,
NavMesh  navmesh,
int  triangleStart = -1,
int  triangleDestination = -1 
)
inline

Check line of sight inside the navmesh. This also works in 3D and creates a funnel through the navmesh triangles. Start and destination must be inside the navmesh.

Parameters
positionStartStart position
positionDestinationTarget position
regionMaskRegion mask to identify enabled or disabled regions
navmeshNavmesh to check
triangleStartOptionally provide the triangle that the start position is on
triangleDestinationOptionally provide the triangle that the destination position is on
Returns
True if there is a unobstructed line of sight on the navmesh