1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-16 17:29:55 +00:00

Remove redundant RecastMeshManager::Water

This commit is contained in:
elsid 2021-07-14 21:39:39 +02:00
parent a1549321d7
commit da4ec31cd8
No known key found for this signature in database
GPG key ID: B845CB9FEE18AB40
6 changed files with 7 additions and 12 deletions

View file

@ -42,7 +42,7 @@ namespace DetourNavigator
return true;
}
std::optional<RecastMeshManager::Water> CachedRecastMeshManager::removeWater(const osg::Vec2i& cellPosition)
std::optional<Water> CachedRecastMeshManager::removeWater(const osg::Vec2i& cellPosition)
{
const auto water = mImpl.removeWater(cellPosition);
if (water)

View file

@ -18,7 +18,7 @@ namespace DetourNavigator
bool addWater(const osg::Vec2i& cellPosition, const int cellSize, const btTransform& transform);
std::optional<RecastMeshManager::Water> removeWater(const osg::Vec2i& cellPosition);
std::optional<Water> removeWater(const osg::Vec2i& cellPosition);
std::optional<RemovedRecastMeshObject> removeObject(const ObjectId id);

View file

@ -56,7 +56,7 @@ namespace DetourNavigator
return true;
}
std::optional<RecastMeshManager::Water> RecastMeshManager::removeWater(const osg::Vec2i& cellPosition)
std::optional<Water> RecastMeshManager::removeWater(const osg::Vec2i& cellPosition)
{
const auto water = mWater.find(cellPosition);
if (water == mWater.end())

View file

@ -4,6 +4,7 @@
#include "oscillatingrecastmeshobject.hpp"
#include "objectid.hpp"
#include "version.hpp"
#include "recastmesh.hpp"
#include <LinearMath/btTransform.h>
@ -29,12 +30,6 @@ namespace DetourNavigator
class RecastMeshManager
{
public:
struct Water
{
int mCellSize = 0;
btTransform mTransform;
};
RecastMeshManager(const Settings& settings, const TileBounds& bounds, std::size_t generation);
bool addObject(const ObjectId id, const btCollisionShape& shape, const btTransform& transform,

View file

@ -102,12 +102,12 @@ namespace DetourNavigator
return result;
}
std::optional<RecastMeshManager::Water> TileCachedRecastMeshManager::removeWater(const osg::Vec2i& cellPosition)
std::optional<Water> TileCachedRecastMeshManager::removeWater(const osg::Vec2i& cellPosition)
{
const auto object = mWaterTilesPositions.find(cellPosition);
if (object == mWaterTilesPositions.end())
return std::nullopt;
std::optional<RecastMeshManager::Water> result;
std::optional<Water> result;
for (const auto& tilePosition : object->second)
{
const auto tiles = mTiles.lock();

View file

@ -78,7 +78,7 @@ namespace DetourNavigator
bool addWater(const osg::Vec2i& cellPosition, const int cellSize, const btTransform& transform);
std::optional<RecastMeshManager::Water> removeWater(const osg::Vec2i& cellPosition);
std::optional<Water> removeWater(const osg::Vec2i& cellPosition);
std::shared_ptr<RecastMesh> getMesh(const TilePosition& tilePosition);