233 Commits

Author SHA1 Message Date
Graham Pentheny
ee2d4ef6e6 Updated dead links in comments with archived versions
Fixes #623
2023-05-21 01:37:27 -04:00
andriyDev
53f7818027
Add a CMake option to use dynamic dispatch for dtQueryFilter in Detour. (#628) 2023-05-04 21:56:41 -04:00
andriyDev
32e5f94b11
Add a CMake option to enable 64bit dtPolyRefs for Detour. (#627)
Previously, setting this option required either enabling this option by modifying the source, or doing some CMake hacking to inject the variables. Now this is a convenient option.
2023-04-29 20:11:38 -04:00
Graham Pentheny
cc944f28c1
Removed STL function added in C++11 from Detour (#616)
to maintain C++03 standard compatibility
2023-03-25 13:29:29 -04:00
Graham Pentheny
8e9c308afd
Increase epsilon in detour common segment polygon intersection test (#612)
It's only used to detect if the segment is parallel to the polygon edge in question, and if so, skip actually doing the intersection test.  This sets the epsilon to 1e-6, which is about 10x the machine epsilon for 32bit floats, so it's low enough to not give false positives but it's large enough to correctly detect segments and polygon edges that are very nearly parallel.
2023-03-20 01:03:27 -04:00
andriyDev
b921dd16b1
Make installing PDBs optional. (#611)
PDBs are not necessarily generated, even in Debug configuration. For example, if the CXX_FLAGS are set to /Z7, debug symbols are embedded, and so the PDBs are not generated. This prevents installing from failing by marking these PDBs as optional.

Fix #610
2023-03-19 22:31:18 -04:00
Graham Pentheny
2b0c244d12
Updated doxygen output (#581)
- Upgraded doxyfile to latest format
- Fixed a bunch of warnings and errors in docstrings that doxygen was complaining about
- Added the doxygen-awesome theme to modernize the output
- Removed a duplicate screenshot we'd had in the docs folder
- Moved the RecastDemo screenshot into the Docs/images folder
- Changed the doxygen main page to be the README.md since the dedicated main page file we had was nearly identical but out of date
- Added CONTRIBUTING.md so it's part of the generated doxygen output
- Removed duplicate license file to avoid confusion
- Combined the FAQ with the Recast_api.txt, since the FAQ was essentially just better docs for the members of `rcConfig`
2022-11-23 00:13:38 -05:00
SpaceIm
53f779fa8d
install CMake config file with exported targets (#575) 2022-11-20 15:42:04 -05:00
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
EfveZombie
0af470fe74
fix: use closestPointOnPoly instead of getPolyHeight in dtNavMeshQuery::findRandomPoint (#560) 2022-10-13 11:27:06 +02:00
Anton Matveev
9df3e2e0a6 Fix rounding error due to precision loss after optimization. 2022-10-12 00:03:00 -04:00
ZA139
314e94b692 Fix the typo though of dtVperp2D function comment
fix typo though
2022-10-09 22:18:11 -04:00
ZA139
3a1924e3b0 Correction the comment of dtVperp2D
The return value should be the perp dot product rather than the dot product.
2022-10-09 22:18:11 -04:00
Graham Pentheny
2164a272e5 Updated array size in docstring for dtMeshTile::verts
Thanks to @pineappleKID for pointing this out!
https://github.com/recastnavigation/recastnavigation/issues/535
2022-10-07 18:12:19 -04:00
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
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
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
Yoann Potinet
65b314a44e Fix shared library build 2020-10-31 10:38:31 +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
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
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
云风
7ccb72b383 Optimize dtClosestHeightPointTriangle (#364) 2018-11-09 14:52:00 +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
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
aymarfisherman
7cca61dc41 Renamed all instances of 'extents' to 'halfExtents' (#279) 2017-08-20 17:05:51 +02:00
Geoyeob Kim
46654531e4 Fix 'dtRandomPointInConvexPoly()' returning a garbage value if s == 1.0f. (#271) 2017-05-15 16:26:35 +02:00
Domenico Albani
dfd40071c5 Assertion failure custom function (#250)
Implement custom functions to be called when an assertion fails.
2017-01-23 23:02:46 +01:00
Jakob Botsch Nielsen
15ebb8bd25 Take detail mesh into account for creating BV-tree (#231)
In U and A shaped terrain it was possible that polygons extruded their
BV-tree nodes significantly. This happened because all points for the
polygon (when excluding the detail mesh) were either on the high-level
terrain, or on the low-level terrain. This fixes the long-standing todo
about this.

As a result of this change, findNearestPoly and queryPolygons should
return more accurate results.

Fix #230
2016-09-09 12:03:37 +02:00
Jakob Botsch Nielsen
88b8d409a7 Properly use detail mesh from closestPointOnPoly (#228)
When a point is outside the polygon being queried in
dtNavMesh::closestPointOnPoly and dtNavMeshQuery::closestPoinOnPoly,
Detour will interpolate along one of the edges to find the closest point
on the poly. However, Detour did not properly use the interpolated point
to find the correct height according to the detail mesh.

Fix #227
2016-09-07 10:55:35 +02:00
Jakob Botsch Nielsen
64385e9ed0 Fix findPath to return DT_OUT_OF_NODES correctly (#222)
findPath was unconditionally overriding the status it used to indicate
DT_OUT_OF_NODES for later. Restore this behavior so it properly can
return this failure flag.

Fix #221
2016-07-27 20:40:42 +02:00
Ian Masters
ab0a679d8f Fix for Struct 'dtNode' was previously declared as a class (#213) 2016-06-25 10:09:34 +02:00
Jakob Botsch Nielsen
2a0c31b8ef Add getPathFromDijkstraSearch function (#211)
This adds a method to dtNavMeshQuery that allows users to retrieve paths
from the nodes explored by the previous Dijkstra search. This is useful
after Dijkstra searches to retrieve arbitrary paths inside the explored
area.
2016-06-10 12:20:27 +02:00
Jakob Botsch Nielsen
8628710178 Take area costs into account in Dijkstra searches (#208)
findPolysAroundCircle and findPolysAroundShape were only using distances
to compute the costs. This was inconsistent with other APIs that
performed cost-based searches and accepted filters as parameters.
2016-05-24 17:54:03 +02:00
Jakob Botsch Nielsen
12569b5cf6 Append results correctly in Dijkstra searches (#205)
This changes the Dijkstra searches in findPolysAroundCircle and
findPolysAroundShape to append the results when we visit nodes in the
main loop. The algorithm guarantees that we will never visit them again
after this, so at this point we are guaranteed that we cannot find a
better path.

Previously results would be appended the first time we saw a polygon
which meant later improvements on the paths to those polygons would not
be reflected in the results.

Fix #204
2016-05-18 13:01:41 -04:00
tfabretti
16bea738b8 Fixed a links issue due to offmesh connections
When creating the tile's links, offmesh connections inside the tile were
added twice, leading to the array of links being full and not being able
to store the links computed after (portals between tiles).
2016-05-02 20:59:51 +02:00
Graham Pentheny
95658e7b6c Added eof newlines. Fixes #198 2016-03-30 13:48:05 -04:00
Ben Hymers
222fa1ee6f Fix possible out of bounds array access in Detour closest point functions
These were reported by Coverity Scan. They're extremely unlikely but still
possible - if all edges of a poly are FLT_MAX or further away from the
input point, a negative index may be used to access the verts array of a
poly.

The fix is to arbitrarily pick the first edge as the closest in case all
are tied as being very far away.
2016-03-14 10:22:31 +00:00
Ben Hymers
2f382134d4 Remove dead assignments to status value in findStraightPath
Add comments explaining why the return values are ignored
Clarify the status return value logic in appendVertex
2016-03-14 09:03:41 +00:00
Ben Hymers
8f16b7de2f Remove dead assignments
Credit to @rafzi in PR #93
2016-03-14 09:03:40 +00:00
Ben Hymers
c208fd332c Minor typo and style changes 2016-03-14 09:03:40 +00:00
Ben Hymers
40a88dae73 Fix blank assignments while advancing through buffer, using new dtGetThenAdvanceBufferPointer 2016-03-14 09:03:39 +00:00
Jakob Botsch Nielsen
09afa02f4a Fail when too many nodes are requested
dtNavMeshQuery now fails initialization if too many nodes are requested
in the node pool. This could cause wrong paths and infinite loops to
happen if the node indices started overflowing dtNodeIndex or
dtNode::pidx.

Fix #178
2016-02-22 08:45:24 +00:00
Jakob Botsch Nielsen
e30a6635a2 Fix warnings and increase demo text pool size
Fix three warnings added in fc5df2c, and increase the text pool size in
the demo. This would frequently be overflowed, even just by building
with the default settings and expanding the log.
2016-02-16 10:27:18 +01:00
Jakob Botsch Nielsen
fc5df2c6fd Add API to query polygons in batches
This adds a version of queryPolygon that takes an interface which is
passed batches of polygons in the search area. This new API is then used
from the old queryPolygons to collect polygons, and from findNearestRef
to find the nearest poly in an arbitrarily sized area. Previously
findNearestPoly had an arbitrary poly limit of 128 which could cause it
to return potentially wrong results.

Fix #107
2016-01-25 23:25:48 +01:00