mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-06 00:55:50 +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.
118 lines
3.3 KiB
C++
118 lines
3.3 KiB
C++
#ifndef OPENMW_COMPONENTS_DETOURNAVIGATOR_NAVIGATORSTUB_H
|
|
#define OPENMW_COMPONENTS_DETOURNAVIGATOR_NAVIGATORSTUB_H
|
|
|
|
#include "navigator.hpp"
|
|
#include "settings.hpp"
|
|
|
|
namespace Loading
|
|
{
|
|
class Listener;
|
|
}
|
|
|
|
namespace DetourNavigator
|
|
{
|
|
class NavigatorStub final : public Navigator
|
|
{
|
|
public:
|
|
NavigatorStub() = default;
|
|
|
|
void addAgent(const AgentBounds& /*agentBounds*/) override {}
|
|
|
|
void removeAgent(const AgentBounds& /*agentBounds*/) override {}
|
|
|
|
void setWorldspace(std::string_view /*worldspace*/) override {}
|
|
|
|
bool addObject(const ObjectId /*id*/, const ObjectShapes& /*shapes*/, const btTransform& /*transform*/) override
|
|
{
|
|
return false;
|
|
}
|
|
|
|
bool addObject(const ObjectId /*id*/, const DoorShapes& /*shapes*/, const btTransform& /*transform*/) override
|
|
{
|
|
return false;
|
|
}
|
|
|
|
bool updateObject(const ObjectId /*id*/, const ObjectShapes& /*shapes*/, const btTransform& /*transform*/) override
|
|
{
|
|
return false;
|
|
}
|
|
|
|
bool updateObject(const ObjectId /*id*/, const DoorShapes& /*shapes*/, const btTransform& /*transform*/) override
|
|
{
|
|
return false;
|
|
}
|
|
|
|
bool removeObject(const ObjectId /*id*/) override
|
|
{
|
|
return false;
|
|
}
|
|
|
|
bool addWater(const osg::Vec2i& /*cellPosition*/, int /*cellSize*/, float /*level*/) override
|
|
{
|
|
return false;
|
|
}
|
|
|
|
bool removeWater(const osg::Vec2i& /*cellPosition*/) override
|
|
{
|
|
return false;
|
|
}
|
|
|
|
bool addHeightfield(const osg::Vec2i& /*cellPosition*/, int /*cellSize*/, const HeightfieldShape& /*height*/) override
|
|
{
|
|
return false;
|
|
}
|
|
|
|
bool removeHeightfield(const osg::Vec2i& /*cellPosition*/) override
|
|
{
|
|
return false;
|
|
}
|
|
|
|
void addPathgrid(const ESM::Cell& /*cell*/, const ESM::Pathgrid& /*pathgrid*/) override {}
|
|
|
|
void removePathgrid(const ESM::Pathgrid& /*pathgrid*/) override {}
|
|
|
|
void update(const osg::Vec3f& /*playerPosition*/) override {}
|
|
|
|
void updateBounds(const osg::Vec3f& /*playerPosition*/) override {}
|
|
|
|
void updatePlayerPosition(const osg::Vec3f& /*playerPosition*/) override {};
|
|
|
|
void setUpdatesEnabled(bool /*enabled*/) override {}
|
|
|
|
void wait(Loading::Listener& /*listener*/, WaitConditionType /*waitConditionType*/) override {}
|
|
|
|
SharedNavMeshCacheItem getNavMesh(const AgentBounds& /*agentBounds*/) const override
|
|
{
|
|
return mEmptyNavMeshCacheItem;
|
|
}
|
|
|
|
std::map<AgentBounds, SharedNavMeshCacheItem> getNavMeshes() const override
|
|
{
|
|
return {};
|
|
}
|
|
|
|
const Settings& getSettings() const override
|
|
{
|
|
return mDefaultSettings;
|
|
}
|
|
|
|
void reportStats(unsigned int /*frameNumber*/, osg::Stats& /*stats*/) const override {}
|
|
|
|
RecastMeshTiles getRecastMeshTiles() const override
|
|
{
|
|
return {};
|
|
}
|
|
|
|
float getMaxNavmeshAreaRealRadius() const override
|
|
{
|
|
return std::numeric_limits<float>::max();
|
|
}
|
|
|
|
private:
|
|
Settings mDefaultSettings {};
|
|
SharedNavMeshCacheItem mEmptyNavMeshCacheItem;
|
|
};
|
|
}
|
|
|
|
#endif
|