817 Commits

Author SHA1 Message Date
Jakob Botsch Nielsen
a31da928ba Add settings storage to geometry sets
This adds the ability for geometry sets to store build settings that can
be automatically applied when they are loaded. This should allow sharing
of .gset files to demonstrate problems with certain settings on certain
files. It also allows people to diagnose problems more easily by being
able to dump their own triangle meshes and settings and load them in the
demo, with all of its visualization options. .gset files can be created
from the current mesh and settings by pressing the 9 key, which will
generate it in the same folder as the input mesh.

Also converts more of the demo to use STL.
2016-01-17 20:31:09 +01:00
Graham Pentheny
f8d6d3976d Merge pull request #158 from recastnavigation/allocators-use-size-t
Use size_t for rcAlloc and dtAlloc
2016-01-15 01:03:41 -05:00
Graham Pentheny
d873a73853 Merge pull request #159 from recastnavigation/readme-issue-stats-badges
Add Issue Stats badges to README.md
2016-01-15 00:38:12 -05:00
Ben Hymers
dd02c843a1 Merge pull request #157 from recastnavigation/fix-multiple-buildcontext-definition
Fix possible compile/link error with multiple BuildContext definitions
2016-01-15 00:43:14 +00:00
Ben Hymers
5d58cf40c1 Add Issue Stats badges to README.md
The readme was looking lonely after the BitDeli badge was taken away. Here are some nice badges to replace it, which also helpfully show how active a project this has become! They show recent average time to close issues and PRs.
2016-01-15 00:40:33 +00:00
Ben Hymers
a4a97dc03f Merge pull request #156 from recastnavigation/hymerman-remove-bitdeli-badge
Remove BitDeli badge from README.md
2016-01-15 00:37:46 +00:00
Ben Hymers
551d1b250e Use size_t for rcAlloc and dtAlloc
This was already partly done by @cexikitin in #65, I'm just finishing it
off in their absence!

Closes #65
2016-01-15 00:36:18 +00:00
Ben Hymers
f117bf4a91 Fix possible compile/link error with multiple BuildContext definitions
There is a class and a struct called BuildContext in two different files,
one .h and one .cpp. Depending on how the user structures their program,
it's possible that this would cause a compile or link error, as seems to
have happened in #44. I've just renamed the struct to get around this.

Fixes #44
2016-01-14 23:57:48 +00:00
Ben Hymers
f22f431a90 Remove BitDeli badge from README.md
It appears that BitDeli is defunct; their website has had a banner about a change in the GitHub API for a long time, which is a dead link to a blog article, and none of the example stats have been updated for years. Let's just remove it!
2016-01-14 23:43:19 +00:00
Jakob Botsch Nielsen
0143337a64 Merge pull request #154 from Janiels/fix-detail-unsampled-heights
Increase recover radius for unsampled heights
2016-01-14 22:18:43 +01:00
Jakob Botsch Nielsen
b99d62047b Increase recover radius for unsampled heights
When the detail mesh sampling sees an unset height it previously tried
to recover by looking for heights of neighbors. When the heightfield was
not eroded this recovery would fail since the contour simplification
could mean that the nearest valid cell was further away than a neighbor.
We now walk adjacent cells in a spiral to find a height and do this
depending on the max simplification error.

Fix #153
2016-01-14 19:20:43 +01:00
Jakob Botsch Nielsen
f002387afc Merge pull request #151 from Janiels/fix-detail-sampling
Use flood fill for potentially overlapping polys
2016-01-14 16:48:13 +01:00
Ben Hymers
a25b018be9 Merge pull request #76 from grahamboree/warnings
Removed a smattering of compiler warnings
2016-01-14 15:28:02 +00:00
Jakob Botsch Nielsen
e5242b7165 Merge pull request #141 from Janiels/fix-30
Fix heap corruption when collecting region layers
2016-01-14 13:19:51 +01:00
Jakob Botsch Nielsen
5fce286267 Use flood fill for potentially overlapping polys
This changes the detail sampling to find height data by using the flood
fill method for polygons that were merged because of a border vertex
removal. This could potentially cause overlapping polygons to receive
the same region IDs which would later make the fast-path sampling in
getHeightData sample the wrong heights.

