mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-29 08:15:35 +00:00
Remove redundant RecastMeshManager::Water
This commit is contained in:
parent
a1549321d7
commit
da4ec31cd8
6 changed files with 7 additions and 12 deletions
|
@ -42,7 +42,7 @@ namespace DetourNavigator
|
||||||
return true;
|
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);
|
const auto water = mImpl.removeWater(cellPosition);
|
||||||
if (water)
|
if (water)
|
||||||
|
|
|
@ -18,7 +18,7 @@ namespace DetourNavigator
|
||||||
|
|
||||||
bool addWater(const osg::Vec2i& cellPosition, const int cellSize, const btTransform& transform);
|
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);
|
std::optional<RemovedRecastMeshObject> removeObject(const ObjectId id);
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ namespace DetourNavigator
|
||||||
return true;
|
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);
|
const auto water = mWater.find(cellPosition);
|
||||||
if (water == mWater.end())
|
if (water == mWater.end())
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
#include "oscillatingrecastmeshobject.hpp"
|
#include "oscillatingrecastmeshobject.hpp"
|
||||||
#include "objectid.hpp"
|
#include "objectid.hpp"
|
||||||
#include "version.hpp"
|
#include "version.hpp"
|
||||||
|
#include "recastmesh.hpp"
|
||||||
|
|
||||||
#include <LinearMath/btTransform.h>
|
#include <LinearMath/btTransform.h>
|
||||||
|
|
||||||
|
@ -29,12 +30,6 @@ namespace DetourNavigator
|
||||||
class RecastMeshManager
|
class RecastMeshManager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
struct Water
|
|
||||||
{
|
|
||||||
int mCellSize = 0;
|
|
||||||
btTransform mTransform;
|
|
||||||
};
|
|
||||||
|
|
||||||
RecastMeshManager(const Settings& settings, const TileBounds& bounds, std::size_t generation);
|
RecastMeshManager(const Settings& settings, const TileBounds& bounds, std::size_t generation);
|
||||||
|
|
||||||
bool addObject(const ObjectId id, const btCollisionShape& shape, const btTransform& transform,
|
bool addObject(const ObjectId id, const btCollisionShape& shape, const btTransform& transform,
|
||||||
|
|
|
@ -102,12 +102,12 @@ namespace DetourNavigator
|
||||||
return result;
|
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);
|
const auto object = mWaterTilesPositions.find(cellPosition);
|
||||||
if (object == mWaterTilesPositions.end())
|
if (object == mWaterTilesPositions.end())
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
std::optional<RecastMeshManager::Water> result;
|
std::optional<Water> result;
|
||||||
for (const auto& tilePosition : object->second)
|
for (const auto& tilePosition : object->second)
|
||||||
{
|
{
|
||||||
const auto tiles = mTiles.lock();
|
const auto tiles = mTiles.lock();
|
||||||
|
|
|
@ -78,7 +78,7 @@ namespace DetourNavigator
|
||||||
|
|
||||||
bool addWater(const osg::Vec2i& cellPosition, const int cellSize, const btTransform& transform);
|
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);
|
std::shared_ptr<RecastMesh> getMesh(const TilePosition& tilePosition);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue