PathGraph is the base class for all PathGraph implementations. More...
Classes | |
| class | PathGraphChangedEventArgs |
| A path graph changed event used to signal the pathfinding system that a recomputation may be necessary. More... | |
Public Member Functions | |
| PathGraph () | |
| Default constructor. | |
| PathGraph (float minEdgeCost) | |
| Constructor specifying a minimum edge cost. Minimum edge cost must be greater than zero, otherwise cycles may occur. | |
| abstract void | InitGraph () |
| InitGraph is used to allocate memory and initialize the graph for use. | |
| abstract int | Quantize (Vector3 location) |
| Quantize determines the graph node associated with the location. | |
| abstract Vector3 | Localize (int nodeIndex) |
| Localize determines the Vector3 location of the specified graph node. | |
| abstract PathBase | CreatePath (List< int > nodeList, float cost) |
| Creates a PathBase object from an ordered list of nodes and a precomputed cost. | |
| void | AddEdge (int fromIndex, int toIndex, float staticCost) |
| Adds a directed edge to the graph. | |
| virtual PathNode | Node (int index) |
| Returns the graph node associated with the given index. Graph node indices are expected to remain constant during the lifetime of the graph, although connectivity may change. | |
| virtual float | HeuristicCost (int fromNodeIndex, int toNodeIndex) |
| A heuristic cost function estimating the cost from fromNodeIndex to toNodeIndex. For A*-based pathfinding to guarantee a shortest path, the heuristic cost must be less than or equal to the actual cost. The default heuristic cost is 0. | |
| void | DebugDump () |
| Dump the node list to the logger. | |
Protected Member Functions | |
| virtual void | OnChanged (PathGraphChangedEventArgs e) |
Protected Attributes | |
| PathNode[] | _pathNodes = null |
| _pathNodes is an array of path graph nodes that can be referenced by their array index | |
| int | _nodeCount = 0 |
| A path node count, usually equal to _pathNodes.Length. | |
Properties | |
| float | MinEdgeCost [get, set] |
| Minimum edge cost property accessor. | |
| virtual int | Size [get] |
| Returns the number of graph nodes in the graph. | |
Events | |
| EventHandler | Changed |
| RAIN.Path.PathGraph.PathGraph | ( | ) |
Default constructor.
| RAIN.Path.PathGraph.PathGraph | ( | float | minEdgeCost | ) |
Constructor specifying a minimum edge cost. Minimum edge cost must be greater than zero, otherwise cycles may occur.
| minEdgeCost |
| void RAIN.Path.PathGraph.AddEdge | ( | int | fromIndex, |
| int | toIndex, | ||
| float | staticCost | ||
| ) |
Adds a directed edge to the graph.
| fromIndex | From graph node |
| toIndex | To graph node |
| staticCost | Static edge cost. If less than MinEdgeCost, MinEdgeCost will be used. |
| abstract PathBase RAIN.Path.PathGraph.CreatePath | ( | List< int > | nodeList, |
| float | cost | ||
| ) | [pure virtual] |
Creates a PathBase object from an ordered list of nodes and a precomputed cost.
| nodeList | |
| cost |
Implemented in RAIN.Path.VectorPathGraph, and RAIN.Path.NavGridMultiRegionGraph.
| void RAIN.Path.PathGraph.DebugDump | ( | ) |
Dump the node list to the logger.
| virtual float RAIN.Path.PathGraph.HeuristicCost | ( | int | fromNodeIndex, |
| int | toNodeIndex | ||
| ) | [virtual] |
A heuristic cost function estimating the cost from fromNodeIndex to toNodeIndex. For A*-based pathfinding to guarantee a shortest path, the heuristic cost must be less than or equal to the actual cost. The default heuristic cost is 0.
| fromNodeIndex | The from node index |
| toNodeIndex | The to node index |
Reimplemented in RAIN.Path.VectorPathGraph, and RAIN.Path.NavGridMultiRegionGraph.
| abstract void RAIN.Path.PathGraph.InitGraph | ( | ) | [pure virtual] |
InitGraph is used to allocate memory and initialize the graph for use.
Implemented in RAIN.Path.VectorPathGraph, and RAIN.Path.NavGridMultiRegionGraph.
| abstract Vector3 RAIN.Path.PathGraph.Localize | ( | int | nodeIndex | ) | [pure virtual] |
Localize determines the Vector3 location of the specified graph node.
| nodeIndex | The index of the graph node to localize |
Implemented in RAIN.Path.VectorPathGraph, and RAIN.Path.NavGridMultiRegionGraph.
| virtual PathNode RAIN.Path.PathGraph.Node | ( | int | index | ) | [virtual] |
Returns the graph node associated with the given index. Graph node indices are expected to remain constant during the lifetime of the graph, although connectivity may change.
| index | The index of the graph node to retrieve |
Reimplemented in RAIN.Path.NavGridMultiRegionGraph.
| abstract int RAIN.Path.PathGraph.Quantize | ( | Vector3 | location | ) | [pure virtual] |
Quantize determines the graph node associated with the location.
| location | Vector3 position of the point to quantize |
Implemented in RAIN.Path.VectorPathGraph, and RAIN.Path.NavGridMultiRegionGraph.
int RAIN.Path.PathGraph._nodeCount = 0 [protected] |
A path node count, usually equal to _pathNodes.Length.
PathNode [] RAIN.Path.PathGraph._pathNodes = null [protected] |
_pathNodes is an array of path graph nodes that can be referenced by their array index
float RAIN.Path.PathGraph.MinEdgeCost [get, set] |
Minimum edge cost property accessor.
virtual int RAIN.Path.PathGraph.Size [get] |
Returns the number of graph nodes in the graph.
Reimplemented in RAIN.Path.NavGridMultiRegionGraph.