RAIN.Path.PathGraph Class Reference

PathGraph is the base class for all PathGraph implementations. More...

Inheritance diagram for RAIN.Path.PathGraph:
RAIN.Path.NavGridMultiRegionGraph RAIN.Path.VectorPathGraph RAIN.Path.WaypointPathGraph

List of all members.

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

Detailed Description

PathGraph is the base class for all PathGraph implementations.


Constructor & Destructor Documentation

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.

Parameters:
minEdgeCost

Member Function Documentation

void RAIN.Path.PathGraph.AddEdge ( int  fromIndex,
int  toIndex,
float  staticCost 
)

Adds a directed edge to the graph.

Parameters:
fromIndexFrom graph node
toIndexTo graph node
staticCostStatic 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.

Parameters:
nodeList
cost
Returns:

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.

Parameters:
fromNodeIndexThe from node index
toNodeIndexThe to node index
Returns:
The heuristic cost of graph traversal between the two nodes.

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.

Parameters:
nodeIndexThe index of the graph node to localize
Returns:
The Vector3 position of the graph node

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.

Parameters:
indexThe index of the graph node to retrieve
Returns:
The path node associated with the specified index.

Reimplemented in RAIN.Path.NavGridMultiRegionGraph.

abstract int RAIN.Path.PathGraph.Quantize ( Vector3  location) [pure virtual]

Quantize determines the graph node associated with the location.

Parameters:
locationVector3 position of the point to quantize
Returns:
The graph node index of the quantization point

Implemented in RAIN.Path.VectorPathGraph, and RAIN.Path.NavGridMultiRegionGraph.


Member Data Documentation

int RAIN.Path.PathGraph._nodeCount = 0 [protected]

A path node count, usually equal to _pathNodes.Length.

_pathNodes is an array of path graph nodes that can be referenced by their array index


Property Documentation

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.