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, elevationCoordinate)
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
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

Coordinate which separates characters in the height direction.

Public
Height

Height of the agent in world units.

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
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

BiasDesiredVelocity (vos, desiredVelocity, targetPointInVelocitySpace, maxBiasRadians)

Bias towards the right side of agents.

Private Static
CalculateVelocity (context)
Internal
DesiredVelocityWeight
Private Static
DrawVO (circleCenter, radius, origin)
Private Static
EvaluateGradient (vos, p, value)

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

Private
FromXZ (p)

(x, 0, y)

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

Used by the Quadtree.

Internal
Rainbow (v)
Private Static
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 Static
Trace (vos, p, score)

Traces the vector field constructed out of the velocity obstacles.

Private
WallWeight

Extra weight that walls will have.

Private Static
agentTimeHorizon
Private
calculatedSpeed
Private
calculatedTargetPoint
Private
collidesWith
Private
collisionNormal
Private
currentVelocity
Private
debugDraw
Private
desiredSpeed
Private
desiredTargetPointInVelocitySpace

Desired target point - position.

Private
desiredVelocity
Private
elevationCoordinate
Private
height
Private
layer
Private
locked
Internal
manuallyControlled
Private
maxNeighbours
Private
maxSpeed
Private
neighbourDists
Private
neighbours
Private
next

Used internally for a linked list.

Internal
nextDesiredSpeed
Private
nextMaxSpeed
Private
nextTargetPoint
Private
obstacleTimeHorizon
Private
obstacles
Private
obstaclesBuffered
Private
position
Internal
radius
Internal
simulator

Simulator which handles this agent.

Internal