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;
|
||||
|
||||
NavMeshPtr navMesh(dtAllocNavMesh(), &dtFreeNavMesh);
|
||||
|
||||
if (navMesh == nullptr)
|
||||
throw NavigatorException("Failed to allocate navmesh");
|
||||
|
||||
const auto status = navMesh->init(¶ms);
|
||||
|
||||
if (!dtStatusSucceed(status))
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace DetourNavigator
|
|||
struct NavMeshData
|
||||
{
|
||||
NavMeshDataValue mValue;
|
||||
int mSize;
|
||||
int mSize = 0;
|
||||
|
||||
NavMeshData() = default;
|
||||
|
||||
|
|
|
@ -85,6 +85,7 @@ namespace DetourNavigator
|
|||
out.setAttribute(frameNumber, "NavMesh CacheSize", stats.mNavMeshCacheSize);
|
||||
out.setAttribute(frameNumber, "NavMesh UsedTiles", stats.mUsedNavMeshTiles);
|
||||
out.setAttribute(frameNumber, "NavMesh CachedTiles", stats.mCachedNavMeshTiles);
|
||||
if (stats.mGetCount > 0)
|
||||
out.setAttribute(frameNumber, "NavMesh CacheHitRate", static_cast<double>(stats.mHitCount) / stats.mGetCount * 100.0);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue