#include <hpaStar.h>
Inheritance diagram for hpaStar:
Public Types | |
enum | Direction { NORTH, EAST, SOUTH, WEST, NE, SE, SW, NW } |
enum | SmoothType { BEGIN, END, TWO_BACK } |
Public Member Functions | |
hpaStar () | |
virtual | ~hpaStar () |
virtual path * | getPath (graphAbstraction *aMap, node *from, node *to, reservationProvider *rp=0) |
Returns the HPA* path between from and to. | |
virtual const char * | getName () |
void | setUpSearch (node *from, node *to) |
path * | findAbstractPath (node *from, node *to) |
path * | findMapPath (path *abPath, node *from, node *to) |
void | cleanUpSearch () |
Remove the start & goal nodes from the graph. | |
path * | smoothPath (path *p) |
from HPA* smoothwizard.cpp | |
void | setSmoothing (bool smooth) |
Set whether we want to do path smoothing. | |
void | setPartialPathLimit (int limit) |
int | getPartialPathLimit () |
void | setSmoothType (SmoothType s) |
Set the smoothing type. | |
void | setAbstraction (clusterAbstraction *_m) |
Protected Member Functions | |
path * | nextPathNode (node *n, int dir) |
shoot a ray in direction dir and see if you hit the path Return the better path if you find it; 0 if you hit a wall or obstacle (ie. | |
node * | getNextNode (int x, int y, int dir) |
get the next node from map coordinates (x,y) in direction dir. | |
bool | nextInLookup (int last, int curr, std::vector< node * > lookup) |
find out whether last is the next 'real' index in the lookup table after curr. | |
int | backTwoNodes (int i, std::vector< node * > lookup) |
Find the index of the node two nodes back in the path. | |
void | findMinMax (path *p) |
Protected Attributes | |
char | algName [30] |
clusterAbstraction * | m |
int | partialLimit |
node * | fromnum |
node * | tonum |
std::vector< node * > | lookup |
bool | smoothing |
SmoothType | smType |
int | minx |
int | maxx |
int | miny |
int | maxy |
Needs a clusterAbstraction to run - use setAbstraction before doing any pathfinding
|
|
|
|
|
|
|
|
|
Find the index of the node two nodes back in the path.
|
|
Remove the start & goal nodes from the graph.
|
|
|
|
|
|
|
|
Implements searchAlgorithm. |
|
get the next node from map coordinates (x,y) in direction dir. Will return 0 if there's no node here. |
|
|
|
Returns the HPA* path between from and to. Before calling this function, set the abstraction with hpaStar::setAbstraction. The abstraction must be of type clusterAbstraction. Reservation provider isn't used Implements searchAlgorithm. |
|
find out whether last is the next 'real' index in the lookup table after curr. This is to make sure we don't keep replacing little paths due to null's in the lookup table. |
|
shoot a ray in direction dir and see if you hit the path Return the better path if you find it; 0 if you hit a wall or obstacle (ie. if you won't find the path) |
|
|
|
|
|
Set whether we want to do path smoothing. Default is true. |
|
Set the smoothing type. Whenever we update the path with a better subpath, if s = BEGIN, smoothing is restarted from the beginning of this subpath if s = END, smoothing is restarted from the end of the new subpath if s = TWO_BACK, we go back two from the end of the new subpath |
|
|
|
from HPA* smoothwizard.cpp smoothen the path by replacing parts of the path by straight lines. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|