mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-04 02:41:19 +00:00
1a12c453d6
Actors may have different collision shapes. Currently there are axis-aligned bounding boxes and rotating bounding boxes. With AABB it's required to use bounding cylinder for navmesh agent to avoid providing paths where actor can't pass. But for rotating bounding boxes cylinder with diameter equal to the front face width should be used to not reduce of available paths. For example rats have rotating bounding box as collision shape because of the difference between front and side faces width. * Add agent bounds to navmesh tile db cache key. This is required to distinguish tiles for agents with different bounds. * Increase navmesh version because navmesh tile db cache key and data has changed. * Move navmesh version to the code to avoid misconfiguration by users. * Fix all places where wrong half extents were used for pathfinding.
31 lines
956 B
C++
31 lines
956 B
C++
#ifndef OPENMW_COMPONENTS_DETOURNAVIGATOR_SERIALIZATION_H
|
|
#define OPENMW_COMPONENTS_DETOURNAVIGATOR_SERIALIZATION_H
|
|
|
|
#include <cstddef>
|
|
#include <cstdint>
|
|
#include <vector>
|
|
|
|
namespace DetourNavigator
|
|
{
|
|
class RecastMesh;
|
|
struct DbRefGeometryObject;
|
|
struct PreparedNavMeshData;
|
|
struct RecastSettings;
|
|
struct AgentBounds;
|
|
|
|
constexpr char recastMeshMagic[] = {'r', 'c', 's', 't'};
|
|
constexpr std::uint32_t recastMeshVersion = 2;
|
|
|
|
constexpr char preparedNavMeshDataMagic[] = {'p', 'n', 'a', 'v'};
|
|
constexpr std::uint32_t preparedNavMeshDataVersion = 1;
|
|
|
|
std::vector<std::byte> serialize(const RecastSettings& settings, const AgentBounds& agentBounds,
|
|
const RecastMesh& recastMesh, const std::vector<DbRefGeometryObject>& dbRefGeometryObjects);
|
|
|
|
std::vector<std::byte> serialize(const PreparedNavMeshData& value);
|
|
|
|
bool deserialize(const std::vector<std::byte>& data, PreparedNavMeshData& value);
|
|
}
|
|
|
|
#endif
|