Also includes optimizations for this path and getHeightData itself.
Previously the seeding was responsible for 25% of the total time spent
in getHeightData in these cases. We now use the direction and prefer
moving directly towards the center of the polygon. This makes the
overhead of seedArrayWithPolyCenter virtually nonexistent (~2%
according to profiling).

Fix #146
2016-01-14 11:25:48 +01:00
Graham Pentheny
894aa9461f Merge pull request #152 from Janiels/fix-149
Add documentation about data to addTile
2016-01-13 20:26:16 -05:00
Jakob Botsch Nielsen
67590642c7 Add documentation about data to addTile
dtNavMesh needs exclusive access to the data passed to addTile since it
will make dynamic changes to this at runtime. For that reason the data
should not be reused until the tile has been removed from the nav mesh
again.

Fix #149
2016-01-14 00:27:40 +01:00
Ben Hymers
5a342b83e8 Merge pull request #150 from Janiels/fix-windows-timing
Fix time measuring on Windows
2016-01-11 09:57:04 +00:00
Graham Pentheny
66c6060e95 Fix a bunch of compiler warnings
* Removed some unused vars
* Fixed some signed/unsigned comparison mismatch warnings
* Cast some int's to size_t when appropriate
* Removed some redundant casts
* silenced warnings about implicit conversions that lose precision
* changed origMousePos to an array of ints to match mousePos
2016-01-10 22:41:38 -05:00
Jakob Botsch Nielsen
09080b5272 Fix time measuring on Windows
The demo relied on the build context returning accumulated times in
microseconds. On Windows this was using QueryPerformanceCounter directly
which has a higher resolution, thus returning wrong measured times. We
now report the accumulated times in microseconds on all platforms.
2016-01-10 18:43:34 +01:00
Graham Pentheny
ac0316e6a8 Merge pull request #79 from mynz/master
change DebugUtils/Source/DetourDebugDraw.cpp no executable
2016-01-08 15:38:51 -05:00
Ben Hymers
26f2650df8 Merge pull request #75 from grahamboree/demo_project_improvements
Replaced FileList class with std::vector<std::string>
2016-01-08 07:53:37 +00:00
Graham Pentheny
e5f9f21b30 Removed FileList class and replaced it with std::vector<std::string> in RecastDemo 2016-01-07 18:34:18 -05:00
Ben Hymers
8563b84a8d Merge pull request #147 from grahamboree/unit_testing
Unit testing framework.
2016-01-07 08:47:02 +00:00
Graham Pentheny
512ec1fdfd Unit testing framework.
* Tests live in a "Tests" folder alongside the other components.  Inside the "Tests" folder, tests are split into folders by the component they test.  For example, the example unit test of "rcVdot" (which is implmemented in Recast/Recast.h) lives in "Tests/Recast/Tests_Recast.h".
* Uses the Catch testing framework
* One example test of "rcVdot"
* Tests are run on Travis and Appveyor after every build.  Failing unit tests will fail the build in both case.
* Added instructions on running unit tests to the readme
2016-01-06 18:22:39 -05:00
Graham Pentheny
e2c0eadc99 Merge pull request #145 from Janiels/fix-paths-with-spaces
Ensure SDL2.dll is copied for paths with spaces
2016-01-05 11:51:23 -05:00
Jakob Botsch Nielsen
7230dea2e3 Ensure SDL2.dll is copied for paths with spaces
The generated VS project would fail to copy the SDL2.dll file
if the solution or Bin path contained spaces.
2016-01-05 12:08:27 +01:00
Jakob Botsch Nielsen
1b50ceaa9a Merge pull request #144 from grahamboree/SDL2
Updated RecastDemo to SDL2
2016-01-05 09:00:21 +01:00
Graham Pentheny
2eb3abfb60 Updated RecastDemo to SDL2
* Renamed a bunch of variables in main.cpp to be more descriptive.
* Removed unnecessary SDLMain.h and SDLMain.m OSX objective-c class as well as the plist, strings, xib and icns files, which are not needed.
* included cstdio in imguiRenderGL since SDL2 doesn't do it for us.
* Updated premake5 script to support SDL2 and to set the debug directory, as well as copy the SDL2.dll to the target directory on Windows.
* Updated readme with more descriptive, platform-specific demo project setup instructions
* Updated appveyor build script to build vs2015 as well.
* Updated Travis build script to build SDL2 from source, because they use Ubuntu 12.04 which doesn't have the libsdl2-dev package in its repositories.
2016-01-04 18:56:51 -05:00
Graham Pentheny
43a20cce42 Merge pull request #109 from Kromster80/patch-2
Updated dtFindPathOptions description and options
2016-01-02 10:30:37 -05:00
Jakob Botsch Nielsen
c1f9fd8406 Fix heap corruption when collecting region layers
The collecting could overflow the neighbours array due to a missing boundary
check.

