Photon Quantum 3.0.0

Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Quantum.NavMeshAgentConfig Class Reference

The configuration file for navmesh agent components. More...

Public Member Functions

override void Loaded (IResourceManager assets, Native.Allocator allocator)
 This callback is called after the asset has been loaded. A few values are clamped or calculated and cached. More...
 

Public Attributes

FP Acceleration = FP._10 + FP._10
 The acceleration of the agent.
When set to 0 no acceleration is used.
The value can be changed during run-time via the agent component. More...
 
FP AngularSpeed = FP._10 + FP._10
 The angular speed of the agent (in Radian/sec).
Set to 0 to disable agent rotation.
Set to 200 or more to make its rotation instant-like. More...
 
Boolean AutoBraking = false
 If active the agent will start breaking when approaching the target. More...
 
FP AutoBrakingDistance = FP._0_50
 The distance from the target when the agents starts to brake. Cannot be changed during run-time because the value is cached. More...
 
bool AutomaticTargetCorrection = true
 When an agent destination is selected that is outside the navmesh and if this option is enabled the target position will automatically tried to be corrected and moved to the inside of the navmesh.
Don't deactive this if using 3D navmeshes. More...
 
FP AutomaticTargetCorrectionRadius = FP._1
 When setting a target off the navmesh this value defines the radius that is searched to find a valid position. 0 = only at the target position >1 = all cells in radius direction around the target position Careful: Searching too many cells can greatly impact the performance. If the search fails or the offline generated fallback triangle is used. This value is also used to correct the start position which otherwise uses a radius of 0.25 for tolerance. More...
 
Boolean AvoidanceCanReduceSpeed = false
 This option enables velocity candidates that decrease the agents speed, to make the avoidance maneuvers a bit more natural. More...
 
Int32 AvoidanceLayer = 0
 Mark agent with a layer to prevent agents from avoiding each other. More...
 
LayerMask AvoidanceMask = ~0
 Other agents whose layer is no in the this mask are ignored. More...
 
Navigation.AvoidanceQuality AvoidanceQuality = Navigation.AvoidanceQuality.Good
 Quality settings for agent avoidance. More...
 
FP AvoidanceRadius = FP._0_50
 Radius used for avoidance calculation. More...
 
Navigation.AvoidanceType AvoidanceType = Navigation.AvoidanceType.Internal
 Select what type of avoidance procedures are applied to the agent. None will disable the active avoidance but other will still be able to avoid the agent. Remove AvoidanceAgent component to completely disable avoidance. More...
 
byte CachedWaypointCount = 6
 The number of waypoints stored on the agent. Default is 6. More...
 
Boolean ClampAgentToNavmesh = false
 Only selectable when MovementType is set to Transform.
The setting makes sure that agents are pushed out of invalid navmesh areas similar to what happens with colliders. More...
 
FP ClampAgentToNavmeshCorrection = FP._0_25
 This is a percentage how much the agent is corrected each tick. More...
 
FP DefaultWaypointDetectionDistance = FP.EN2
 Only required when no steering agent is used. The value used to detect if the agent has reached a waypoint in the beginning of the tick. Set this value to agent max speed * delta time. More...
 
Boolean DynamicLineOfSight = false
 This setting will make the agent perform a line cast each tick to skip unnecessary waypoints. This is rather expensive try DynamicLineOfSightWaypointRange and LineOfSightFunneling first. More...
 
FP DynamicLineOfSightWaypointRange = FP._0
 This is similar to the DynamicLineOfSight option but only triggers when the agent is in a certain range of the waypoint.
Disabled when set to 0. More...
 
bool EnableWaypointDetectionAxis = false
 When using agent rotation speed the agent sometimes will struggle to detect if a waypoint is reached. Use this value to create an perpendicular testing axis in front of the waypoint. More...
 
Boolean LineOfSightFunneling = false
 This option makes sure that unnecessary waypoints (mostly due to region edges in the proximity) are removed when they are applied to the agent component. More...
 
