1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-16 18:29:55 +00:00
openmw/components/detournavigator/preparednavmeshdata.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

50 lines
1.5 KiB
C++
Raw Normal View History

#ifndef OPENMW_COMPONENTS_DETOURNAVIGATOR_PREPAREDNAVMESHDATA_H
#define OPENMW_COMPONENTS_DETOURNAVIGATOR_PREPAREDNAVMESHDATA_H
#include "recast.hpp"
#include <Recast.h>
#include <cstddef>
namespace DetourNavigator
{
struct PreparedNavMeshData
{
unsigned int mUserId = 0;
float mCellSize = 0;
float mCellHeight = 0;
rcPolyMesh mPolyMesh;
rcPolyMeshDetail mPolyMeshDetail;
PreparedNavMeshData() noexcept;
PreparedNavMeshData(const PreparedNavMeshData& other);
~PreparedNavMeshData() noexcept;
2022-08-11 22:09:49 +00:00
PreparedNavMeshData& operator=(const PreparedNavMeshData& other) = delete;
friend bool operator==(const PreparedNavMeshData& lhs, const PreparedNavMeshData& rhs) noexcept;
};
inline constexpr std::size_t getSize(const rcPolyMesh& value) noexcept
{
return getVertsLength(value) * sizeof(*value.verts) + getPolysLength(value) * sizeof(*value.polys)
+ getRegsLength(value) * sizeof(*value.regs) + getFlagsLength(value) * sizeof(*value.flags)
+ getAreasLength(value) * sizeof(*value.areas);
}
inline constexpr std::size_t getSize(const rcPolyMeshDetail& value) noexcept
{
return getMeshesLength(value) * sizeof(*value.meshes) + getVertsLength(value) * sizeof(*value.verts)
+ getTrisLength(value) * sizeof(*value.tris);
}
inline constexpr std::size_t getSize(const PreparedNavMeshData& value) noexcept
{
return getSize(value.mPolyMesh) + getSize(value.mPolyMeshDetail);
}
}
#endif