mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-24 18:39:59 +00:00
Do not track last build revision in RecastMeshManger
mLastBuildRevision == mRevision with current use cases does not happen. But even if this will happen when another use case will be added it does not save much computation. The most expensive operation is not adding objects to the MeshBuilder but to optimize resulting navmesh that will happen anyway in MeshBuilder::create call.
This commit is contained in:
parent
62f32f4543
commit
629cedb6d0
@ -74,7 +74,7 @@ namespace DetourNavigator
|
||||
std::shared_ptr<RecastMesh> RecastMeshManager::getMesh()
|
||||
{
|
||||
rebuild();
|
||||
return mMeshBuilder.create(mGeneration, mLastBuildRevision);
|
||||
return mMeshBuilder.create(mGeneration, mRevision);
|
||||
}
|
||||
|
||||
bool RecastMeshManager::isEmpty() const
|
||||
@ -84,13 +84,10 @@ namespace DetourNavigator
|
||||
|
||||
void RecastMeshManager::rebuild()
|
||||
{
|
||||
if (mLastBuildRevision == mRevision)
|
||||
return;
|
||||
mMeshBuilder.reset();
|
||||
for (const auto& v : mWaterOrder)
|
||||
mMeshBuilder.addWater(v.mCellSize, v.mTransform);
|
||||
for (const auto& v : mObjectsOrder)
|
||||
mMeshBuilder.addObject(v.getShape(), v.getTransform(), v.getAreaType());
|
||||
mLastBuildRevision = mRevision;
|
||||
}
|
||||
}
|
||||
|
@ -52,7 +52,6 @@ namespace DetourNavigator
|
||||
|
||||
private:
|
||||
std::size_t mRevision = 0;
|
||||
std::size_t mLastBuildRevision = 0;
|
||||
std::size_t mGeneration;
|
||||
RecastMeshBuilder mMeshBuilder;
|
||||
std::list<RecastMeshObject> mObjectsOrder;
|
||||
|
Loading…
x
Reference in New Issue
Block a user