Waypoint defines a node in a waypoint navigation graph setup. More...
Public Member Functions | |
void | Awake () |
Awake is the Unity event handler for component initialization. | |
void | AddConnection (GameObject neighbor) |
AddConnection connects a Waypoint to a neighboring waypoint. | |
void | RemoveConnection (GameObject neighbor) |
RemoveConnection removes connections associated with a connected waypoint. | |
void | RemoveAllConnections () |
RemoveallConnections clears all neighbors. | |
bool | IsConnectedTo (GameObject neighbor) |
Determine if a GameObject is a connected neighbor of this waypoint. | |
bool | ValidateNeighbors () |
ValidateNeighbors removes any null elements from the neighbors list. | |
void | RayCastNeighbors (GameObject[] potentialNeighbors, bool clearConnections, bool requireSymmetry) |
RaycastNeighbors attempts to spherecast between this waypoint and a collection of potential neighbors. The pathRadius is used to approximate the size of an AI moving along the path. | |
Bounds | GetNeighboringBounds (float minRadius) |
GetNeighborBounds is used to create a bounding box containing this waypoint and all connected neighbors. | |
void | CastToCollider (Vector3 fromPos, Vector3 forward, float minDistance, float maxDistance) |
CastToCollider is used to move the waypoint so it is located at the nearest forward collision. | |
virtual void | CopyConfiguration (WaypointGizmo targetWaypoint) |
Copy the internal configuration of an existing waypoint. | |
void | DropToCollider () |
DropToCollider drops the waypoint to any collider directly below its current position. | |
void | Awake () |
Awake is the Unity event handler for component initialization. | |
void | AddConnection (GameObject neighbor) |
AddConnection connects a Waypoint to a neighboring waypoint. | |
void | RemoveConnection (GameObject neighbor) |
RemoveConnection removes connections associated with a connected waypoint. | |
void | RemoveAllConnections () |
RemoveallConnections clears all neighbors. | |
bool | ValidateNeighbors () |
ValidateNeighbors removes any null elements from the neighbors list. | |
void | RayCastNeighbors (GameObject[] potentialNeighbors, bool clearConnections, bool requireSymmetry) |
RaycastNeighbors attempts to spherecast between this waypoint and a collection of potential neighbors. The pathRadius is used to approximate the size of an AI moving along the path. | |
Bounds | GetNeighboringBounds (float minRadius) |
GetNeighborBounds is used to create a bounding box containing this waypoint and all connected neighbors. | |
void | CastToCollider (Vector3 fromPos, Vector3 forward, float minDistance, float maxDistance) |
CastToCollider is used to move the waypoint so it is located at the nearest forward collision. | |
void | DropToCollider () |
DropToCollider drops the waypoint to any collider directly below its current position. | |
Public Attributes | |
List< GameObject > | neighbors |
List of neighboring waypoints. | |
float | raycastPathRadius = 1.0f |
Raycasting between Waypoints uses spherecasting between centers. raycastPathRadius defines the size of the sphere. | |
float | raycastMaxDistance = 10.0f |
Max distance to raycast for neighbors. | |
float | lookAheadDistance = 2.0f |
lookAheadDistance is a value transmitted to the AI during path following. This tells the AI how far ahead along the waypoint path it can look to determine its destination target. Higher numbers lead to shortcutting around turns in the path. Value should always be > 0 | |
float | pathRadius = 1.0f |
Raycasting between Waypoints uses spherecasting between centers. PathRadius defines the size of the sphere. | |
Properties | |
int | GraphIndex [get, set] |
GraphIndex is a variable made available to graph classes for storing an index on the waypoint object. It is designed as a helper and is not used internally by the Waypoint class itself. |
Waypoint defines a node in a waypoint navigation graph setup.
Waypoint defines a node in a waypoint navigation graph setup. Waypoint is only used at design time and is replaced by a graph node representation at runtime.
void RAIN.Path.Waypoint.AddConnection | ( | GameObject | neighbor | ) |
AddConnection connects a Waypoint to a neighboring waypoint.
neighbor | A GameObject representing the parent of a connected waypoint |
void RAIN.Path.Waypoint.AddConnection | ( | GameObject | neighbor | ) |
AddConnection connects a Waypoint to a neighboring waypoint.
neighbor | A GameObject representing the parent of a connected waypoint |
void RAIN.Path.Waypoint.Awake | ( | ) |
Awake is the Unity event handler for component initialization.
Reimplemented in RAIN.Path.WaypointGizmo.
void RAIN.Path.Waypoint.Awake | ( | ) |
Awake is the Unity event handler for component initialization.
Reimplemented in RAIN.Path.WaypointGizmo.
void RAIN.Path.Waypoint.CastToCollider | ( | Vector3 | fromPos, |
Vector3 | forward, | ||
float | minDistance, | ||
float | maxDistance | ||
) |
CastToCollider is used to move the waypoint so it is located at the nearest forward collision.
fromPos | The position to cast from, often a camera position |
forward | The forward vector to cast along, often to forward vector of the camera view |
minDistance | Minimum distance along the forward vector to place the waypoint. 0 indicates no minimum |
maxDistance | Maximum distance along the forward vector to place the waypoint. 0 indicates no maximum |
void RAIN.Path.Waypoint.CastToCollider | ( | Vector3 | fromPos, |
Vector3 | forward, | ||
float | minDistance, | ||
float | maxDistance | ||
) |
CastToCollider is used to move the waypoint so it is located at the nearest forward collision.
fromPos | The position to cast from, often a camera position |
forward | The forward vector to cast along, often to forward vector of the camera view |
minDistance | Minimum distance along the forward vector to place the waypoint. 0 indicates no minimum |
maxDistance | Maximum distance along the forward vector to place the waypoint. 0 indicates no maximum |
virtual void RAIN.Path.Waypoint.CopyConfiguration | ( | WaypointGizmo | targetWaypoint | ) | [virtual] |
Copy the internal configuration of an existing waypoint.
targetWaypoint | waypoint to copy from |
Reimplemented in RAIN.Path.WaypointGizmo.
void RAIN.Path.Waypoint.DropToCollider | ( | ) |
DropToCollider drops the waypoint to any collider directly below its current position.
void RAIN.Path.Waypoint.DropToCollider | ( | ) |
DropToCollider drops the waypoint to any collider directly below its current position.
Bounds RAIN.Path.Waypoint.GetNeighboringBounds | ( | float | minRadius | ) |
GetNeighborBounds is used to create a bounding box containing this waypoint and all connected neighbors.
minRadius | A min size buffer around considered waypoints, used to create an overlap region |
Bounds RAIN.Path.Waypoint.GetNeighboringBounds | ( | float | minRadius | ) |
GetNeighborBounds is used to create a bounding box containing this waypoint and all connected neighbors.
minRadius | A min size buffer around considered waypoints, used to create an overlap region |
bool RAIN.Path.Waypoint.IsConnectedTo | ( | GameObject | neighbor | ) |
Determine if a GameObject is a connected neighbor of this waypoint.
neighbor | The GameObject to test |
void RAIN.Path.Waypoint.RayCastNeighbors | ( | GameObject[] | potentialNeighbors, |
bool | clearConnections, | ||
bool | requireSymmetry | ||
) |
RaycastNeighbors attempts to spherecast between this waypoint and a collection of potential neighbors. The pathRadius is used to approximate the size of an AI moving along the path.
potentialNeighbors | An array of potential neighbors to evaluate |
clearConnections | Should existing connections be cleared before starting?"</param> <param name="requireSymmetry">Do all connected neighbors have to have return connections to this waypoint"? |
void RAIN.Path.Waypoint.RayCastNeighbors | ( | GameObject[] | potentialNeighbors, |
bool | clearConnections, | ||
bool | requireSymmetry | ||
) |
RaycastNeighbors attempts to spherecast between this waypoint and a collection of potential neighbors. The pathRadius is used to approximate the size of an AI moving along the path.
potentialNeighbors | An array of potential neighbors to evaluate |
clearConnections | Should existing connections be cleared before starting?"</param> <param name="requireSymmetry">Do all connected neighbors have to have return connections to this waypoint"? |
void RAIN.Path.Waypoint.RemoveAllConnections | ( | ) |
RemoveallConnections clears all neighbors.
void RAIN.Path.Waypoint.RemoveAllConnections | ( | ) |
RemoveallConnections clears all neighbors.
void RAIN.Path.Waypoint.RemoveConnection | ( | GameObject | neighbor | ) |
RemoveConnection removes connections associated with a connected waypoint.
neighbor | A GameObject representing the parent of a neighbor to remove |
void RAIN.Path.Waypoint.RemoveConnection | ( | GameObject | neighbor | ) |
RemoveConnection removes connections associated with a connected waypoint.
neighbor | A GameObject representing the parent of a neighbor to remove |
bool RAIN.Path.Waypoint.ValidateNeighbors | ( | ) |
ValidateNeighbors removes any null elements from the neighbors list.
bool RAIN.Path.Waypoint.ValidateNeighbors | ( | ) |
ValidateNeighbors removes any null elements from the neighbors list.
float RAIN::Path.Waypoint::lookAheadDistance = 2.0f |
lookAheadDistance is a value transmitted to the AI during path following. This tells the AI how far ahead along the waypoint path it can look to determine its destination target. Higher numbers lead to shortcutting around turns in the path. Value should always be > 0
List< GameObject > RAIN::Path.Waypoint::neighbors |
List of neighboring waypoints.
float RAIN.Path.Waypoint.pathRadius = 1.0f |
Raycasting between Waypoints uses spherecasting between centers. PathRadius defines the size of the sphere.
float RAIN.Path.Waypoint.raycastMaxDistance = 10.0f |
Max distance to raycast for neighbors.
float RAIN.Path.Waypoint.raycastPathRadius = 1.0f |
Raycasting between Waypoints uses spherecasting between centers. raycastPathRadius defines the size of the sphere.
int RAIN.Path.Waypoint.GraphIndex [get, set] |
GraphIndex is a variable made available to graph classes for storing an index on the waypoint object. It is designed as a helper and is not used internally by the Waypoint class itself.