Photon Quantum 2.1.1

Classes | Public Types | Public Member Functions | List of all members
Quantum.Navigation Class Reference

Navigation API More...

Classes

class  Config
 Global navmesh configurations which are part of the SimulationConfig./> More...
 
class  Constants
 Global navigation constants. More...
 
class  PathFinder
 Navmesh TA* pathfinder class. More...
 

Public Types

enum  AvoidanceQuality : Byte
 Quality settings for agent avoidance. More...
 
enum  AvoidanceType : Byte
 Avoidance type applied to the navmesh agent. More...
 
enum  MovementType : Byte
 Defines how velocity is applied to the agent component. More...
 
enum  PathQuality : Byte
 The quality of the A* heuristic function. More...
 
enum  VerticalPositioningType : Byte
 Defines how the agents y-position will be calculation in 3D. More...
 
enum  WaypointFlag : Byte
 Flags stored with each navmesh agent waypoint. More...
 

Public Member Functions

void Dispose ()
 Dispose the navigation API. More...
 
FindPathResult FindPath (FrameThreadSafe frame, FPVector2 start, FPVector2 end, NavMesh navmesh, NavMeshRegionMask regionMask)
 Find a path (thread-safe). More...
 
FindPathResult 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 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 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...
 
IPathFinderData GetPathFinderData (FrameThreadSafe f)
 Access the pathfinder data after running Navigation.FindPath(). Don't save the IPathFinderData object anywhere, copy the data you need. More...
 
unsafe Boolean 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 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...
 
unsafe Boolean Raycast2D (FrameThreadSafe frame, FPVector2 origin, FPVector2 direction, FP distance, NavMeshRegionMask regionMask, NavMesh navmesh, out FPVector2 hit)
 Raycast through the navmesh. Only works 2D, even when the navmesh is 3D. The ray is tested against navmesh borders. More...
 
unsafe Boolean Raycast2D (FrameThreadSafe frame, FPVector3 origin, FPVector3 direction, FP distance, NavMeshRegionMask regionMask, NavMesh navmesh, out FPVector2 hit)
 Raycast through the navmesh. Only works 2D, even when the navmesh is 3D. The ray is tested against navmesh borders. More...
 
TaskHandle Update (FrameBase frame, FP deltaTime, INavigationCallbacks callbacks, TaskHandle handle)
 Update the multi-threaded navigation API. More...
 

Detailed Description

Navigation API

Member Enumeration Documentation

◆ AvoidanceQuality

Quality settings for agent avoidance.

Enumerator
Fast 

Only a minimum of avoidance candidates are computed.

Good 

Reasonable number of candidates are calculated with the best cost-benefit ratio

Best 

Maximum number of collision free candidates are generated

◆ AvoidanceType

Avoidance type applied to the navmesh agent.

Enumerator
None 

Active avoidance disabled. But other agents would still be influenced.

Internal 

Internal avoidance calculations using velocity obstacle model.

◆ MovementType

enum Quantum.Navigation.MovementType : Byte
strong

Defines how velocity is applied to the agent component.

Enumerator
None 

Not applied.

Transform 

Directly applied to Transform2D or Transform3D of the agent.

DynamicBody 

Applied to PhysicsBody2D or PhysicsBody3D as velocity.

Make sure to set FreezeRotation to true on the agent physics material. This prevents over-steering and other rotation issues with the agent steering.

CharacterController3D 

Applied to CharacterController2D.

Callback 

Does not move the agent but executes the MoveAgent signal.

◆ PathQuality

enum Quantum.Navigation.PathQuality : Byte
strong

The quality of the A* heuristic function.

Enumerator
Fast 

Uses parent G and Manhattan Distance

Good 

Creates a pivot point on the entry edge towards goal, recalculates G and Manhattan Distance

Best 

Creates a pivot point on the entry edge towards goal, recalculates G with another pivot point towards start and Euclidean Distance

◆ VerticalPositioningType

Defines how the agents y-position will be calculation in 3D.

Enumerator
None 

Not applied.

Navmesh 

The agents walk on the navmesh.

Physics 

The agents walks on 3D physics geometry.

◆ WaypointFlag

enum Quantum.Navigation.WaypointFlag : Byte
strong

Flags stored with each navmesh agent waypoint.

Enumerator
Target 

The waypoint is the target

LinkStart 

The waypoint is the start of a off-mesh link

LinkEnd 

The waypoint is the end of a off-mesh link

RepathWhenReached 

The agent will perform a repath when reaching the waypoint

Member Function Documentation

◆ Dispose()

void Quantum.Navigation.Dispose ( )
inline

Dispose the navigation API.

◆ Update()

TaskHandle Quantum.Navigation.Update ( FrameBase  frame,
FP  deltaTime,
INavigationCallbacks  callbacks,
TaskHandle  handle 
)
inline

Update the multi-threaded navigation API.

Parameters
frameFrame object
deltaTimeDelta time
callbacksCallback object to use (can be null)
handleThe task handle to add tasks to
Returns
Update handle.

◆ Raycast2D() [1/2]

unsafe Boolean Quantum.Navigation.Raycast2D ( FrameThreadSafe  frame,
FPVector3  origin,
FPVector3  direction,
FP  distance,
NavMeshRegionMask  regionMask,
NavMesh  navmesh,
out FPVector2  hit 
)
inline

Raycast through the navmesh. Only works 2D, even when the navmesh is 3D. The ray is tested against navmesh borders.

Parameters
frameFrame object
originRay origin
directionRay direction
distanceRay length
regionMaskRegion mask to identify enabled or disabled regions
navmeshNavmesh
hitPosition of the closest hit
Returns
True is a hit was generated.

◆ Raycast2D() [2/2]

unsafe Boolean Quantum.Navigation.Raycast2D ( FrameThreadSafe  frame,
FPVector2  origin,
FPVector2  direction,
FP  distance,
NavMeshRegionMask  regionMask,
NavMesh  navmesh,
out FPVector2  hit 
)
inline

Raycast through the navmesh. Only works 2D, even when the navmesh is 3D. The ray is tested against navmesh borders.

Parameters
frameFrame object
originRay origin
directionRay direction
distanceRay length
regionMaskRegion mask to identify enabled or disabled regions
navmeshNavmesh
hitPosition of the closest hit
Returns
True is a hit was generated.

◆ GetPathFinderData()

IPathFinderData Quantum.Navigation.GetPathFinderData ( FrameThreadSafe  f)
inline

Access the pathfinder data after running Navigation.FindPath(). Don't save the IPathFinderData object anywhere, copy the data you need.

Parameters
fFrame object
Returns
PathFinder data read interface.