#include <Pathfinder.h>
Definition at line 59 of file Pathfinder.h.
Pathfinder::Pathfinder | ( | ) |
Pathfinder::~Pathfinder | ( | ) |
Definition at line 123 of file Pathfinder.cpp.
References expandednodes, expandtime, nodelist, and pout.
bool Pathfinder::canReach | ( | ) |
try to reach the target by pathfinding
Definition at line 177 of file Pathfinder.cpp.
References pathfind().
bool Pathfinder::checkTarget | ( | PathNode * | node | ) | [protected] |
Definition at line 196 of file Pathfinder.cpp.
References actor, PathfindingState::checkHit(), PathfindingState::checkItem(), PathfindingState::checkPoint(), hitmode, PathNode::state, targetitem, targetx, targety, and targetz.
Referenced by newNode(), and pathfind().
void Pathfinder::ConCmd_visualDebug | ( | const Console::ArgvType & | argv | ) | [static] |
"visualDebug" console command
Definition at line 653 of file Pathfinder.cpp.
References pout, and visualdebug_actor.
Referenced by GUIApp::shutdownGame(), and GUIApp::startupGame().
unsigned int Pathfinder::costHeuristic | ( | PathNode * | node | ) | [protected] |
Definition at line 212 of file Pathfinder.cpp.
References actor_xd, actor_yd, PathNode::cost, PathNode::heuristicTotalCost, PathNode::state, targetx, targety, PathfindingState::x, and PathfindingState::y.
Referenced by newNode().
void Pathfinder::expandNode | ( | PathNode * | node | ) | [protected] |
Definition at line 439 of file Pathfinder.cpp.
References actor, actor_xd, actor_yd, Animation::advance, alreadyVisited(), PathfindingState::combat, PathfindingState::direction, AnimationTracker::evaluateMaxAnimTravel(), expandednodes, AnimationTracker::init(), AnimationTracker::isDone(), Actor::isInCombat(), PathfindingState::lastanim, newNode(), PathNode::state, AnimationTracker::step(), targetitem, targetx, targety, AnimationTracker::updateState(), visited, Animation::walk, PathfindingState::x, PathfindingState::y, and PathfindingState::z.
Referenced by pathfind().
void Pathfinder::init | ( | Actor * | actor, | |
PathfindingState * | state = 0 | |||
) |
Definition at line 137 of file Pathfinder.cpp.
References actor, actor_xd, actor_yd, actor_zd, Item::getFootpadWorld(), PathfindingState::load(), and start.
Referenced by PathfinderProcess::PathfinderProcess(), and PathfinderProcess::run().
void Pathfinder::newNode | ( | PathNode * | oldnode, | |
PathfindingState & | state, | |||
unsigned int | steps | |||
) | [protected] |
Definition at line 370 of file Pathfinder.cpp.
References actor, RenderSurface::BeginPainting(), checkTarget(), PathNode::cost, costHeuristic(), PathNode::depth, PathfindingState::direction, drawpath(), GUIApp::get_instance(), Object::getObjId(), GUIApp::getScreen(), PathNode::heuristicTotalCost, nodelist, nodes, PathNode::parent, perr, PathNode::state, PathNode::stepsfromparent, visualdebug_actor, PathfindingState::x, PathfindingState::y, and PathfindingState::z.
Referenced by expandNode().
bool Pathfinder::pathfind | ( | std::vector< PathfindingAction > & | path | ) |
pathfind. If true, the found path is returned in path
constant
constant
Definition at line 526 of file Pathfinder.cpp.
References PathfindingAction::action, actor, RenderSurface::BeginPainting(), checkTarget(), Animation::combatStand, PathNode::cost, PathNode::depth, PathfindingAction::direction, drawbox(), drawdot(), Item::dumpInfo(), expandednodes, expandNode(), expandtime, GUIApp::get_instance(), Object::getObjId(), GUIApp::getScreen(), n, nodelist, nodes, PathNode::parent, pout, Animation::stand, start, PathNode::state, PathfindingAction::steps, PathNode::stepsfromparent, targetitem, targetx, targety, targetz, and visualdebug_actor.
Referenced by canReach(), PathfinderProcess::PathfinderProcess(), and PathfinderProcess::run().
void Pathfinder::setTarget | ( | Item * | item, | |
bool | hit = false | |||
) |
Definition at line 158 of file Pathfinder.cpp.
References PathfindingState::combat, Item::getCentre(), Item::getParentAsContainer(), Item::getZ(), hitmode, start, targetitem, targetx, targety, and targetz.
Definition at line 149 of file Pathfinder.cpp.
References hitmode, targetitem, targetx, targety, and targetz.
Referenced by PathfinderProcess::PathfinderProcess(), and PathfinderProcess::run().
Actor* Pathfinder::actor [protected] |
Definition at line 84 of file Pathfinder.h.
Referenced by checkTarget(), expandNode(), init(), newNode(), and pathfind().
sint32 Pathfinder::actor_xd [protected] |
Definition at line 90 of file Pathfinder.h.
Referenced by costHeuristic(), expandNode(), and init().
sint32 Pathfinder::actor_yd [protected] |
Definition at line 90 of file Pathfinder.h.
Referenced by costHeuristic(), expandNode(), and init().
sint32 Pathfinder::actor_zd [protected] |
sint32 Pathfinder::expandtime [protected] |
bool Pathfinder::hitmode [protected] |
std::list<PathNode*> Pathfinder::nodelist [protected] |
std::priority_queue<PathNode*,std::vector<PathNode*>,PathNodeCmp> Pathfinder::nodes [protected] |
PathfindingState Pathfinder::start [protected] |
Item* Pathfinder::targetitem [protected] |
Definition at line 86 of file Pathfinder.h.
Referenced by checkTarget(), expandNode(), pathfind(), and setTarget().
sint32 Pathfinder::targetx [protected] |
Definition at line 85 of file Pathfinder.h.
Referenced by checkTarget(), costHeuristic(), expandNode(), pathfind(), and setTarget().
sint32 Pathfinder::targety [protected] |
Definition at line 85 of file Pathfinder.h.
Referenced by checkTarget(), costHeuristic(), expandNode(), pathfind(), and setTarget().
sint32 Pathfinder::targetz [protected] |
Definition at line 85 of file Pathfinder.h.
Referenced by checkTarget(), pathfind(), and setTarget().
std::list<PathfindingState> Pathfinder::visited [protected] |
ObjId Pathfinder::visualdebug_actor = 0xFFFF [static] |
Definition at line 78 of file Pathfinder.h.
Referenced by ConCmd_visualDebug(), newNode(), and pathfind().