* 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
* Validate constraint: #polygons per tile
When adding a tile to a NavMesh, ensure that the number of polygons in that tile fit in the poly ID address space.
* Improve dtNavMeshParams field documentation
-Wno-error does not ignore unknown warnings on old GCC versions causing
problems when using it for new warnings. On the other hand, -Wno-X will
ignore unknown warnings, so we can use this instead.
Fix#403Fix#413
* Make dtClosestHeightPointTriangle use no epsilon (except for checking
denominator)
* When point is outside poly, directly find closest height from boundary
detail edges instead of first interpolating and then finding height from
detail tris.
* When point is inside poly, if all dtClosestHeightPointTriangle queries
failed, then find height from detail edges. This should only happen if
the point is right on top of an internal detail tri edge.
Previously this was relative to the output file. This works around a
premake5 bug and as a bonus makes it easier if we in the future decide
to support out-of-source builds.
* Build with cmake in appveyor
* Install content files and tests binary to bin
* Install SDL2.dll on windows
* Build RecastDemo as GUI application on Windows and Mac OS
* Copy SDL2.dll to current binary dir
The GCC version used by Travis is old and appears not to support all the
warnings we would like to get, so reenable Clang. Additionally make lots
of cleanups to Travis config and make the build a lot faster too.
Also change both Travis and AppVeyor builds to treat warnings as errors,
and include VS2017 in the matrix for AppVeyor. I have also removed
VS2010 because it is ancient at this point.
Updated Premake to alpha12 and fixed the premake build file
appropriately.
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.
This implements most of the std::vector interface, with some minor elisions of
infrequently used methods such as "insert", and some STL bookkeeping.
Performance is favorable compared to std::vector, and, in some cases, somewhat
better than naive code to manually manage a malloc'd dynamic array.
BM_FlatArray_Push: 100 iterations in 72889721 nanos: 728897.21 nanos/it
BM_FlatArray_Fill: 100 iterations in 2700746 nanos: 27007.46 nanos/it
BM_FlatArray_Memset: 100 iterations in 2687810 nanos: 26878.10 nanos/it
BM_rcVector_Push: 100 iterations in 51114316 nanos: 511143.16 nanos/it
BM_rcVector_PushPreallocated: 100 iterations in 9532106 nanos: 95321.06 nanos/it
BM_rcVector_Assign: 100 iterations in 2371534 nanos: 23715.34 nanos/it
BM_rcVector_AssignIndices: 100 iterations in 2573052 nanos: 25730.52 nanos/it
BM_rcVector_Resize: 100 iterations in 2455761 nanos: 24557.61 nanos/it
BM_stdvector_Push: 100 iterations in 71739167 nanos: 717391.67 nanos/it
BM_stdvector_PushPreallocated: 100 iterations in 15723737 nanos: 157237.37 nanos/it
BM_stdvector_Assign: 100 iterations in 2564985 nanos: 25649.85 nanos/it
BM_stdvector_AssignIndices: 100 iterations in 5174923 nanos: 51749.23 nanos/it
BM_stdvector_Resize: 100 iterations in 2520054 nanos: 25200.54 nanos/it
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.