PathBase is the base interface for all Path implementations. More...
Public Member Functions | |
float | GetLength () |
Computes the distance along the path from start to end. | |
float | GetDistanceFromStart (Vector3 position) |
Computes the distance from the start of the path to the closest intersecting point along the path. | |
float | GetDistanceFromStart (Vector3 position, float startDistance) |
Computes the distance from the starting of the path to the closest intersecting point that occurs after the startDistance. | |
bool | IsValid () |
Indicates whether the path is valid. An invalid path may be the result of a failed pathfinding step, or may be a path that has been invalidated at some later time due to changing game conditions, etc. | |
Vector3 | GetPositionOnPath (float distance) |
Returns the position along the path at the specified path distance. | |
int | GetWaypointCount () |
Returns the number of path nodes, or waypoints, in the given path. Valid paths will have at least 2. | |
Vector3 | GetWaypointPosition (int waypointIndex) |
Returns the position of the nth waypoint as specified by waypointIndex. | |
int | GetGraphNodeIndexOfWaypoint (int waypointIndex) |
Returns the graph node index of the nth waypoint as specified by waypointIndex. The graph node index should support retrieval of an associated graph node from the PathGraph used to create the Path. | |
bool | IsGraphNodeInPath (int graphNodeIndex) |
Indicates whether the graph node with index graphNodeIndex is a waypoint in the path. | |
int | GetStartGraphNodeIndex () |
A shortcut to retrieve the graph node index of waypoint 0. | |
int | GetEndGraphNodeIndex () |
A shortcut to retrieve the graph node index of waypoint GetWaypointCount()-1. | |
float | GetTotalCost () |
Returns the total cost of the path. For most paths, this will be equivalent to GetLength(). GetTotalCost() may return a previously computed value rather than recomputing the path cost for each call. | |
float | RecomputeTotalCost () |
Recomputes the total cost of the path and returns the value. The compute value may be stored and returned later by the GetTotalCost() call. |
float RAIN.Path.PathBase.GetDistanceFromStart | ( | Vector3 | position | ) |
Computes the distance from the start of the path to the closest intersecting point along the path.
position | The point to intersect with the path |
Implemented in RAIN.Path.SimplePath.
float RAIN.Path.PathBase.GetDistanceFromStart | ( | Vector3 | position, |
float | startDistance | ||
) |
Computes the distance from the starting of the path to the closest intersecting point that occurs after the startDistance.
position | The point to intersect with the path |
closestDistance | The starting distance along the path, after which an intersection may occur. This is mainly used for paths that may have switchbacks or crossovers, in which case we may want to avoid backtracking if more than one intersection is possible. |
Implemented in RAIN.Path.SimplePath.
int RAIN.Path.PathBase.GetEndGraphNodeIndex | ( | ) |
A shortcut to retrieve the graph node index of waypoint GetWaypointCount()-1.
Implemented in RAIN.Path.SimplePath.
int RAIN.Path.PathBase.GetGraphNodeIndexOfWaypoint | ( | int | waypointIndex | ) |
Returns the graph node index of the nth waypoint as specified by waypointIndex. The graph node index should support retrieval of an associated graph node from the PathGraph used to create the Path.
waypointIndex | The sequential index of the waypoint in the path to be retrieved. Must be between 0 and GetWaypointCount()-1 |
Implemented in RAIN.Path.SimplePath.
float RAIN.Path.PathBase.GetLength | ( | ) |
Computes the distance along the path from start to end.
Implemented in RAIN.Path.SimplePath.
Vector3 RAIN.Path.PathBase.GetPositionOnPath | ( | float | distance | ) |
Returns the position along the path at the specified path distance.
distance | The distance along the path from the start to the queried point |
Implemented in RAIN.Path.SimplePath.
int RAIN.Path.PathBase.GetStartGraphNodeIndex | ( | ) |
A shortcut to retrieve the graph node index of waypoint 0.
Implemented in RAIN.Path.SimplePath.
float RAIN.Path.PathBase.GetTotalCost | ( | ) |
Returns the total cost of the path. For most paths, this will be equivalent to GetLength(). GetTotalCost() may return a previously computed value rather than recomputing the path cost for each call.
Implemented in RAIN.Path.SimplePath.
int RAIN.Path.PathBase.GetWaypointCount | ( | ) |
Returns the number of path nodes, or waypoints, in the given path. Valid paths will have at least 2.
Implemented in RAIN.Path.SimplePath.
Vector3 RAIN.Path.PathBase.GetWaypointPosition | ( | int | waypointIndex | ) |
Returns the position of the nth waypoint as specified by waypointIndex.
waypointIndex | The sequential index of the waypoint in the path. Must be between 0 and GetWaypointCount()-1 |
Implemented in RAIN.Path.SimplePath.
bool RAIN.Path.PathBase.IsGraphNodeInPath | ( | int | graphNodeIndex | ) |
Indicates whether the graph node with index graphNodeIndex is a waypoint in the path.
graphNodeIndex | The graph node index of the graph node to check. |
Implemented in RAIN.Path.SimplePath.
bool RAIN.Path.PathBase.IsValid | ( | ) |
Indicates whether the path is valid. An invalid path may be the result of a failed pathfinding step, or may be a path that has been invalidated at some later time due to changing game conditions, etc.
Implemented in RAIN.Path.SimplePath.
float RAIN.Path.PathBase.RecomputeTotalCost | ( | ) |
Recomputes the total cost of the path and returns the value. The compute value may be stored and returned later by the GetTotalCost() call.
Implemented in RAIN.Path.SimplePath.