699 Commits

Author SHA1 Message Date
aymarfisherman
7cca61dc41 Renamed all instances of 'extents' to 'halfExtents' (#279) 2017-08-20 17:05:51 +02:00
aymarfisherman
840c100639 Added option to add rotated Box obstacle to TileCache. (#278)
Very useful when you have a obstacle with a big difference in x to z ratio and that could be rotated (not aligned), like a wall.
2017-07-25 13:35:23 +02:00
Geoyeob Kim
46654531e4 Fix 'dtRandomPointInConvexPoly()' returning a garbage value if s == 1.0f. (#271) 2017-05-15 16:26:35 +02:00
Domenico Albani
ef3ea40f7a Add more camera movement key bindings (#259)
Q/E and Page up/page down to move vertically.
Arrow keys in addition to WASD to move normally.
2017-02-06 02:09:49 +01:00
Jakob Botsch Nielsen
fb49ccf83a Change ground and road colors slightly (#256)
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.
2017-02-04 15:19:06 +01:00
Domenico Albani
03eb2f92f3 Make RecastDemo colors more meaningful (#254)
Implement a SampleDebugDraw which will color area types meaningfully, for example
color water as blue, grass as green and so on.
2017-02-02 20:27:43 +01:00
Domenico Albani
16a7a30ada duDebugDraw::polyToCol changed to areaToCol (#255) 2017-02-01 17:44:39 +01:00
Domenico Albani
ad6e5de2e9 Debug draw duPolyToCol custom function (#253)
Add duDebugDraw::duPolyToCol to allow user to pick polygon color.
2017-01-30 11:11:32 +01:00
Domenico Albani
dfd40071c5 Assertion failure custom function (#250)
Implement custom functions to be called when an assertion fails.
2017-01-23 23:02:46 +01:00
Jonathan Adamczewski
2bc06ef314 Change initializer list to match declaration order 2017-01-12 16:58:26 +00:00
Jonathan Adamczewski
34ab687e21 Add support for heightfield filter toggles in Sample_TempObstacles 2017-01-12 16:58:26 +00:00
Jonathan Adamczewski
12e8950bac Add toggles for heightfield filtering 2017-01-12 16:58:26 +00:00
Ben Hymers
a2e16b8e6c Set warnings as errors on Linux 2017-01-12 12:07:49 +00:00
Ben Hymers
f8c8beb3cb Fix some warnings by adding error checking to Sample_TempObstacles::loadAll (#245) 2017-01-12 12:53:39 +01:00
Ben Hymers
b40b5ab7d9 Upgrade Catch to 1.6.0 (#247) 2017-01-12 12:45:45 +01:00
Ben Hymers
d11c1bdbac Fix multiline comment warning 2017-01-12 11:31:29 +00:00
Acai
787ce2c18d Fix log errors in rcBuildLayerRegions. (#242) 2016-11-27 12:12:54 +01:00
Jakob Botsch Nielsen
15ebb8bd25 Take detail mesh into account for creating BV-tree (#231)
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
2016-09-09 12:03:37 +02:00
Jakob Botsch Nielsen
88b8d409a7 Properly use detail mesh from closestPointOnPoly (#228)
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
2016-09-07 10:55:35 +02:00
Jakob Botsch Nielsen
64385e9ed0 Fix findPath to return DT_OUT_OF_NODES correctly (#222)
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
2016-07-27 20:40:42 +02:00
cmf028
9052db45d8 Add support for AABB shaped obstacles to dtTileCache (#215) 2016-07-13 09:20:28 -04:00
Jakob Botsch Nielsen
76db7aa47b Add .editorconfig with tabs (#218) 2016-07-13 12:31:28 +02:00
Jakob Botsch Nielsen
7a88c13946 Add an assertion for alloc in rcIntArray::doResize (#219)
Fix #170
2016-07-13 11:30:13 +02:00
Jakob Botsch Nielsen
2c1db8c577 Merge pull request #217 from Janiels/prunetool-start-fix
Prune tool start fix
2016-07-13 11:29:38 +02:00
Jakob Botsch Nielsen
1445d05838 Use std::vector in NavMeshPruneTool 2016-07-13 05:37:37 +02:00
Jakob Botsch Nielsen
5d6312ab1e Mark start poly in NavMeshPruneTool
The start poly would not be pruned if it was the only poly on the
island.

Fix #216
2016-07-13 05:37:15 +02:00
Jakob Botsch Nielsen
9763478a9a Detect all overflows in rcBuildHeightfieldLayers (#214)
The function now fails if it fails to insert all layers because the
array overflowed. Previously this would silently corrupt the heap.
2016-07-08 01:51:23 +03:00
Ian Masters
ab0a679d8f Fix for Struct 'dtNode' was previously declared as a class (#213) 2016-06-25 10:09:34 +02:00
Jakob Botsch Nielsen
b86c1e12b3 Fix a memory leak in dtBuildTileCacheLayer (#212) 2016-06-15 10:10:54 +02:00
Jakob Botsch Nielsen
2a0c31b8ef Add getPathFromDijkstraSearch function (#211)
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.
2016-06-10 12:20:27 +02:00
Graham Pentheny
c464d91fe8 Updated some old documentation (#209) 2016-06-08 11:06:01 -04:00
Jakob Botsch Nielsen
8628710178 Take area costs into account in Dijkstra searches (#208)
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.
2016-05-24 17:54:03 +02:00
Jakob Botsch Nielsen
12569b5cf6 Append results correctly in Dijkstra searches (#205)
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
2016-05-18 13:01:41 -04:00
tfabretti
16bea738b8 Fixed a links issue due to offmesh connections
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).
2016-05-02 20:59:51 +02:00
Jakob Botsch Nielsen
36183edb55 Add upToDate param for dtTileCache::update (#203)
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.
2016-04-25 20:27:14 +02:00
Sander van Noort
b05e45492e Fix memory leak in LinearAllocator used by Sample_TempObstacles 2016-04-03 22:39:33 +02:00
Graham Pentheny
d7187028b2 Merge pull request #199 from grahamboree/eof_newline
Added eof newlines.
2016-03-30 14:31:25 -04:00
Graham Pentheny
95658e7b6c Added eof newlines. Fixes #198 2016-03-30 13:48:05 -04:00
Graham Pentheny
7470e62460 Merge pull request #188 from grahamboree/unit_tests
Unit tests for a good number of core Recast functions.
2016-03-29 12:35:53 -04:00
grahamboree
c9bacf3c9c Unit tests for a good number of Recast functions.
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.
2016-03-29 01:04:51 -04:00
Graham Pentheny
69895b4d7a Merge pull request #196 from grahamboree/rcHeightfield_ctor
Added Constructor and Destructor to rcHeightfield
2016-03-26 15:51:03 -04:00
grahamboree
61dbce80e9 Added Constructor and Destructor to rcHeightfield. 2016-03-20 18:42:14 -04:00
Ben Hymers
d9c6fc58ce Remove redundant double assignment 2016-03-15 08:02:28 +00:00
Ben Hymers
3eb9c808c1 Fix many cases of return values from ftell and fseek being ignored
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
2016-03-15 08:02:06 +00:00
Ben Hymers
632ae709d7 Fix unused parameter warning in Contrib/stb_truetype.h 2016-03-15 07:56:57 +00:00
Ben Hymers
e344fe8295 Remove dead code in rcBuildRegions
The code is checking for an invalid region ID, after setting it to a valid value
2016-03-15 07:56:57 +00:00
Ben Hymers
3a0140c2ac Initialise dtTileCache::m_reqs on construction 2016-03-15 07:56:56 +00:00
Ben Hymers
58bd564438 Initialise BuildContext::m_messages to null pointers
Fixes warning reported by Coverity Scan
2016-03-15 07:56:56 +00:00
Ben Hymers
e4791becd5 Fix Coverity warning about odd null check in TempObstacleHilightTool
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.
2016-03-14 10:22:31 +00:00
Ben Hymers
222fa1ee6f Fix possible out of bounds array access in Detour closest point functions
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.
2016-03-14 10:22:31 +00:00