Int32 MaxAvoidanceCandidates = 64
 Depending on the quality and number of agents that are influencing each other this value needs to be increased to maintain smooth avoidance. More...
 
FP MaxRepathTimeout = FP._5
 The agent automatically performs path finding again when not having reaching the current waypoint in the given time frame (sec). Set to 0 to disable. More...
 
Navigation.MovementType MovementType = Navigation.MovementType.Transform
 Select how velocity is applied to the agent component. More...
 
Navigation.PathQuality PathQuality = Navigation.PathQuality.Good
 The quality of the A* heuristic function. More...
 
byte Priority = 50
 The avoidance priority level. More...
 
Boolean ReduceAvoidanceAtWaypoints = false
 Activate this to reduce the agent avoidance when getting close to waypoints. Use this only if you have kinematic agents to mitigate agents going off the navmesh. An alternative to this is still under development. Try DynamicLineOfSight when using DynamicBodies to mitigate stuck agents on waypoints. More...
 
FP ReduceAvoidanceFactor = FP._4
 This value is multiplied with the agent radius and represents the distance in which the avoidance influence is reduced quadratically. More...
 
Boolean ShowDebugAvoidance = false
 Show avoidance information of velocity obstacles and candidates. More...
 
FP Speed = FP.FromFloat_UNSAFE(3.5f)
 The maximum speed of the agent.
The value can be changed during run-time via the agent component. More...
 
FP StoppingDistance = FP.EN2
 The stopping distance of the agent when approaching the target position. More...
 
Int32 UpdateInterval = 1
 The tick interval in which the agent is updated with. The entity index will influence the exact tick the update will happen for each individual entity. 1 = every tick, 2 = every other tick, .. For performance reasons different agents will update at different times although they have the same UpdateInterval. More...
 
Navigation.VerticalPositioningType VerticalPositioning = Navigation.VerticalPositioningType.Navmesh
 Only valid when the agents uses 3D transforms. This defines how it's y-position is calculated. Navmesh is default but it has drawbacks because the navmesh geometry might be too simplified and custom tailored. For 3D physics the ground has be created by Quantum colliders. More...
 
FP WaypointDetectionAxisExtend = FP._0_50
 The extend of the perpendicular axis is WaypointDetectionAxisExtend. Should be something around the double radius of the agent. More...
 
FP WaypointDetectionAxisOffset = FP._0
 The offset toward the previous waypoint set by WaypointDetectionAxisOffset. More...
 

Static Public Attributes

const long DEFAULT_ID = (long)DefaultAssetGuids.NavMeshAgentConfig
 The asset id of the default agent config all agents use when no explicit config is set. More...
 

Detailed Description

The configuration file for navmesh agent components.

See NavMeshSteeringAgent

Member Function Documentation

◆ Loaded()

override void Quantum.NavMeshAgentConfig.Loaded ( IResourceManager  assets,
Native.Allocator  allocator 
)
inline

This callback is called after the asset has been loaded. A few values are clamped or calculated and cached.

Parameters
assetsResource manager
allocatorAllocator

Member Data Documentation

◆ DEFAULT_ID

const long Quantum.NavMeshAgentConfig.DEFAULT_ID = (long)DefaultAssetGuids.NavMeshAgentConfig
static

The asset id of the default agent config all agents use when no explicit config is set.

◆ UpdateInterval

Int32 Quantum.NavMeshAgentConfig.UpdateInterval = 1

The tick interval in which the agent is updated with. The entity index will influence the exact tick the update will happen for each individual entity. 1 = every tick, 2 = every other tick, .. For performance reasons different agents will update at different times although they have the same UpdateInterval.

◆ PathQuality

Navigation.PathQuality Quantum.NavMeshAgentConfig.PathQuality = Navigation.PathQuality.Good

The quality of the A* heuristic function.

◆ CachedWaypointCount

byte Quantum.NavMeshAgentConfig.CachedWaypointCount = 6

The number of waypoints stored on the agent. Default is 6.

