2018-04-15 19:54:45 +00:00
|
|
|
#ifndef OPENMW_COMPONENTS_DETOURNAVIGATOR_GETTILESPOSITIONS_H
|
|
|
|
#define OPENMW_COMPONENTS_DETOURNAVIGATOR_GETTILESPOSITIONS_H
|
|
|
|
|
2022-01-25 14:06:53 +00:00
|
|
|
#include "tilebounds.hpp"
|
2018-04-20 23:57:01 +00:00
|
|
|
#include "tileposition.hpp"
|
2018-04-15 19:54:45 +00:00
|
|
|
|
2022-01-25 14:06:53 +00:00
|
|
|
class btVector3;
|
|
|
|
class btTransform;
|
|
|
|
class btCollisionShape;
|
2019-02-28 20:03:42 +00:00
|
|
|
|
2022-01-25 14:06:53 +00:00
|
|
|
namespace osg
|
|
|
|
{
|
|
|
|
class Vec3f;
|
|
|
|
}
|
2018-04-15 19:54:45 +00:00
|
|
|
|
|
|
|
namespace DetourNavigator
|
|
|
|
{
|
2022-01-25 14:06:53 +00:00
|
|
|
struct RecastSettings;
|
2018-04-15 19:54:45 +00:00
|
|
|
|
2022-01-25 14:06:53 +00:00
|
|
|
struct TilesPositionsRange
|
|
|
|
{
|
|
|
|
TilePosition mMin;
|
|
|
|
TilePosition mMax;
|
|
|
|
};
|
2018-04-15 19:54:45 +00:00
|
|
|
|
2022-01-25 14:06:53 +00:00
|
|
|
TilesPositionsRange makeTilesPositionsRange(const osg::Vec3f& aabbMin,
|
|
|
|
const osg::Vec3f& aabbMax, const RecastSettings& settings);
|
2018-04-15 19:54:45 +00:00
|
|
|
|
2022-01-25 14:06:53 +00:00
|
|
|
TilesPositionsRange makeTilesPositionsRange(const btCollisionShape& shape,
|
|
|
|
const btTransform& transform, const TileBounds& bounds, const RecastSettings& settings);
|
2018-04-15 19:54:45 +00:00
|
|
|
|
2022-01-25 14:06:53 +00:00
|
|
|
TilesPositionsRange makeTilesPositionsRange(const int cellSize, const btVector3& shift,
|
|
|
|
const RecastSettings& settings);
|
2018-04-15 19:54:45 +00:00
|
|
|
|
|
|
|
template <class Callback>
|
2022-01-25 14:06:53 +00:00
|
|
|
void getTilesPositions(const TilesPositionsRange& range, Callback&& callback)
|
2018-04-15 19:54:45 +00:00
|
|
|
{
|
2022-01-25 14:06:53 +00:00
|
|
|
for (int tileX = range.mMin.x(); tileX <= range.mMax.x(); ++tileX)
|
|
|
|
for (int tileY = range.mMin.y(); tileY <= range.mMax.y(); ++tileY)
|
|
|
|
callback(TilePosition {tileX, tileY});
|
2018-07-20 19:11:34 +00:00
|
|
|
}
|
2018-04-15 19:54:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|