25 Commits

Author SHA1 Message Date
andriyDev
6d1f9711b3
Mark input data structures as const. (#625) 2023-04-20 19:16:35 -04:00
Thomas Debesse
5c494ad1ee
RecastLayers: set RC_MAX_LAYERS and RC_MAX_NEIS as optional defines (#624)
It makes possible for a project integrating Recast to set custom values
via CXXFLAGS while remaining build system agnostic.

Type checking is kept.
2023-04-14 17:02:00 -04:00
Graham Pentheny
b43c82c808
Removed _USE_MATH_DEFINES directive (#596)
Since none of the `M_` prefixed constants are used anywhere in the code, this is unnecessary.  It's also Windows-specific, so these non-standard defines shouldn't be used anyway.

Ref: https://learn.microsoft.com/en-us/cpp/c-runtime-library/math-constants?view=msvc-170
2022-12-29 15:09:01 -05: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
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
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
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
Kromster80
ce304d195f Removed superflous memset
We have already filled whole set of layers with zeroes at line 477. It looks like we don't need to fill the layers once again. Right?
2014-12-23 11:10:05 +03:00
Kromster80
6c3b575052 Rolled back to pull 2014-10-30 21:19:19 +04:00
Kromster80
a7a67af47b Typo fixes 2014-10-30 17:05:39 +03:00
Kromster80
e3d5c9904e Renamed local variable to avoid scope collisions
I'm not sure if C++ vars are scoped into {} blocks, but in ported code that is an issue. It's easier to have vars names unique. Does not harm anyone I guess? ;-)
2014-10-30 16:59:51 +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
816c99aa3e Fixed google code Issue 233 2013-09-17 21:12:43 +02:00
Mikko Mononen
e6b1d141d2 Fixed warnings when compiling with -Wshadow. 2012-02-22 17:25:46 +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
Mikko Mononen
9902efc845 TileCache progress: Moved tile cache to Detour and made proper class for it. Better obstacles and tile layer management. 2011-04-16 07:57:50 +00:00
Mikko Mononen
76444aa747 - Updated win32 project
- Fixed VC compile errors
2011-03-25 10:13:27 +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
4be11d07f8 Fixed bug in edge generation (also appears in regular side). Added portal edge detection. Adjusted layer related debug draw. 2011-03-11 20:22:22 +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
a1babd6803 Fixed out of bounds bug in rcBuildLayerRegions. Improved region merging. 2011-02-28 08:18:44 +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