The first waypoint is generated at the position of the agent. The last waypoint is only used during the re-pathing transition as soon as the one before the last waypoint is reached.

The value is clamped to a minimum of 3 and a maximum of Navigation.Constants.MaxWaypoints

.

◆ MaxRepathTimeout

FP Quantum.NavMeshAgentConfig.MaxRepathTimeout = FP._5

The agent automatically performs path finding again when not having reaching the current waypoint in the given time frame (sec). Set to 0 to disable.

◆ LineOfSightFunneling

Boolean Quantum.NavMeshAgentConfig.LineOfSightFunneling = false

This option makes sure that unnecessary waypoints (mostly due to region edges in the proximity) are removed when they are applied to the agent component.

◆ DynamicLineOfSight

Boolean Quantum.NavMeshAgentConfig.DynamicLineOfSight = false

This setting will make the agent perform a line cast each tick to skip unnecessary waypoints. This is rather expensive try DynamicLineOfSightWaypointRange and LineOfSightFunneling first.

◆ DynamicLineOfSightWaypointRange

FP Quantum.NavMeshAgentConfig.DynamicLineOfSightWaypointRange = FP._0

This is similar to the DynamicLineOfSight option but only triggers when the agent is in a certain range of the waypoint.
Disabled when set to 0.

◆ AutomaticTargetCorrection

bool Quantum.NavMeshAgentConfig.AutomaticTargetCorrection = true

When an agent destination is selected that is outside the navmesh and if this option is enabled the target position will automatically tried to be corrected and moved to the inside of the navmesh.
Don't deactive this if using 3D navmeshes.

◆ AutomaticTargetCorrectionRadius

FP Quantum.NavMeshAgentConfig.AutomaticTargetCorrectionRadius = FP._1

When setting a target off the navmesh this value defines the radius that is searched to find a valid position. 0 = only at the target position >1 = all cells in radius direction around the target position Careful: Searching too many cells can greatly impact the performance. If the search fails or the offline generated fallback triangle is used. This value is also used to correct the start position which otherwise uses a radius of 0.25 for tolerance.

◆ EnableWaypointDetectionAxis

bool Quantum.NavMeshAgentConfig.EnableWaypointDetectionAxis = false

When using agent rotation speed the agent sometimes will struggle to detect if a waypoint is reached. Use this value to create an perpendicular testing axis in front of the waypoint.

◆ WaypointDetectionAxisExtend

FP Quantum.NavMeshAgentConfig.WaypointDetectionAxisExtend = FP._0_50

The extend of the perpendicular axis is WaypointDetectionAxisExtend. Should be something around the double radius of the agent.

◆ WaypointDetectionAxisOffset

FP Quantum.NavMeshAgentConfig.WaypointDetectionAxisOffset = FP._0

The offset toward the previous waypoint set by WaypointDetectionAxisOffset.

◆ DefaultWaypointDetectionDistance

FP Quantum.NavMeshAgentConfig.DefaultWaypointDetectionDistance = FP.EN2

Only required when no steering agent is used. The value used to detect if the agent has reached a waypoint in the beginning of the tick. Set this value to agent max speed * delta time.

◆ MovementType

Navigation.MovementType Quantum.NavMeshAgentConfig.MovementType = Navigation.MovementType.Transform

Select how velocity is applied to the agent component.

◆ VerticalPositioning

Navigation.VerticalPositioningType Quantum.NavMeshAgentConfig.VerticalPositioning = Navigation.VerticalPositioningType.Navmesh

Only valid when the agents uses 3D transforms. This defines how it's y-position is calculated. Navmesh is default but it has drawbacks because the navmesh geometry might be too simplified and custom tailored. For 3D physics the ground has be created by Quantum colliders.

◆ Speed

FP Quantum.NavMeshAgentConfig.Speed = FP.FromFloat_UNSAFE(3.5f)

The maximum speed of the agent.
The value can be changed during run-time via the agent component.

◆ AngularSpeed

