RAIN.Path.Waypoint Class Reference

Waypoint defines a node in a waypoint navigation graph setup. More...

Inheritance diagram for RAIN.Path.Waypoint:
RAIN.Path.WaypointGizmo

List of all members.

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.

Detailed Description

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.


Member Function Documentation

void RAIN.Path.Waypoint.AddConnection ( GameObject  neighbor)

AddConnection connects a Waypoint to a neighboring waypoint.

Parameters:
neighborA GameObject representing the parent of a connected waypoint
void RAIN.Path.Waypoint.AddConnection ( GameObject  neighbor)

AddConnection connects a Waypoint to a neighboring waypoint.

Parameters:
neighborA 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.

Parameters:
fromPosThe position to cast from, often a camera position
forwardThe forward vector to cast along, often to forward vector of the camera view
minDistanceMinimum distance along the forward vector to place the waypoint. 0 indicates no minimum
maxDistanceMaximum 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.

Parameters:
fromPosThe position to cast from, often a camera position
forwardThe forward vector to cast along, often to forward vector of the camera view
minDistanceMinimum distance along the forward vector to place the waypoint. 0 indicates no minimum
maxDistanceMaximum 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.

Parameters:
targetWaypointwaypoint 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.

Parameters:
minRadiusA min size buffer around considered waypoints, used to create an overlap region
Returns:
Returns the combined extents of all neighbors
Bounds RAIN.Path.Waypoint.GetNeighboringBounds ( float  minRadius)

GetNeighborBounds is used to create a bounding box containing this waypoint and all connected neighbors.

Parameters:
minRadiusA min size buffer around considered waypoints, used to create an overlap region
Returns:
Returns the combined extents of all neighbors
bool RAIN.Path.Waypoint.IsConnectedTo ( GameObject  neighbor)

Determine if a GameObject is a connected neighbor of this waypoint.

Parameters:
neighborThe GameObject to test
Returns:
true if neighbor is a connected Neighbor, false otherwise.
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.

Parameters:
potentialNeighborsAn array of potential neighbors to evaluate
clearConnectionsShould 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.

Parameters:
potentialNeighborsAn array of potential neighbors to evaluate
clearConnectionsShould 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.

Parameters:
neighborA GameObject representing the parent of a neighbor to remove
void RAIN.Path.Waypoint.RemoveConnection ( GameObject  neighbor)

RemoveConnection removes connections associated with a connected waypoint.

Parameters:
neighborA GameObject representing the parent of a neighbor to remove
bool RAIN.Path.Waypoint.ValidateNeighbors ( )

ValidateNeighbors removes any null elements from the neighbors list.

Returns:
bool RAIN.Path.Waypoint.ValidateNeighbors ( )

ValidateNeighbors removes any null elements from the neighbors list.

Returns:

Member Data Documentation

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.

Raycasting between Waypoints uses spherecasting between centers. PathRadius defines the size of the sphere.

Max distance to raycast for neighbors.

Raycasting between Waypoints uses spherecasting between centers. raycastPathRadius defines the size of the sphere.


Property Documentation

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.