756 Commits

Author SHA1 Message Date
Bret Curtis
63a4ee4c1e
Add version and pkgconfig (#474)
* Add version and pkgconfig

* simply versioning

Co-authored-by: Bret Curtis <bret.curtis@pegus.digital>
2021-03-05 17:24:04 +01:00
elsid
1f25f9cc29 Install .pdb files only with MSVC 2021-03-05 17:21:50 +01:00
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
Jan Haller
cf4f3e15a8
Poly query API: expose distance and isOverPoly (#448)
* Add dtNavMeshQuery.findNearestPoly() overload with parameters: distance, isOverPoly

* dtNavMeshQuery::findNearestPoly(): improve documentation, avoid code duplication

* Make code C++98-compatible

* Remove distance parameter from dtNavMeshQuery::queryPolygons()
2021-01-23 13:25:41 +01:00
Rubaka
c32297c2f9 Fixed run RecastDemo on MVS 2020-11-19 17:36:54 +01:00
Jakob Botsch Nielsen
ec05c9e17c
Update build instructions for Windows 2020-11-19 14:23:59 +01:00
Jan Haller
9dc88fcab9
Validate constraint: #polygons per tile (#449)
* 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
2020-11-19 10:13:30 +01:00
ZhihuiLiu
6624e7aef5 fix an index error 2020-11-18 10:54:07 +01:00
Kyeongho Park
24230e8e8d
Bugfix/chunkytrimesh subdivide maxnodes (#451)
* minor redundant: dir

* bugfix: ChunkyTriMesh nodes array: out of bounds
2020-11-17 11:46:52 +01:00
Yoann Potinet
65b314a44e Fix shared library build 2020-10-31 10:38:31 +01:00
Jakob Botsch Nielsen
8db2f62d7a Fix compiler error due to memset on type with non-trivial constructors
Fix #446
2020-10-30 11:31:53 +01:00
Jan Haller
e679507845
Improve debug builds for MSVC (#443)
* Add -d suffix for debug libraries

* Export PDB files for each Debug library
2020-10-30 10:41:54 +01:00
Alexey Sokolov
9337e12418
Several fixes for make install (#437)
* Don't install test

* Install to the correct directory (e.g. lib64)

* Install includes to /usr/include/recastnavigation
2020-09-24 10:08:03 +02:00
Dig-Doug
eecb7f45ec Updates the README instructions for linux
The binary has to be run from the bin directory, otherwise the DroidSans font can't be found and shows the error "Could not init GUI renderer.":

https://github.com/recastnavigation/recastnavigation/blob/master/RecastDemo/Source/main.cpp#L129
2020-08-05 22:50:04 +02:00
Jakob Botsch Nielsen
df27e4eb1a Fix build
-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 #403
Fix #413
2020-05-11 18:26:17 +02:00
Icecream95 (gitlab.com/icecream95)
57610fa6ef Explicitly define winding as being signed 2019-10-21 14:44:25 +02:00
cypheron
c40188c796 Permit false positive compile errors (gcc8) 2019-05-11 13:19:37 +02:00
Jakob Botsch Nielsen
54bb0943e5 Make closestPointOnPoly and getPolyHeight more robust
* 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.
2019-03-16 16:18:23 +01:00
Jakob Botsch Nielsen
33a9eb1cce Document detail triangle edge flags 2019-03-16 16:18:23 +01:00
Jakob Botsch Nielsen
21f48fae37 Add a mesh for testing crowds at a large distance of origin 2019-03-16 16:18:23 +01:00
Jakob Botsch Nielsen
a0e6605642 Deduplicate closestPointOnPoly 2019-03-16 16:18:23 +01:00
Jakob Botsch Nielsen
3a619d773d
Add consistent input validation to dtNavMeshQuery (#374)
Validate input values, including that points are finite.
2019-02-24 21:10:42 +01:00
Bret Curtis
14b2631527 Use Travis-CI Matrix to add more type of builds (#366) 2018-11-21 12:34:13 +01:00
云风
7ccb72b383 Optimize dtClosestHeightPointTriangle (#364) 2018-11-09 14:52:00 +01:00
Jakob Botsch Nielsen
3087e805b0 Add a matching placement delete for placement new
Even though it is a no-op this is good style and avoids a warning with
MSVC.

Fix #359
2018-11-05 14:26:08 +01:00
Jakob Botsch Nielsen
fe4d4392a6 Use SDL2.dll path relative to script file
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.
2018-11-05 13:34:08 +01:00
elsid
7bfd9a1d4c Add aliases with namespace for library build targets 2018-10-31 23:13:42 +01:00
elsid
2b31aa9d79 Bind include directories to library build target 2018-10-31 23:13:42 +01:00
elsid
658b32784f Add dependencies between libraries to allow linker to resolve symbols
when build dynamic libraries
2018-10-31 21:24:45 +01:00
Jarrett
56dbf4c482 Allow 64 bit windows builds (#301) 2018-10-16 00:02:51 +02:00
Zeno Ahn
9f9efe943e Removed unnecessary comment 2018-09-02 15:03:41 +02:00
MoYummy
13dc549bbe Improve triangulateHull to start from an ear with shortest perimeter 2018-08-25 12:18:27 +02:00
Roman Siromakha
05b2b8da80 CMake for Windows (#339)
* 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
2018-06-18 23:11:36 +02:00
Jakob Botsch Nielsen
b39e967e4f Fix test that fails on Clang due to float compares
These results were failing because of trying to do exact floating point
equality on computed values.
2018-06-16 17:04:54 +02:00
Jakob Botsch Nielsen
6e36a351c2 Remove unused code causing warning 2018-06-16 17:04:54 +02:00
Jakob Botsch Nielsen
5c24b5960f Fix warning due to signedness
Fixes #334
2018-06-16 17:04:54 +02:00
Jakob Botsch Nielsen
c2d7463a38 Add Clang to Travis and treat warnings as errors
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.
2018-06-16 17:04:54 +02:00
Peter Boyer
c4ad0b2eb4 Fix for typo
We shouldn't leave such a shocking typo on such a nice description, now should we? ;)
2018-06-16 11:35:24 +02: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
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
Nikolay Zapolnov
689cf00bd9 Call proper memory deallocation function. 2018-05-14 14:50:48 +02:00
mbabinski-at-google
fa7debb0c3 Add homebrewed rcVector class and tests, and use it to implement rcIntArray. (#318)
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
2018-05-13 16:22:56 +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
Roman Siromakha
4566d01c8f Support build by CMake (#310) 2018-04-21 00:16:52 +02:00
cexikitin
05dd77db19 Provide better feedback when dtNavMesh::addTile fails due to a tile already being present at a given x,y 2018-03-20 00:05:29 +01:00
elsid
367065415c Unconditionally initialize rcCompactHeightfield borderSize
To avoid uninitialized value when borderSize <= 0.
2018-03-20 00:01:57 +01:00
but0n
494c2967a7 doc: fix typo SDl 2018-03-04 14:10:28 +01:00