46 Commits

Author SHA1 Message Date
Gleb Mazovetskiy
e75adf86f9
Avoid reallocs of temp vectors (#467)
* Use clear() instead of resize(0) for temp vectors

Nicer style

* rcVectorBase::resize: Avoid realloc on grow

When capacity is sufficient, do not realloc the whole buffer

* rcVector: Grow exponentially on resize
2021-02-15 12:27:21 +01:00
mbabinski-at-google
1284a2b191 Remove placement-new in RecastRegion.cpp in favor of rcTempVector. (#326) 2018-05-18 13:50:42 +02:00
mbabinski-at-google
3ddb9ba074 Convert lvlStacks to be vectors of structs instead of a bag of ints. (#323) 2018-05-17 17:35:05 +02:00
Maciej Babinski
bec073c947 Switch expandRegions to using a rcTempVector of structs rather than a blob of ints.
Also updates rcVector::clear() to not require the contained type to be default-constructible.
2018-05-15 16:43:11 +02:00
mbabinski-at-google
18562383f4 Remove redundant copying in rcBuildRegions. (#314)
Remove dstReg and dstDist from rcBuildRegions entirely -- just use temporary scratch space in expandRegions.
This saves a considerable amount of time when the number of spans is large. A sample map tried has 16M spans, and only writes at most 4000 of them.
2018-04-27 22:08:52 +02:00
elsid
367065415c Unconditionally initialize rcCompactHeightfield borderSize
To avoid uninitialized value when borderSize <= 0.
2018-03-20 00:01:57 +01:00
Acai
787ce2c18d Fix log errors in rcBuildLayerRegions. (#242) 2016-11-27 12:12:54 +01: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
Graham Pentheny
6ee79b25a8 Merge pull request #169 from wbierman/master
Detect, log and fail in the event of an overflow of region ids in watershed partitioning
2016-01-21 13:21:03 -05:00
Bill Bierman
e49017ac63 Detect, log and fail in the event of an overflow of region ids in watershed partitioning 2016-01-21 07:07:40 -10: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
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
jackpoz
18b537c23f Fix 2 "unused parameter" build warnings 2015-06-28 21:32:16 +02:00
Mikko Mononen
e6fc6a3817 Removed unused code 2014-06-13 13:28:46 +03: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
axelrodR
8e4633c64b Performance optimizations:
1. Triangle rasterization: replaced loops over all the grid cells of the AABB with looping over the area of the triangle itself (i.e. bounds are set per row).
2. Region expansion: instead of sweeping through all the cells at each expandRegion() and finding the right level - sweep once per few levels and divide among several stacks. Left over are appended.
2014-01-08 12:02:00 +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
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
2aa70cb497 Fix for issue 144. Treat region borders as empty in floodRegions() to allow 1 width regions to grow next to tile border. Made area marking code not to override RC_NULL_AREA. 2010-11-21 14:52:55 +00:00
Mikko Mononen
1e1cf6e89e Fix for Issue 129. 2010-10-15 07:09:07 +00:00
Mikko Mononen
ab9ada50c5 Renamed 'region size' to 'region area' and improved documentation. 2010-10-10 11:04:13 +00:00
Mikko Mononen
b429ee7304 Fix for issue 127. 2010-10-10 10:43:32 +00:00
Mikko Mononen
da3852cfcd Distance field timer was not halted. 2010-08-26 18:40:22 +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
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
377315641e Updated win32 project.
Fixed allocation of rcRegions, use placement new per array object, not for the whole array.
2010-07-09 13:25:28 +00:00
Mikko Mononen
cd3a351f40 Custom allocator for Recast. 2010-07-09 12:55:14 +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
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
Mikko Mononen
d9d9fa85a5 Added more bits to compact neighbour indices, moved region id to rcCompactSpan to save memory. 2010-03-05 09:10:13 +00:00
Mikko Mononen
9035462e86 rcBuildRegionsMonotone works again too. 2010-02-01 14:57:26 +00:00
Mikko Mononen
9b881bde8c NOTE: Changed the generation procedure, see samples! Erode walkable area before area is generated. Allow to mark areas on chf. Generate regions following areas (+ many fixes here and there to make it alwasy work). 2010-02-01 14:08:06 +00:00
Mikko Mononen
5651b7c5dd Changed many 0xffff:s to named consts. 2010-01-27 14:52:18 +00:00
Mikko Mononen
6a00efb936 Compile fixes for VC. Update VC project. 2009-12-03 16:28:27 +00:00
Mikko Mononen
14d1c97f1a Added RC_NOT_CONNECTED which is used to check the return value of rcGetCon() 2009-11-15 11:24:20 +00:00
Mikko Mononen
ed73b46308 - Changed gotos as cleanup mechanism to a scoped delete template.
- Removed unnecessary ptr casts to ints to allow to compile on 64bits systems.
- Added custom and portable qsort_r.
- Use gettimeofday() as performance timer on unix/bsd/osx
- Moved variables from rcCompactSpan to separate arrays.
2009-09-28 09:54:37 +00:00
Mikko Mononen
5fc5626938 Log is printed to stdout after build.
Fixed tile data deletion in tilenavmesh (thanks jswigart).
Adjusted default border size in tiled versions.
Added experimental monotone region builder.
2009-08-27 09:01:15 +00:00
Mikko Mononen
f142f33415 Few debugdraw tweaks.
Commented some magic flags.
2009-08-24 13:04:12 +00:00
Mikko Mononen
6de4d30705 Monster update which adds detail height meshes.
- Added detail height mesh generation (RecastDetailMesh.cpp) for single,tiled statmeshes as well as tilemesh.
- Added feature to contour tracing which detects extra vertices along tile edges which should be removed later.
- Changed the tiled stat mesh preprocess, so that it first generated polymeshes per tile and finally combines them.
- Fixed bug in the GUI code where invisible buttons could be pressed.
2009-08-24 12:44:44 +00:00
Mikko Mononen
e638624828 Version 1.2
Removed paris demo code.
Cleaned up the API and added missing comments.
2009-06-16 09:57:55 +00:00
Mikko Mononen
c56ebb7e77 - (too) large refactoring of the generation and demo code to support tiled preprocessing
- added rcFixupAdjacentContours which adjust adjacent contour sets so that that they share all vertices (still buggy!)
- changed the demo stucture to handle tiled navmesh generation process (still ugly)
- the performance results are put into a struct instead of logged immediatelly
- added ChunkyTriMesh class which allows to partiotion a trimesh to smaller pieces using AABB tree
2009-05-17 13:31:09 +00:00
Mikko Mononen
4e6621a124 - Removed multipass blur test 2009-03-29 12:38:01 +00:00
Mikko Mononen
06832c885e Initial commit. 2009-03-29 10:30:52 +00:00