1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-09 21:42:13 +00:00
OpenMW/apps/openmw/mwmechanics/pathfinding.hpp

47 lines
1.3 KiB
C++
Raw Normal View History

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
{
public:
PathFinder();
2013-03-31 17:30:03 +00:00
void clearPath();
2013-08-30 02:17:27 +00:00
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);
2013-03-31 17:30:03 +00:00
bool checkPathCompleted(float x, float y, float z);
///< \Returns true if the last point of the path has been reached.
2013-10-07 08:20:02 +00:00
bool checkWaypoint(float x, float y, float z);
///< \Returns true if a way point was reached
2013-08-30 02:17:27 +00:00
float getZAngleToNext(float x, float y) const;
2013-03-31 17:30:03 +00:00
2013-08-30 02:17:27 +00:00
bool isPathConstructed() const
{
return mIsPathConstructed;
}
2013-03-31 17:30:03 +00:00
2013-10-07 08:20:02 +00:00
int getPathSize() const
{
return mPath.size();
}
std::list<ESM::Pathgrid::Point> getPath() const
{
return mPath;
}
private:
std::list<ESM::Pathgrid::Point> mPath;
bool mIsPathConstructed;
2013-03-31 17:30:03 +00:00
};
}
#endif