FP Quantum.NavMeshAgentConfig.AngularSpeed = FP._10 + FP._10

The angular speed of the agent (in Radian/sec).
Set to 0 to disable agent rotation.
Set to 200 or more to make its rotation instant-like.

◆ Acceleration

FP Quantum.NavMeshAgentConfig.Acceleration = FP._10 + FP._10

The acceleration of the agent.
When set to 0 no acceleration is used.
The value can be changed during run-time via the agent component.

◆ StoppingDistance

FP Quantum.NavMeshAgentConfig.StoppingDistance = FP.EN2

The stopping distance of the agent when approaching the target position.

◆ AutoBraking

Boolean Quantum.NavMeshAgentConfig.AutoBraking = false

If active the agent will start breaking when approaching the target.

◆ AutoBrakingDistance

FP Quantum.NavMeshAgentConfig.AutoBrakingDistance = FP._0_50

The distance from the target when the agents starts to brake. Cannot be changed during run-time because the value is cached.

◆ ClampAgentToNavmesh

Boolean Quantum.NavMeshAgentConfig.ClampAgentToNavmesh = false

Only selectable when MovementType is set to Transform.
The setting makes sure that agents are pushed out of invalid navmesh areas similar to what happens with colliders.

◆ ClampAgentToNavmeshCorrection

FP Quantum.NavMeshAgentConfig.ClampAgentToNavmeshCorrection = FP._0_25

This is a percentage how much the agent is corrected each tick.

◆ AvoidanceType

Navigation.AvoidanceType Quantum.NavMeshAgentConfig.AvoidanceType = Navigation.AvoidanceType.Internal

Select what type of avoidance procedures are applied to the agent. None will disable the active avoidance but other will still be able to avoid the agent. Remove AvoidanceAgent component to completely disable avoidance.

◆ AvoidanceQuality

Navigation.AvoidanceQuality Quantum.NavMeshAgentConfig.AvoidanceQuality = Navigation.AvoidanceQuality.Good

Quality settings for agent avoidance.

◆ Priority

byte Quantum.NavMeshAgentConfig.Priority = 50

The avoidance priority level.

Most important = 0. Least important = 99. Default = 50.

◆ AvoidanceRadius

FP Quantum.NavMeshAgentConfig.AvoidanceRadius = FP._0_50

Radius used for avoidance calculation.

◆ AvoidanceLayer

Int32 Quantum.NavMeshAgentConfig.AvoidanceLayer = 0

Mark agent with a layer to prevent agents from avoiding each other.

◆ AvoidanceMask

LayerMask Quantum.NavMeshAgentConfig.AvoidanceMask = ~0

Other agents whose layer is no in the this mask are ignored.

◆ MaxAvoidanceCandidates

Int32 Quantum.NavMeshAgentConfig.MaxAvoidanceCandidates = 64

Depending on the quality and number of agents that are influencing each other this value needs to be increased to maintain smooth avoidance.

◆ ReduceAvoidanceAtWaypoints

Boolean Quantum.NavMeshAgentConfig.ReduceAvoidanceAtWaypoints = false

Activate this to reduce the agent avoidance when getting close to waypoints. Use this only if you have kinematic agents to mitigate agents going off the navmesh. An alternative to this is still under development. Try DynamicLineOfSight when using DynamicBodies to mitigate stuck agents on waypoints.

◆ ReduceAvoidanceFactor

FP Quantum.NavMeshAgentConfig.ReduceAvoidanceFactor = FP._4

This value is multiplied with the agent radius and represents the distance in which the avoidance influence is reduced quadratically.

◆ AvoidanceCanReduceSpeed

Boolean Quantum.NavMeshAgentConfig.AvoidanceCanReduceSpeed = false

This option enables velocity candidates that decrease the agents speed, to make the avoidance maneuvers a bit more natural.

◆ ShowDebugAvoidance

Boolean Quantum.NavMeshAgentConfig.ShowDebugAvoidance = false

Show avoidance information of velocity obstacles and candidates.