A* Pathfinding Project  3.8.5
The A* Pathfinding Project for Unity 3D
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Events Macros Groups Pages
IAgent Interface Reference

Exposes properties of an Agent class. More...

Detailed Description

Exposes properties of an Agent class.

A* Pro Feature:
This is an A* Pathfinding Project Pro feature only. This function/class/variable might not exist in the Free version of the A* Pathfinding Project or the functionality might be limited
The Pro version can be bought here

Public Member Functions

void SetYPosition (float yCoordinate)
 Sets the Y coordinate of the agent only.
 
void Teleport (Vector3 pos)
 Teleports the agent to a new position.
 

Properties

float AgentTimeHorizon [get, set]
 Max number of estimated seconds to look into the future for collisions with agents.
 
RVOLayer CollidesWith [get, set]
 Layer mask specifying which layers this agent will avoid.
 
bool DebugDraw [get, set]
 Debug drawing.
 
Vector3 DesiredVelocity [get, set]
 Desired velocity of the agent.
 
float Height [get, set]
 Height of the agent.
 
Vector3 InterpolatedPosition [get]
 Interpolated position of agent.
 
RVOLayer Layer [get, set]
 Specifies the avoidance layer for this agent.
 
bool Locked [get, set]
 Locked agents will not move.
 
int MaxNeighbours [get, set]
 Max number of agents to take into account.
 
float MaxSpeed [get, set]
 Max speed of the agent.
 
float NeighbourDist [get, set]
 Max distance to other agents to take them into account.
 
List< ObstacleVertexNeighbourObstacles [get]
 List of obstacle segments which were close to the agent during the last simulation step.
 
float ObstacleTimeHorizon [get, set]
 Max number of estimated seconds to look into the future for collisions with obstacles.
 
Vector3 Position [get]
 Position of the agent.
 
float Radius [get, set]
 Radius of the agent.
 
Vector3 Velocity [get, set]
 Velocity of the agent.
 

Member Function Documentation

void SetYPosition ( float  yCoordinate)

Sets the Y coordinate of the agent only.

This will not interfere with local avoidance like when using the Teleport method so this is the recommended way to adjust the position of the agent based on e.g how the ground looks.

void Teleport ( Vector3  pos)

Teleports the agent to a new position.

Just setting the position can cause strange effects when using interpolation.

Property Documentation

float AgentTimeHorizon
getset

Max number of estimated seconds to look into the future for collisions with agents.

As it turns out, this variable is also very good for controling agent avoidance priorities. Agents with lower values will avoid other agents less and thus you can make 'high priority agents' by giving them a lower value.

RVOLayer CollidesWith
getset

Layer mask specifying which layers this agent will avoid.

You can set it as CollidesWith = RVOLayer.DefaultAgent | RVOLayer.Layer3 | RVOLayer.Layer6 ...

See Also
http://en.wikipedia.org/wiki/Mask_(computing)
bool DebugDraw
getset

Debug drawing.

Vector3 DesiredVelocity
getset

Desired velocity of the agent.

Usually you set this once per frame. The agent will try move as close to the desired velocity as possible. Will take effect at the next simulation step.

float Height
getset

Height of the agent.

Vector3 InterpolatedPosition
get

Interpolated position of agent.

This is the recommended way of reading the position of an agent. Will be interpolated if the interpolation setting is enabled on the simulator.

RVOLayer Layer
getset

Specifies the avoidance layer for this agent.

The CollidesWith mask on other agents will determine if they will avoid this agent.

bool Locked
getset

Locked agents will not move.

int MaxNeighbours
getset

Max number of agents to take into account.

Decreasing this value can lead to better performance, increasing it can lead to better quality of the simulation.

float MaxSpeed
getset

Max speed of the agent.

In units per second

float NeighbourDist
getset

Max distance to other agents to take them into account.

Decreasing this value can lead to better performance, increasing it can lead to better quality of the simulation.

List<ObstacleVertex> NeighbourObstacles
get

List of obstacle segments which were close to the agent during the last simulation step.

Can be used to apply additional wall avoidance forces for example. Segments are formed by the obstacle vertex and its .next property.

float ObstacleTimeHorizon
getset

Max number of estimated seconds to look into the future for collisions with obstacles.

Vector3 Position
get

Position of the agent.

This cannot be changed manually. Use the Teleport method if you want to change the position of the agent, note that this should not be done during normal navigation since doing it effectively disables local avoidance.

See Also
InterpolatedPosition
float Radius
getset

Radius of the agent.

Agents are modelled as circles/cylinders

Vector3 Velocity
getset

Velocity of the agent.

Can be used to set the rotation of the rendered agent. But smoothing is recommended if you do so since it might be a bit unstable when the velocity is very low.

You can set this variable manually,but it is not recommended to do so unless you have good reasons since it might degrade the quality of the simulation.


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