Class Agent Extends IAgent

Public

Internal agent for the RVO system.

Usually you will interface with the IAgent interface instead.

See

IAgent

Inner Types

VO

Velocity Obstacle.

Very simple list.

Public Methods

Agent (pos)
Public
BufferSwitch ()

Reads public properties and stores them in internal fields.

Public
CalculateNeighbours ()

Populate the neighbours and neighbourDists lists with the closest agents to this agent.

Public
ForceSetVelocity (velocity)

Set the current velocity of the agent.

Public
PostCalculation ()
Public
PreCalculation ()
Public
SetCollisionNormal (normal)

Set the normal of a wall (or something else) the agent is currently colliding with.

Public
SetMovementPlane (movementPlane)

Set the plane in which the agent should move.

Public
SetTarget (targetPoint, desiredSpeed, maxSpeed)

Point towards which the agent should move.

Public

Public Variables

AgentTimeHorizon

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

Public
CalculatedSpeed

Optimal speed of the agent to avoid collisions.

Public
CalculatedTargetPoint

Optimal point to move towards to avoid collisions.

Public
CollidesWith

Layer mask specifying which layers this agent will avoid.

Public
DebugDraw

Draw debug information.

Public
ElevationCoordinate
Public
Height

Height of the agent in world units.

Public
HeightOffset

Offset of the agent position along the up direction.

Public
Layer

Specifies the avoidance layer for this agent.

Public
Locked

Locked agents will be assumed not to move.

Public
MaxNeighbours

Max number of agents to take into account.

Public
MovementPlane

Plane in which the agent is moving.

Public
NeighbourCount

Number of neighbours that the agent took into account during the last simulation step.

Public
NeighbourObstacles
Public
ObstacleTimeHorizon

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

Public
Position

Position of the agent.

Public
PreCalculationCallback

Callback which will be called right before avoidance calculations are started.

Public
Priority

How strongly other agents will avoid this agent.

Public
Radius

Radius of the agent in world units.

Public

Private/Protected Members

agentTimeHorizon
Private
BiasDesiredVelocity (vos, desiredVelocity, targetPointInVelocitySpace, maxBiasRadians)

Bias towards the right side of agents.

Private Static
calculatedSpeed
Private
calculatedTargetPoint
Private
CalculateVelocity (context)
Package
collidesWith
Private
collisionNormal
Private
currentVelocity
Private
debugDraw
Private
desiredSpeed
Private
desiredTargetPointInVelocitySpace

Desired target point - position.

Private
desiredVelocity
Private
DesiredVelocityWeight
Private
desiredWorldVelocity

desiredVelocity in world space

Private
DrawVO (circleCenter, radius, origin)
Private
EvaluateGradient (vos, p, value)

Evaluate gradient and value of the cost function at velocity p.

Private
FromXZ (p)

(x, 0, y)

Private
GenerateNeighbourAgentVOs (vos)
Private
GenerateObstacleVOs (vos)
Private
GradientDescent (vos, sampleAround1, sampleAround2)
Private
height
Private
InsertAgentNeighbour (agent, rangeSq)

Used by the Quadtree.

Package
layer
Private
localElevation

Elevation in the movementPlane.

Private
localPosition

Position in the movementPlane.

Private
locked
Package
manuallyControlled
Private
maxNeighbours
Private
maxSpeed
Private
movementPlane
Private
neighbourDists
Private
neighbours
Private
next

Used internally for a linked list.

Package
nextDesiredSpeed
Private
nextMaxSpeed
Private
nextMovementPlane
Private
nextTargetPoint
Private
obstacles
Private
obstaclesBuffered
Private
obstacleTimeHorizon
Private
position
Package
radius
Package
Rainbow (v)
Private Static
resultMovementPlane
Private
simulator

Simulator which handles this agent.

Package
Sqr (x)

Square a number.

Private Static
To2D (p, elevation)

Converts a 3D vector to a 2D vector in the movement plane.

Private
ToXZ (p)

(x, z)

Private
Trace (vos, p, score)

Traces the vector field constructed out of the velocity obstacles.

Private
WallWeight

Extra weight that walls will have.

Private