Photon Quantum 3.0.0

Classes | Public Types | Public Member Functions | Public Attributes | 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...
 
struct  FindPathResult
 The result object for FindPath requests. More...
 
interface  IPathFinderData
 An interface to access a few selected internal pathfinding data. More...
 
class  PathFinder
 Navmesh TA* pathfinder class. More...
 
struct  PathVertex
 The data structure for the internal path waypoints. More...
 
class  ThreadLocal
 An internal class that stored multi-threading related navigation context. 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  RawPathAllocationStrategy : Byte
 In most cases the maximum raw path size set in Config.RawPathSize will suffice. Exceeding the size in Fixed mode will fail the pathfinding request. 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 PathQuality 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...
 
QTuple< PathFinder, string > GetDebugInformation (int threadIndex)
 Access read-only debug pathfinder information for thread index. More...
 
IPathFinderData GetPathFinderData (FrameThreadSafe f)
 Access the pathfinder data after running Navigation.FindPath(). Don't save the IPathFinderData object anywhere, copy the needed. 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)
 Obsolete method. More...
 
unsafe Boolean Raycast2D (FrameThreadSafe frame, FPVector2 origin, FPVector2 direction, FP distance, NavMeshRegionMask regionMask, NavMesh navmesh, out FPVector2 hit, out int borderIndex)
 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)
 Obsolete method. More...
 
unsafe Boolean Raycast2D (FrameThreadSafe frame, FPVector3 origin, FPVector3 direction, FP distance, NavMeshRegionMask regionMask, NavMesh navmesh, out FPVector2 hit, out int borderIndex)
 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...
 

Public Attributes

Navigation.Config NavigationConfig => _updater?._config
 Access the navigation config used for the navigation originated from the SimulationConfig. 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 

Not used anymore.

CharacterController3D 

Not used anymore.

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

◆ RawPathAllocationStrategy

In most cases the maximum raw path size set in Config.RawPathSize will suffice. Exceeding the size in Fixed mode will fail the pathfinding request.

Enumerator
Fixed 

Fixed size allocation. Will fail if the path exceeds the maximum size.

Allocating 

Growing the raw path size when needed.

◆ 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/4]

unsafe Boolean Quantum.Navigation.Raycast2D ( FrameThreadSafe  frame,
FPVector3  origin,
FPVector3  direction,
FP  distance,
NavMeshRegionMask  regionMask,
NavMesh  navmesh,
out FPVector2  hit,
out int  borderIndex 
)
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
borderIndexIndex of the border that was hit (Navmesh.Borders[i])
Returns
true is a hit was generated.

◆ Raycast2D() [2/4]

unsafe Boolean Quantum.Navigation.Raycast2D ( FrameThreadSafe  frame,
FPVector2  origin,
FPVector2  direction,
FP  distance,
NavMeshRegionMask  regionMask,
NavMesh  navmesh,
out FPVector2  hit,
out int  borderIndex 
)
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
borderIndexIndex of the border that was hit (Navmesh.Borders[i])
Returns
true is a hit was generated.

◆ Raycast2D() [3/4]

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

Obsolete method.

◆ Raycast2D() [4/4]

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

Obsolete method.

◆ 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 needed.

Parameters
fFrame object
Returns
PathFinder data read interface.

◆ GetDebugInformation()

QTuple<PathFinder, string> Quantum.Navigation.GetDebugInformation ( int  threadIndex)
inline

Access read-only debug pathfinder information for thread index.

Parameters
threadIndexThread index
Returns
Debug information about the pathfinder state.

Member Data Documentation

◆ NavigationConfig

Navigation.Config Quantum.Navigation.NavigationConfig => _updater?._config

Access the navigation config used for the navigation originated from the SimulationConfig.