You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
953 B
C++
35 lines
953 B
C++
#ifndef GAME_MWMECHANICS_PATHFINDING_H
|
|
#define GAME_MWMECHANICS_PATHFINDING_H
|
|
|
|
#include <components/esm/loadpgrd.hpp>
|
|
#include <list>
|
|
|
|
namespace MWMechanics
|
|
{
|
|
class PathFinder
|
|
{
|
|
public:
|
|
PathFinder();
|
|
|
|
void clearPath();
|
|
void buildPath(const ESM::Pathgrid::Point &startPoint, const ESM::Pathgrid::Point &endPoint,
|
|
const ESM::Pathgrid* pathGrid, float xCell = 0, float yCell = 0,
|
|
bool allowShortcuts = true);
|
|
|
|
bool checkPathCompleted(float x, float y, float z);
|
|
///< \Returns true if the last point of the path has been reached.
|
|
float getZAngleToNext(float x, float y) const;
|
|
|
|
bool isPathConstructed() const
|
|
{
|
|
return mIsPathConstructed;
|
|
}
|
|
|
|
private:
|
|
std::list<ESM::Pathgrid::Point> mPath;
|
|
bool mIsPathConstructed;
|
|
};
|
|
}
|
|
|
|
#endif
|