A* Pathfinding Project
4.0.3
The A* Pathfinding Project for Unity 3D
|
RVO Character Controller. More...
RVO Character Controller.
Designed to be used as a drop-in replacement for the Unity Character Controller, it supports almost all of the same functions and fields with the exception that due to the nature of the RVO implementation, desired velocity is set in the Move function and is assumed to stay the same until something else is requested (as opposed to reset every frame).
For documentation of many of the variables of this class: refer to the Pathfinding.RVO.IAgent interface.
Public Member Functions | |
void | Update () |
![]() | |
Vector3 | CalculateMovementDelta (float deltaTime) |
Direction and distance to move in a single frame to avoid obstacles. | |
Vector3 | CalculateMovementDelta (Vector3 position, float deltaTime) |
Direction and distance to move in a single frame to avoid obstacles. | |
void | ForceSetVelocity (Vector3 velocity) |
Set the current velocity of the agent. | |
void | Move (Vector3 vel) |
Set the desired velocity for the agent. | |
void | SetCollisionNormal (Vector3 normal) |
Set the normal of a wall (or something else) the agent is currently colliding with. | |
void | SetTarget (Vector3 pos, float speed, float maxSpeed) |
Set the target point for the agent to move towards. | |
void | Teleport (Vector3 pos) |
Teleport the agent to a new position. | |
Vector2 | To2D (Vector3 p) |
Converts a 3D vector to a 2D vector in the movement plane. | |
Vector2 | To2D (Vector3 p, out float elevation) |
Converts a 3D vector to a 2D vector in the movement plane. | |
Vector3 | To3D (Vector2 p, float elevationCoordinate) |
Converts a 2D vector in the movement plane as well as an elevation to a 3D coordinate. | |
Public Attributes | |
bool | enableRotation = true |
LayerMask | mask = -1 |
Layer mask for the ground. | |
float | rotationSpeed = 30 |
![]() | |
float | agentTimeHorizon = 2 |
How far into the future to look for collisions with other agents (in seconds) | |
float | center = 1f |
Center of the agent relative to the pivot point of this game object. | |
RVOLayer | collidesWith = (RVOLayer)(-1) |
Layer mask specifying which layers this agent will avoid. | |
bool | debug |
Enables drawing debug information in the scene view. | |
float | height = 2 |
Height of the agent in world units. | |
RVOLayer | layer = RVOLayer.DefaultAgent |
Specifies the avoidance layer for this agent. | |
bool | locked |
A locked unit cannot move. | |
bool | lockWhenNotMoving = true |
Automatically set locked to true when desired velocity is approximately zero. | |
int | maxNeighbours = 10 |
Max number of other agents to take into account. | |
float | obstacleTimeHorizon = 2 |
How far into the future to look for collisions with obstacles (in seconds) | |
float | priority = 0.5f |
How strongly other agents will avoid this agent. | |
float | radius = 0.5f |
Radius of the agent in world units. | |
float | wallAvoidFalloff = 1 |
How much the wallAvoidForce decreases with distance. | |
float | wallAvoidForce = 1 |
An extra force to avoid walls. | |
Additional Inherited Members | |
![]() | |
void | UpdateAgentProperties () |
![]() | |
Transform | tr |
Cached tranform component. | |
![]() | |
MovementPlane | movementPlane [get] |
Determines if the XY (2D) or XZ (3D) plane is used for movement. | |
Vector3 | position [get] |
Current position of the agent. | |
IAgent | rvoAgent [get, set] |
Reference to the internal agent. | |
Simulator | simulator [get, set] |
Reference to the rvo simulator. | |
Vector3 | velocity [get] |
Current calculated velocity of the agent. | |
void Update | ( | ) |
bool enableRotation = true |
LayerMask mask = -1 |
Layer mask for the ground.
The RVOController will raycast down to check for the ground to figure out where to place the agent.
float rotationSpeed = 30 |