Public Member Functions | |
SimplePath (PathGraph graph, int[] nodes, float cost) | |
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. | |
bool | IsValidOnGraph (PathGraph pathGraph) |
Vector3 | GetWaypointPosition (int waypointIndex) |
Returns the position of the nth waypoint as specified by waypointIndex. | |
bool | IsGraphNodeInPath (int nodeIndex) |
Indicates whether the graph node with index graphNodeIndex is a waypoint in the path. | |
void | GetPathDetail (float param, float closeEnoughDistance, out int lastWaypointIndex, out int nextWaypointIndex, out float percentAlongSegment) |
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. | |
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. | |
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. | |
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. | |
Properties | |
PathGraph | Graph [get] |
float RAIN.Path.SimplePath.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 |
Implements RAIN.Path.PathBase.
float RAIN.Path.SimplePath.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. |
Implements RAIN.Path.PathBase.
int RAIN.Path.SimplePath.GetEndGraphNodeIndex | ( | ) |
A shortcut to retrieve the graph node index of waypoint GetWaypointCount()-1.
Implements RAIN.Path.PathBase.
int RAIN.Path.SimplePath.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 |
Implements RAIN.Path.PathBase.
float RAIN.Path.SimplePath.GetLength | ( | ) |
Computes the distance along the path from start to end.
Implements RAIN.Path.PathBase.
Vector3 RAIN.Path.SimplePath.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 |
Implements RAIN.Path.PathBase.
int RAIN.Path.SimplePath.GetStartGraphNodeIndex | ( | ) |
A shortcut to retrieve the graph node index of waypoint 0.
Implements RAIN.Path.PathBase.
float RAIN.Path.SimplePath.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.
Implements RAIN.Path.PathBase.
int RAIN.Path.SimplePath.GetWaypointCount | ( | ) |
Returns the number of path nodes, or waypoints, in the given path. Valid paths will have at least 2.
Implements RAIN.Path.PathBase.
Vector3 RAIN.Path.SimplePath.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 |
Implements RAIN.Path.PathBase.
bool RAIN.Path.SimplePath.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. |
Implements RAIN.Path.PathBase.
bool RAIN.Path.SimplePath.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.
Implements RAIN.Path.PathBase.
float RAIN.Path.SimplePath.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.
Implements RAIN.Path.PathBase.