Use camel case for local constant

pull/593/head
elsid 4 years ago
parent a7fe6c7ba1
commit 3a9b1ce63a
No known key found for this signature in database
GPG Key ID: B845CB9FEE18AB40

@ -108,13 +108,13 @@ namespace DetourNavigator
{
// Find steer target.
SteerTarget result;
const int MAX_STEER_POINTS = 3;
std::array<float, MAX_STEER_POINTS * 3> steerPath;
std::array<unsigned char, MAX_STEER_POINTS> steerPathFlags;
std::array<dtPolyRef, MAX_STEER_POINTS> steerPathPolys;
constexpr int maxSteerPoints = 3;
std::array<float, maxSteerPoints * 3> steerPath;
std::array<unsigned char, maxSteerPoints> steerPathFlags;
std::array<dtPolyRef, maxSteerPoints> steerPathPolys;
int nsteerPath = 0;
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);
if (!nsteerPath)
return std::nullopt;

@ -166,7 +166,7 @@ namespace DetourNavigator
osg::Vec3f targetPos;
navMeshQuery.closestPointOnPoly(polygonPath.back(), end.ptr(), targetPos.ptr(), nullptr);
const float SLOP = 0.01f;
constexpr float slop = 0.01f;
*out++ = iterPos;
@ -177,7 +177,7 @@ namespace DetourNavigator
while (!polygonPath.empty() && smoothPathSize < maxSmoothPathSize)
{
// 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)
break;
@ -209,7 +209,7 @@ namespace DetourNavigator
iterPos.y() = h;
// 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.
iterPos = targetPos;
@ -217,7 +217,7 @@ namespace DetourNavigator
++smoothPathSize;
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.
dtPolyRef prevRef = 0;

Loading…
Cancel
Save