72 Commits

Author SHA1 Message Date
Graham Pentheny
5111139558
Fixes for many low-severity compiler warnings (#576)
* Fixes for many low-severity compiler warnings

Mostly a lot of pedantic things like end-of-file newlines and commas on the last enum value.  However some fixes like the weak v-tables warnings fixes might help with code gen.  It's unclear if the linker is able to elide multiple copies of the same type's v-table in different translation units, (sometimes it can) but these fixes ensure we don't have to rely on it.
2022-11-11 21:03:03 -05:00
Maciej Babinski
ba12abead9 Add more constructors. 2018-05-22 13:09:26 +02:00
mbabinski-at-google
9235b4a0c4 Add rcNew/rcDelete, template functions that allocate/deallocate objects using rcAlloc/rcFree. (#324)
Add rcNew/rcDelete, template functions that allocate/deallocate objects using rcAlloc/rcNew.
The intention is to use these to move construction logic out of rcAllocateFooObject/rcFreeFooObject and into constructors/destructors, giving users flexbility in how objects are allocated. In particular, this allows stack allocation.
2018-05-18 15:40:37 +02: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
grahamboree
61dbce80e9 Added Constructor and Destructor to rcHeightfield. 2016-03-20 18:42:14 -04:00
Graham Pentheny
b7a83e0afb Fixed rule of 3 violations in many places.
* Added virtual qualifier to a few destructors in subclasses.
* Removed a few empty destructors that didn't need to be explicitly defined.
* Fixed a few typos
* Removed unnecessary empty virtual destructors in some classes with parent's who derrived from a class with a virtual destructor
2016-01-20 11:57:32 -05: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
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
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
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
Graham Pentheny
df6fac219b Use RC_SPAN_HEIGHT_BITS when setting the bitfield size of smin and smax in rcSpan. 2015-01-31 17:18:02 -05:00
Kromster80
5df28b45bc Matched the implementation/docs name of the parameter 2014-10-30 13:35:37 +03:00
Janiels
89233e807d Fix comment in rcHeightfieldLayer 2014-06-14 15:43:22 +02:00
Mikko Mononen
3cb87f2432 Merge branch 'master' of https://github.com/memononen/recastnavigation 2014-06-13 13:25:07 +03:00
Mikko Mononen
a89bb843d7 Added new method to partition heighfield
- added layer based heighfield partitioning
- the method is a bit slower than monotone partitioning, but does not
suffer from the long thin ploys
- the method partitions the heighfield into non-overlapping areas, but
does not try to resolve holes
- improved contour hole merging so that it can properly handle all
kinds of holes
- improved polygon triangulation to handle overlapping segments
- improved small and long polygon detail mesh generation
- updated samples to include all 3 partition methods and little
documentation to help to choose between them
2014-06-13 13:25:01 +03:00
Mikko Mononen
64828488b1 Fixed docs of maxSimplificationError units. 2013-12-22 18:24:58 +02:00
grahamboree
b493e7e6f6 Added rcIngoreUnused which can be called to ignore unused parameters. 2013-10-14 16:32:20 -04:00
Mikko Mononen
d2b4b09e16 - Added rcOffsetPoly() helper function to expand polygon areas 2012-06-02 10:13:59 +00:00
Mikko Mononen
f91363ff06 Added rcCopyPolyMesh function. 2012-02-27 19:02:16 +00:00
Stephen Pratt
79a61cbdb1 Recast: Removed unused inline functions and standardized tab/space use.
Removed the unused rcAlign4 function from Recast.h.
Removed the unused rcVequal function from Recast.h.
Standardized the use of tab/space indenting in the API documentation.
2011-09-13 13:14:40 +00:00
Stephen Pratt
6f5c9f9b82 Recast: Detail API documentation for the members declared in Recast.h. (Complete)
Recast.h: Completed rcPolyMeshDetail through end, plus updates to existing documentation.
Configuration: Removed DebugUtils directory from the document build.
Configuration: Fixed issue 179. (Backslashes)
2011-08-29 23:03:16 +00:00
Stephen Pratt
5553d19d59 Recast: Detail API documentation for the elements declared in Recast.h. (Partial)
The elements through rcPolyMesh are complete.
2011-08-22 21:49:21 +00:00
Cameron hart
d5729c678b Changed header comments to use Doxygen format and added configuration Doxyfile. 2011-05-06 23:22:08 +00:00
Mikko Mononen
69f00ef893 Fixed type on rcAddSpan definition in header file. 2011-04-30 05:43:07 +00:00
Mikko Mononen
1de5e2f119 DETOUR API CHANGE!
- Detour Navmesh supports layers
- Allow to disable Navmesh BV-tree
- Added DetourTileCache
- Cleaned up Recast layer code
- Moved portal edge detection to Recast
- Removed polymesh border offset
- Removed lean heighfield
2011-03-25 09:16:38 +00:00
Mikko Mononen
b6a93f063a Removed layer portals, added cons, which stores connectivity and portals. Layer heights is stored as bytes. 2011-03-11 15:12:15 +00:00
Mikko Mononen
e84d563bfe Added boxmapped texturing to input mesh, helps visualize it better. Added polymesh generation for layered heighfields. 2011-03-06 15:40:33 +00:00
Mikko Mononen
6cb0413cc7 Layer progress: Fixed reg building with multiple areas. Added contour generation. 2011-03-06 08:26:55 +00:00
Mikko Mononen
ce6f2a52fc Fixed mem leaks with layers. Added layer region generation test. 2011-02-27 20:39:17 +00:00
Mikko Mononen
f140c3962d Heighfield Layer progress. 2011-02-26 15:05:21 +00:00
Mikko Mononen
2f47c29336 Added lean heighfield to store minimal, easy to compress representation of the heightfield. Added temporary obstacle demo. 2011-01-14 10:55:37 +00:00
Mikko Mononen
7fbcfa9c4b Fixes for issue 147, issue 143, issue 140 2010-11-21 14:59:58 +00:00
Mikko Mononen
ab9ada50c5 Renamed 'region size' to 'region area' and improved documentation. 2010-10-10 11:04:13 +00:00
Mikko Mononen
f5c3a8b609 Fix for Issue 128 (third time the charm) 2010-10-10 10:15:44 +00:00
Mikko Mononen
e1355c4a33 Fixed several detail mesh issues. Fixed issue 106. 2010-09-17 10:20:08 +00:00
Mikko Mononen
e65903dfce The humble beginnings of dtObstacleAvoidanceQuery, figuring out the API. Moved value graph/history to ValueHistory.h/cpp and changed the draw code to use imgui. Various tweaks to CrowdTool. 2010-08-31 12:36:32 +00:00
Mikko Mononen
5ba6518ed3 Detour compiles now with DT_VIRTUAL_QUERYFILTER. Fixed typos in comments. Fixed bug in findStraightPath() where leftPolyType was not used. 2010-08-26 18:57:53 +00:00
Mikko Mononen
5abddbf0cd Refactored rcBuildContext to be more customization friendly, changed name to rcContext. 2010-08-24 17:53:38 +00:00
Mikko Mononen
a9f439b35e testing if svn is not borked 2010-08-23 18:13:32 +00:00
Mikko Mononen
a16f0e3e5e Fix for Issue 109. 2010-08-23 17:44:27 +00:00
Mikko Mononen
613d61f453 Removed Recast timer and log, added rcBuildContext, improved build time printout, fixed issue 67, issue 77, issue 87 2010-08-19 09:26:55 +00:00
Mikko Mononen
5ebcb453fb Issue 45:Input triangle based area creation (another try) 2010-07-13 07:19:10 +00:00
Mikko Mononen
cd3a351f40 Custom allocator for Recast. 2010-07-09 12:55:14 +00:00
Mikko Mononen
fb369a2efd Removed math.h dependancy from Recast.h, moved sqrtf to Recast.cpp. 2010-07-09 08:45:58 +00:00
Mikko Mononen
fca9709196 fix for issue 85:Make getSpanCount accessible 2010-07-08 11:41:08 +00:00
Mikko Mononen
11386cedcf Added option to tesselate edges between areas. Fixed bug in orphan contour merging, which could create overlapping contour. 2010-05-26 09:20:57 +00:00
Mikko Mononen
10b330ffb4 Moved common functions behind name decoration. 2010-04-14 18:45:46 +00:00
Mikko Mononen
193f44a388 Issue 61: take 2, missing files. 2010-04-13 10:58:18 +00:00
Mikko Mononen
5119b5cb16 API CHANGE! Better serialization support. 2010-03-25 12:24:40 +00:00