Infohazard.HyperNav 2.4.0
A pathfinding and avoidance solution for volumetric and omnidirectional navigation.
Loading...
Searching...
No Matches
Infohazard.HyperNav.NavPathfinder Class Reference

A script used to calculate HyperNav paths. More...

Classes

class  PropNames
 This is used to refer to the names of private fields in this class from a custom Editor. More...
 

Public Member Functions

AsyncPathHandle FindPathAsync (NavSampleResult startHit, NavSampleResult endHit, Vector3 startPos, Vector3 endPos, NavPathfindingParams pathParams, NativeCancellationToken? cancellationToken=null)
 Find a path between two already-calculated nav query results, and return when it is completed. More...
 

Package Functions

void DisposePath (NavPath path)
 Called by NavPath.Dispose. More...
 

Properties

bool IsMainInstance [get, set]
 Whether to set NavPathfinder.Instance to this instance. More...
 
float CpuCoreUtilization [get, set]
 The percentage of CPU cores utilized for pathfinding jobs. More...
 
int PathTighteningIterations [get, set]
 Number of times to apply the path tightening operation to attempt to shorten the path. More...
 
static ? NavPathfinder MainInstance [get, private set]
 The main instance, which should be used in most situations. More...
 

Private Member Functions

void OnEnable ()
 If IsMainInstance is true, set MainInstance or log an error if it is already set. More...
 
void OnDisable ()
 Dispose the pools of pending paths and completed paths, and all memory allocated for pathfinding jobs. More...
 
void LateUpdate ()
 Move paths from the pending queue and start executing them. More...
 

Detailed Description

A script used to calculate HyperNav paths.

Can be used as a singleton, or you can have more than one if needed.

Member Function Documentation

◆ DisposePath()

void Infohazard.HyperNav.NavPathfinder.DisposePath ( NavPath  path)
package

Called by NavPath.Dispose.

Parameters
pathThe path to dispose.

◆ FindPathAsync()

AsyncPathHandle Infohazard.HyperNav.NavPathfinder.FindPathAsync ( NavSampleResult  startHit,
NavSampleResult  endHit,
Vector3  startPos,
Vector3  endPos,
NavPathfindingParams  pathParams,
NativeCancellationToken?  cancellationToken = null 
)

Find a path between two already-calculated nav query results, and return when it is completed.

If pathfinding cannot occur, for example because there are no volumes, this method will return null synchronously. If no path can be found, the a null path will be returned asynchronously.

Parameters
startHitQuery result for the start of the path.
endHitQuery result for the end of the path.
startPosStart position for the path.
endPosDestination for the path.
pathParamsParameters for pathfinding.
cancellationTokenCancellation token for the operation.
Returns
A task that will yield the calculated path, or null if pathfinding cannot occur.

◆ LateUpdate()

void Infohazard.HyperNav.NavPathfinder.LateUpdate ( )
private

Move paths from the pending queue and start executing them.

◆ OnDisable()

void Infohazard.HyperNav.NavPathfinder.OnDisable ( )
private

Dispose the pools of pending paths and completed paths, and all memory allocated for pathfinding jobs.

◆ OnEnable()

void Infohazard.HyperNav.NavPathfinder.OnEnable ( )
private

If IsMainInstance is true, set MainInstance or log an error if it is already set.

Property Documentation

◆ CpuCoreUtilization

float Infohazard.HyperNav.NavPathfinder.CpuCoreUtilization
getset

The percentage of CPU cores utilized for pathfinding jobs.

The value determines the proportion of available CPU cores allocated for pathfinding tasks. It will always ensure at least one core is used and will not exceed the total number of cores.

◆ IsMainInstance

bool Infohazard.HyperNav.NavPathfinder.IsMainInstance
getset

Whether to set NavPathfinder.Instance to this instance.

This cannot be set while the game is running.

◆ MainInstance

? NavPathfinder Infohazard.HyperNav.NavPathfinder.MainInstance
staticgetprivate set

The main instance, which should be used in most situations.

If you need more than one NavPathfinder, you can use direct references to other instances with IsMainInstance set to false.

◆ PathTighteningIterations

int Infohazard.HyperNav.NavPathfinder.PathTighteningIterations
getset

Number of times to apply the path tightening operation to attempt to shorten the path.


The documentation for this class was generated from the following file: