Class LightweightRVO Extends MonoBehaviour

Public

Lightweight RVO Circle Example.

Lightweight script for simulating agents in a circle trying to reach their antipodal positions. This script, compared to using lots of RVOAgents shows the real power of the RVO simulator when little other overhead (e.g GameObjects) is present.

For example with this script, I can simulate 5000 agents at around 50 fps on my laptop (with desired simulation fps = 10 and interpolation, 2 threads) however when using prefabs, only instantiating the 5000 agents takes 10 seconds and it runs at around 5 fps.

This script will render the agents by generating a square for each agent combined into a single mesh with appropriate UV.

A few GUI buttons will be drawn by this script with which the user can change the number of agents.

Public Methods

CreateAgents (num)

Create a number of agents in circle and restart simulation.

Public
OnGUI ()
Public
Start ()
Public
Update ()
Public

Public Variables

agentCount

Number of agents created at start.

Public
agentTimeHorizon

How far in the future too look for agents.

Public
debug

Enable the debug flag for all agents.

Public
exampleScale

How large is the area where agents are placed.

Public
maxNeighbours

Max number of neighbour agents to take into account.

Public
maxSpeed

Max speed for an agent.

Public
obstacleTimeHorizon

How far in the future too look for obstacles.

Public
radius

Agent radius.

Public
renderingOffset

Offset from the agent position the actual drawn postition.

Public
type
Public

Public Enums

RVOExampleType
Public

Private/Protected Members

agents

All agents handled by this script.

Private
colors

Color for each agent.

Private
goals

Goals for each agent.

Private
interpolatedRotations
Private
interpolatedVelocities
Private
mesh

Mesh for rendering.

Private
meshColors
Private
SetAgentSettings ()
Private
sim

Reference to the simulator in the scene.

Private
tris
Private
uniformDistance (radius)
Private
uv
Private
verts
Private