Ground color is changed back to the previous default color, and the road
color is changed to a dark shade of brown that is a bit easier to
differentiate with normal input geometry.
In U and A shaped terrain it was possible that polygons extruded their
BV-tree nodes significantly. This happened because all points for the
polygon (when excluding the detail mesh) were either on the high-level
terrain, or on the low-level terrain. This fixes the long-standing todo
about this.
As a result of this change, findNearestPoly and queryPolygons should
return more accurate results.
Fix#230
When a point is outside the polygon being queried in
dtNavMesh::closestPointOnPoly and dtNavMeshQuery::closestPoinOnPoly,
Detour will interpolate along one of the edges to find the closest point
on the poly. However, Detour did not properly use the interpolated point
to find the correct height according to the detail mesh.
Fix#227
findPath was unconditionally overriding the status it used to indicate
DT_OUT_OF_NODES for later. Restore this behavior so it properly can
return this failure flag.
Fix#221
This adds a method to dtNavMeshQuery that allows users to retrieve paths
from the nodes explored by the previous Dijkstra search. This is useful
after Dijkstra searches to retrieve arbitrary paths inside the explored
area.
findPolysAroundCircle and findPolysAroundShape were only using distances
to compute the costs. This was inconsistent with other APIs that
performed cost-based searches and accepted filters as parameters.
This changes the Dijkstra searches in findPolysAroundCircle and
findPolysAroundShape to append the results when we visit nodes in the
main loop. The algorithm guarantees that we will never visit them again
after this, so at this point we are guaranteed that we cannot find a
better path.
Previously results would be appended the first time we saw a polygon
which meant later improvements on the paths to those polygons would not
be reflected in the results.
Fix#204
When creating the tile's links, offmesh connections inside the tile were
added twice, leading to the array of links being full and not being able
to store the links computed after (portals between tiles).
This changes dtTileCache::update to add an optional parameter that
indicates whether the tile cache is up to date. This is useful to
determine whether calling the function again would do anything.
These are by no means complete coverage of the functions they test, but are at least a start. For consistency, all floating point comparisons use Approx(), regardless of whether they need to or not.
Removed unnecessary C++11 unique_ptr stuff, now that rcHeightfield has a constructor and destructor.
These could lead to undefined behaviour if e.g. a negative value from ftell
was used to allocate memory.
Also store result of ftell in a long;
The result may previously have been truncated on some platforms
m_sample was being checked for null after being used, which looks like a
null dereference, though actually if m_sample becomes null, the tool will
be deactivated anyway. Regardless, this code looks more sensible.
These were reported by Coverity Scan. They're extremely unlikely but still
possible - if all edges of a poly are FLT_MAX or further away from the
input point, a negative index may be used to access the verts array of a
poly.
The fix is to arbitrarily pick the first edge as the closest in case all
are tied as being very far away.