2013-03-31 17:30:03 +00:00
|
|
|
#ifndef GAME_MWMECHANICS_PATHFINDING_H
|
|
|
|
#define GAME_MWMECHANICS_PATHFINDING_H
|
|
|
|
|
|
|
|
#include <components/esm/loadpgrd.hpp>
|
|
|
|
#include <list>
|
|
|
|
|
|
|
|
namespace MWMechanics
|
|
|
|
{
|
|
|
|
class PathFinder
|
|
|
|
{
|
2013-05-29 22:59:23 +00:00
|
|
|
public:
|
|
|
|
PathFinder();
|
2013-03-31 17:30:03 +00:00
|
|
|
|
2013-05-29 22:59:23 +00:00
|
|
|
void clearPath();
|
2013-05-30 02:26:45 +00:00
|
|
|
void buildPath(ESM::Pathgrid::Point startPoint, ESM::Pathgrid::Point endPoint,
|
2013-05-30 03:05:17 +00:00
|
|
|
const ESM::Pathgrid* pathGrid, float xCell = 0, float yCell = 0, bool allowShortcuts = 1);
|
2013-03-31 17:30:03 +00:00
|
|
|
|
2013-05-30 03:05:17 +00:00
|
|
|
bool checkPathCompleted(float x, float y, float z);
|
2013-05-30 00:33:33 +00:00
|
|
|
///< \Returns true if the last point of the path has been reached.
|
2013-05-30 02:26:45 +00:00
|
|
|
float getZAngleToNext(float x, float y);
|
2013-03-31 17:30:03 +00:00
|
|
|
|
2013-05-29 22:59:23 +00:00
|
|
|
std::list<ESM::Pathgrid::Point> getPath();
|
|
|
|
bool isPathConstructed();
|
2013-03-31 17:30:03 +00:00
|
|
|
|
2013-05-29 22:59:23 +00:00
|
|
|
private:
|
|
|
|
std::list<ESM::Pathgrid::Point> mPath;
|
|
|
|
bool mIsPathConstructed;
|
2013-03-31 17:30:03 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2013-05-29 22:59:23 +00:00
|
|
|
#endif
|