140 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
Graham Pentheny
95658e7b6c Added eof newlines. Fixes #198 2016-03-30 13:48:05 -04: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
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
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
Ben Hymers
551d1b250e Use size_t for rcAlloc and dtAlloc
This was already partly done by @cexikitin in #65, I'm just finishing it
off in their absence!

Closes #65
2016-01-15 00:36:18 +00:00
Graham Pentheny
43a20cce42 Merge pull request #109 from Kromster80/patch-2
Updated dtFindPathOptions description and options
2016-01-02 10:30:37 -05:00
Jakob Botsch Nielsen
e2cc5ae419 Correctly remove off mesh links to other layers
External links representing off mesh connections between layers in the
same tile location would not be correctly removed. These links had
side = 0xff which were skipped during tile removal under the assumption
that these links were internal.

Also correct some comments in the same place.

Fix #113
2015-12-29 17:51:15 +01:00
Richard Fine
67736ae7d5 Include hit edge index in dtRaycastHit.
This makes it simpler to investigate exactly what is blocking a ray - for example, if an agent cannot move onto a polygon due to QueryFilter flags, then this provides a way for the agent to find out which flags it needs to have and to perform a state change which alters its movement flags.
2015-11-15 21:46:30 +00:00
Krom Stern
bbbdc0ec64 Updated dtFindPathOptions description and options
"Options for dtNavMeshQuery::FindPath" is not correct, the option is used in SlicedFindPath only
DT_FINDPATH_LOW_QUALITY_FAR is not used anywhere

I would also add, that even though raycast considers costs, does so not very well :-(
2015-08-29 17:22:35 +03:00
grahamboree
45b36f4d75 Removed redundant dtSqrt function and replaced calls to it with dtMathSqrtf 2015-01-03 16:00:00 -05:00
grahamboree
a792998286 Replaced math function macros with inline functions. 2015-01-02 18:10:45 -05:00
axelrodR
90a3c7a8ae code style correction following rafzi's comments 2014-06-19 17:36:37 +03:00
axelrodR
8816e71535 Merge branch 'master' of https://github.com/memononen/recastnavigation 2014-06-19 17:04:14 +03:00
Janiels
943bf35d32 Add virtual destructor to dtQueryFilter 2014-06-14 15:45:36 +02:00
axelrodR
27ffa5b4d3 fixes following mikko's comments from 11/4/14 2014-04-23 16:24:36 +03:00
axelrodR
a7f1d5e6a4 spelling mistakes 2014-04-23 14:52:54 +03:00
axelrodR
232187b9d6 changed the default options of the pathfinder to 0 (i.e. no raycasts), changed the the tester tool to display all points along the sliced path (a better default for non flat terrain). 2014-02-27 14:21:09 +02:00
axelrodR
c2b2b03b8f bug fix: returned path had duplicates of nodes 2014-02-27 01:47:21 +02:00
axelrodR
ffbff5dcc9 changed the remarks and value of RAY_CAST_LIMIT_PROPORTIONS 2014-02-26 22:48:27 +02:00
axelrodR
1613a5565f following mikko's comments on push #17 (part 2). Interfaces changes, the most notable is adding option flags to initSlicedFindPath that can cancel the any-angle search 2014-02-26 21:29:13 +02:00
axelrodR
1b7b918641 following mikko's comments on push #17. Interfaces changes, the most notable is adding a new raycast function and converted the existing to a thin wrapper. 2014-02-25 11:33:06 +02:00
axelrodR
7bc913aada Merge branch 'master' of https://github.com/axelrodR/recastnavigation 2014-02-16 16:57:30 +02:00
axelrodR
120de6256f changed path planner to Theta*, changed the raycast function to emit a cost based on the actual traversal cost 2014-02-16 16:51:29 +02:00
axelrodR
0494d61ddb Merge branch 'master' of https://github.com/memononen/recastnavigation 2014-02-13 00:08:49 +02:00
Mikko Mononen
6702143bc1 Fix for broken raycasts, changes how findNearestPoly works, slight API change
- test case supports raycasts
- changes how findNearestPoly works directly over polygons
- API change: findNearestPoly has additional parameter
2014-02-11 20:32:00 +02:00
axelrodR
e2722403be bugfix: raycasts sometimes fail when the origin is near a boundary of a triangle with a slope. The fix of considers polygons to have a thickness for the purpose of finding closest nodes. 2014-02-10 00:30:46 +02:00
axelrodR
72b7123e72 moving from creating several nodes at once for the same ref to creating as needed based on ref and state (where state is currently used only for border poly to keep the arrival side). 2014-01-31 11:26:12 +02:00
axelrodR
d2306cacdd improving path aesthetics at tile crossing: in the old code, when a new node is found a single 3D position is associated with it. This position is used regardless of arriving from a new tile. A minor issue on a normal navmesh, this produces many problems when crossing tiles. Points might be located on different borders altogether depending on where one arrived from first.
The new code assigns several (consecutive) dtNodes for polygons that lie on tile boundary. Each node gets its own point. since the nodes are packed together consecutively, it is easy to find the right node by reference even though there are several.
2014-01-30 11:57:13 +02:00
Mikko Mononen
a08258d9dd Merge pull request #11 from flippy84/master
Update DetourNavMeshQuery.h
2013-12-22 08:02:47 -08:00
Mikko Mononen
6a7f5268ab Added define to compile Detour with 64bit dtPolyRefs 2013-12-22 18:01:06 +02:00
flippy84
3f8c0506fb Update DetourNavMeshQuery.h
Changed existing and existingSize parameters of finalizeSlicedFindPathPartial to @param[in]
2013-12-21 13:49:38 +01:00
grahamboree
dc7e248de6 Removed header dependency between Detour and Recast due to addition of rcIgnoreUnused. Added dtIgnoreUnused. 2013-10-15 17:29:14 -04:00
Matthew Endsley
b0e4e6a834 Add wrappers for the standard math library
Simplifies transition to software based math libraries
for projects requiring determinism.
2013-09-15 20:09:01 -07:00