Fix #30
2016-01-02 13:33:27 +01:00
Ben Hymers
d6ab8fdf86 Merge pull request #139 from Janiels/fix-113
Correctly remove off mesh links to other layers
2015-12-30 12:05:59 +00:00
Jakob Botsch Nielsen
e2cc5ae419 Correctly remove off mesh links to other layers
External links representing off mesh connections between layers in the
same tile location would not be correctly removed. These links had
side = 0xff which were skipped during tile removal under the assumption
that these links were internal.

Also correct some comments in the same place.

Fix #113
2015-12-29 17:51:15 +01:00
Ben Hymers
6285b17587 Merge pull request #102 from rafzi/allocfix
handle the case when allocSpan fails to allocate memory
2015-12-18 17:23:02 +00:00
Rafael Stahl
15025e8519 handle the case when allocSpan fails to allocate memory. adds bool return types to rcAddSpan, rcRasterizeTriangle and rcRasterizeTriangles 2015-12-18 16:41:02 +01:00
Ben Hymers
724092a9ec Merge pull request #137 from rafzi/scopedtimer
add rcScopedTimer to fix timers not being stopped on all paths and to…
2015-12-18 15:24:07 +00:00
Rafael Stahl
6d3c9b38ba add rcScopedTimer to fix timers not being stopped on all paths and to prevent it in the future. 2015-12-18 14:48:31 +01:00
Ben Hymers
68ec46a685 Merge pull request #136 from Janiels/null-check
findNearestPoly now fails when nearestRef is null, and only assigns it when the function succeeds
2015-12-17 18:14:41 +00:00
Jakob Botsch Nielsen
643a3a7043 findNearestPoly now fails when nearestRef is null, and only assigns it when the function succeeds 2015-12-17 18:57:06 +01:00
Ben Hymers
0ccfd632fa Merge pull request #133 from Janiels/master
Use intermediate variable for nearest point in findNearestPoly
2015-12-17 17:40:57 +00:00
Jakob Botsch Nielsen
35fb7d5c16 Merge pull request #78 from grahamboree/RC_SPAN_HEIGHT_BITS_fix
Use RC_SPAN_HEIGHT_BITS when setting the bitfield size of rcSpan::smin and rcSpan::smax
2015-12-17 14:16:02 +01:00
Jakob Botsch Nielsen
d742e04cc4 Merge pull request #95 from Sandern/fix-oldtile-not-removed
Make sure to remove the old tile if the new tile is empty (due to temp obstacles)
2015-12-17 14:06:30 +01:00
Jakob Botsch Nielsen
ede84bae22 Merge pull request #103 from jackpoz/warning_fix
Fix 2 "unused parameter" build warnings
2015-12-17 13:52:17 +01:00
Graham Pentheny
5b2dce6a18 Merge pull request #134 from grahamboree/Comments
Better documentation for a few private fields in dtCrowdAgent
2015-12-16 23:41:59 -05:00
Graham Pentheny
b9804c5210 Better documentation for a few private fields in dtCrowdAgent as discussed in PR #110 2015-12-16 23:37:41 -05:00
Jakob Botsch Nielsen
7d924b1eee Use intermediate variable for nearest point in findNearestPoly
When the same point is used as center and as nearestPt, the function
would override center and give wrong results.

Fix #118
2015-12-16 18:18:11 +01:00
Ben Hymers
7b4d18f459 Merge pull request #132 from Kromster80/patch-5
Fix as discussed in PR#111
2015-12-16 16:35:41 +00:00
Krom Stern
4d3f406546 Fix as discussed in PR#111
Typo fix
2015-12-16 19:28:27 +03:00
Ben Hymers
e2f13c2bab Set AppVeyor and Travis CI badges to recastnavigation repo in README 2015-12-16 02:06:16 +00:00
Ben Hymers
7c9460cfb3 Merge pull request #131 from hymerman/ci-squashed
Add AppVeyor and Travis CI build scripts
2015-12-16 01:57:41 +00:00