1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-07 00:45:34 +00:00

Use camel case for local constant

This commit is contained in:
elsid 2021-02-14 23:11:57 +01:00
parent a7fe6c7ba1
commit 3a9b1ce63a
No known key found for this signature in database
GPG key ID: B845CB9FEE18AB40
2 changed files with 9 additions and 9 deletions

View file

@ -108,13 +108,13 @@ namespace DetourNavigator
{ {
// Find steer target. // Find steer target.
SteerTarget result; SteerTarget result;
const int MAX_STEER_POINTS = 3; constexpr int maxSteerPoints = 3;
std::array<float, MAX_STEER_POINTS * 3> steerPath; std::array<float, maxSteerPoints * 3> steerPath;
std::array<unsigned char, MAX_STEER_POINTS> steerPathFlags; std::array<unsigned char, maxSteerPoints> steerPathFlags;
std::array<dtPolyRef, MAX_STEER_POINTS> steerPathPolys; std::array<dtPolyRef, maxSteerPoints> steerPathPolys;
int nsteerPath = 0; int nsteerPath = 0;
navQuery.findStraightPath(startPos.ptr(), endPos.ptr(), path.data(), int(path.size()), steerPath.data(), navQuery.findStraightPath(startPos.ptr(), endPos.ptr(), path.data(), int(path.size()), steerPath.data(),
steerPathFlags.data(), steerPathPolys.data(), &nsteerPath, MAX_STEER_POINTS); steerPathFlags.data(), steerPathPolys.data(), &nsteerPath, maxSteerPoints);
assert(nsteerPath >= 0); assert(nsteerPath >= 0);
if (!nsteerPath) if (!nsteerPath)
return std::nullopt; return std::nullopt;

View file

@ -166,7 +166,7 @@ namespace DetourNavigator
osg::Vec3f targetPos; osg::Vec3f targetPos;
navMeshQuery.closestPointOnPoly(polygonPath.back(), end.ptr(), targetPos.ptr(), nullptr); navMeshQuery.closestPointOnPoly(polygonPath.back(), end.ptr(), targetPos.ptr(), nullptr);
const float SLOP = 0.01f; constexpr float slop = 0.01f;
*out++ = iterPos; *out++ = iterPos;
@ -177,7 +177,7 @@ namespace DetourNavigator
while (!polygonPath.empty() && smoothPathSize < maxSmoothPathSize) while (!polygonPath.empty() && smoothPathSize < maxSmoothPathSize)
{ {
// Find location to steer towards. // Find location to steer towards.
const auto steerTarget = getSteerTarget(navMeshQuery, iterPos, targetPos, SLOP, polygonPath); const auto steerTarget = getSteerTarget(navMeshQuery, iterPos, targetPos, slop, polygonPath);
if (!steerTarget) if (!steerTarget)
break; break;
@ -209,7 +209,7 @@ namespace DetourNavigator
iterPos.y() = h; iterPos.y() = h;
// Handle end of path and off-mesh links when close enough. // Handle end of path and off-mesh links when close enough.
if (endOfPath && inRange(iterPos, steerTarget->steerPos, SLOP, 1.0f)) if (endOfPath && inRange(iterPos, steerTarget->steerPos, slop, 1.0f))
{ {
// Reached end of path. // Reached end of path.
iterPos = targetPos; iterPos = targetPos;
@ -217,7 +217,7 @@ namespace DetourNavigator
++smoothPathSize; ++smoothPathSize;
break; break;
} }
else if (offMeshConnection && inRange(iterPos, steerTarget->steerPos, SLOP, 1.0f)) else if (offMeshConnection && inRange(iterPos, steerTarget->steerPos, slop, 1.0f))
{ {
// Advance the path up to and over the off-mesh connection. // Advance the path up to and over the off-mesh connection.
dtPolyRef prevRef = 0; dtPolyRef prevRef = 0;