mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-31 23:15:43 +00:00
Merge branch 'navmesh_fixes' into 'master'
Minor navmesh fixes See merge request OpenMW/openmw!1114
This commit is contained in:
commit
0a73771f17
3 changed files with 7 additions and 2 deletions
|
@ -495,6 +495,10 @@ namespace DetourNavigator
|
||||||
params.maxPolys = 1 << polysBits;
|
params.maxPolys = 1 << polysBits;
|
||||||
|
|
||||||
NavMeshPtr navMesh(dtAllocNavMesh(), &dtFreeNavMesh);
|
NavMeshPtr navMesh(dtAllocNavMesh(), &dtFreeNavMesh);
|
||||||
|
|
||||||
|
if (navMesh == nullptr)
|
||||||
|
throw NavigatorException("Failed to allocate navmesh");
|
||||||
|
|
||||||
const auto status = navMesh->init(¶ms);
|
const auto status = navMesh->init(¶ms);
|
||||||
|
|
||||||
if (!dtStatusSucceed(status))
|
if (!dtStatusSucceed(status))
|
||||||
|
|
|
@ -20,7 +20,7 @@ namespace DetourNavigator
|
||||||
struct NavMeshData
|
struct NavMeshData
|
||||||
{
|
{
|
||||||
NavMeshDataValue mValue;
|
NavMeshDataValue mValue;
|
||||||
int mSize;
|
int mSize = 0;
|
||||||
|
|
||||||
NavMeshData() = default;
|
NavMeshData() = default;
|
||||||
|
|
||||||
|
|
|
@ -85,7 +85,8 @@ namespace DetourNavigator
|
||||||
out.setAttribute(frameNumber, "NavMesh CacheSize", stats.mNavMeshCacheSize);
|
out.setAttribute(frameNumber, "NavMesh CacheSize", stats.mNavMeshCacheSize);
|
||||||
out.setAttribute(frameNumber, "NavMesh UsedTiles", stats.mUsedNavMeshTiles);
|
out.setAttribute(frameNumber, "NavMesh UsedTiles", stats.mUsedNavMeshTiles);
|
||||||
out.setAttribute(frameNumber, "NavMesh CachedTiles", stats.mCachedNavMeshTiles);
|
out.setAttribute(frameNumber, "NavMesh CachedTiles", stats.mCachedNavMeshTiles);
|
||||||
out.setAttribute(frameNumber, "NavMesh CacheHitRate", static_cast<double>(stats.mHitCount) / stats.mGetCount * 100.0);
|
if (stats.mGetCount > 0)
|
||||||
|
out.setAttribute(frameNumber, "NavMesh CacheHitRate", static_cast<double>(stats.mHitCount) / stats.mGetCount * 100.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NavMeshTilesCache::removeLeastRecentlyUsed()
|
void NavMeshTilesCache::removeLeastRecentlyUsed()
|
||||||
|
|
Loading…
Reference in a new issue