2021-07-13 22:03:10 +00:00
|
|
|
#include "preparednavmeshdata.hpp"
|
|
|
|
#include "preparednavmeshdatatuple.hpp"
|
2021-07-09 20:51:42 +00:00
|
|
|
#include "recast.hpp"
|
2021-07-13 22:03:10 +00:00
|
|
|
|
|
|
|
#include <Recast.h>
|
|
|
|
|
2021-08-05 22:05:09 +00:00
|
|
|
#include <cstring>
|
|
|
|
|
2021-07-13 22:03:10 +00:00
|
|
|
namespace
|
|
|
|
{
|
|
|
|
void initPolyMeshDetail(rcPolyMeshDetail& value) noexcept
|
|
|
|
{
|
|
|
|
value.meshes = nullptr;
|
|
|
|
value.verts = nullptr;
|
|
|
|
value.tris = nullptr;
|
|
|
|
value.nmeshes = 0;
|
|
|
|
value.nverts = 0;
|
|
|
|
value.ntris = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace DetourNavigator
|
|
|
|
{
|
|
|
|
PreparedNavMeshData::PreparedNavMeshData() noexcept
|
|
|
|
{
|
|
|
|
initPolyMeshDetail(mPolyMeshDetail);
|
|
|
|
}
|
|
|
|
|
2021-08-05 22:05:09 +00:00
|
|
|
PreparedNavMeshData::PreparedNavMeshData(const PreparedNavMeshData& other)
|
|
|
|
: mUserId(other.mUserId)
|
|
|
|
, mCellSize(other.mCellSize)
|
|
|
|
, mCellHeight(other.mCellHeight)
|
|
|
|
{
|
|
|
|
copyPolyMesh(other.mPolyMesh, mPolyMesh);
|
|
|
|
copyPolyMeshDetail(other.mPolyMeshDetail, mPolyMeshDetail);
|
|
|
|
}
|
|
|
|
|
2021-07-13 22:03:10 +00:00
|
|
|
PreparedNavMeshData::~PreparedNavMeshData() noexcept
|
|
|
|
{
|
|
|
|
freePolyMeshDetail(mPolyMeshDetail);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool operator==(const PreparedNavMeshData& lhs, const PreparedNavMeshData& rhs) noexcept
|
|
|
|
{
|
|
|
|
return makeTuple(lhs) == makeTuple(rhs);
|
|
|
|
}
|
|
|
|
}
|