2021-07-13 22:03:10 +00:00
|
|
|
#ifndef OPENMW_COMPONENTS_DETOURNAVIGATOR_PREPAREDNAVMESHDATATUPLE_H
|
|
|
|
#define OPENMW_COMPONENTS_DETOURNAVIGATOR_PREPAREDNAVMESHDATATUPLE_H
|
|
|
|
|
|
|
|
#include "preparednavmeshdata.hpp"
|
|
|
|
#include "ref.hpp"
|
2021-07-26 18:18:01 +00:00
|
|
|
#include "recast.hpp"
|
2021-07-13 22:03:10 +00:00
|
|
|
|
|
|
|
#include <Recast.h>
|
|
|
|
|
|
|
|
#include <tuple>
|
|
|
|
|
|
|
|
namespace DetourNavigator
|
|
|
|
{
|
|
|
|
constexpr auto makeTuple(const rcPolyMesh& v) noexcept
|
|
|
|
{
|
|
|
|
return std::tuple(
|
2021-10-24 14:45:46 +00:00
|
|
|
Span(v.verts, static_cast<int>(getVertsLength(v))),
|
|
|
|
Span(v.polys, static_cast<int>(getPolysLength(v))),
|
|
|
|
Span(v.regs, static_cast<int>(getRegsLength(v))),
|
|
|
|
Span(v.flags, static_cast<int>(getFlagsLength(v))),
|
|
|
|
Span(v.areas, static_cast<int>(getAreasLength(v))),
|
2021-07-13 22:03:10 +00:00
|
|
|
ArrayRef(v.bmin),
|
|
|
|
ArrayRef(v.bmax),
|
|
|
|
v.cs,
|
|
|
|
v.ch,
|
|
|
|
v.borderSize,
|
|
|
|
v.maxEdgeError
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
constexpr auto makeTuple(const rcPolyMeshDetail& v) noexcept
|
|
|
|
{
|
|
|
|
return std::tuple(
|
2021-10-24 14:45:46 +00:00
|
|
|
Span(v.meshes, static_cast<int>(getMeshesLength(v))),
|
|
|
|
Span(v.verts, static_cast<int>(getVertsLength(v))),
|
|
|
|
Span(v.tris, static_cast<int>(getTrisLength(v)))
|
2021-07-13 22:03:10 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
constexpr auto makeTuple(const PreparedNavMeshData& v) noexcept
|
|
|
|
{
|
|
|
|
return std::tuple(
|
|
|
|
v.mUserId,
|
|
|
|
v.mCellHeight,
|
|
|
|
v.mCellSize,
|
|
|
|
Ref(v.mPolyMesh),
|
|
|
|
Ref(v.mPolyMeshDetail)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|