aboutsummaryrefslogtreecommitdiff
path: root/dep/recastnavigation/Detour/DetourNavMeshQuery.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'dep/recastnavigation/Detour/DetourNavMeshQuery.cpp')
-rw-r--r--dep/recastnavigation/Detour/DetourNavMeshQuery.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/dep/recastnavigation/Detour/DetourNavMeshQuery.cpp b/dep/recastnavigation/Detour/DetourNavMeshQuery.cpp
index e6557cf707e..bdbee004834 100644
--- a/dep/recastnavigation/Detour/DetourNavMeshQuery.cpp
+++ b/dep/recastnavigation/Detour/DetourNavMeshQuery.cpp
@@ -16,13 +16,13 @@
// 3. This notice may not be removed or altered from any source distribution.
//
-#include <math.h>
#include <float.h>
#include <string.h>
#include "DetourNavMeshQuery.h"
#include "DetourNavMesh.h"
#include "DetourNode.h"
#include "DetourCommon.h"
+#include "DetourMath.h"
#include "DetourAlloc.h"
#include "DetourAssert.h"
#include <new>
@@ -99,9 +99,8 @@ inline float dtQueryFilter::getCost(const float* pa, const float* pb,
return dtVdist(pa, pb) * m_areaCost[curPoly->getArea()];
}
#endif
-
-// Edited by TC
-static const float H_SCALE = 2.0f; // Search heuristic scale.
+
+static const float H_SCALE = 0.999f; // Search heuristic scale.
dtNavMeshQuery* dtAllocNavMeshQuery()
@@ -511,11 +510,7 @@ dtStatus dtNavMeshQuery::closestPointOnPoly(dtPolyRef ref, const float* pos, flo
return DT_FAILURE | DT_INVALID_PARAM;
if (!tile)
return DT_FAILURE | DT_INVALID_PARAM;
-
- // Edited by TC
- if (poly->getType() == DT_POLYTYPE_OFFMESH_CONNECTION)
- return DT_FAILURE;
-
+
closestPointOnPolyInTile(tile, poly, pos, closest);
return DT_SUCCESS;
@@ -3347,7 +3342,7 @@ dtStatus dtNavMeshQuery::findDistanceToWall(dtPolyRef startRef, const float* cen
dtVsub(hitNormal, centerPos, hitPos);
dtVnormalize(hitNormal);
- *hitDist = dtSqrt(radiusSqr);
+ *hitDist = dtMathSqrtf(radiusSqr);
return status;
}