Commit Graph

878 Commits

Author SHA1 Message Date
Graham Pentheny
5e09fde319 Better names for member fields in Solo Mesh Sample class 2025-03-29 17:18:31 -04:00
Graham Pentheny
eee39c1020 Change DrawMode enum in SoloMesh sample to an enum class with explicit size
Since this namespaces the enum values and makes them easier to read and reference.
2025-03-29 16:01:48 -04:00
Graham Pentheny
5f9a2cd714 Remove trailing whitespace 2025-03-29 15:26:35 -04:00
Graham Pentheny
4db6f71c77 Cleanup solo mesh sample 2025-03-29 15:26:15 -04:00
Graham Pentheny
b82953c2fc Consolidate forward-declarations in Sample.h 2025-03-29 14:58:21 -04:00
Graham Pentheny
d3b058404f Cleanup includes in main.cpp 2025-03-29 14:06:32 -04:00
Graham Pentheny
f1e7192147 Modernize rule-of-three for Sample.h 2025-03-29 14:06:14 -04:00
Graham Pentheny
877547f326 Remove redundant code in Sample.h and add some consts 2025-03-29 14:05:58 -04:00
Graham Pentheny
f7f3b1daed Explicitly set c++ version per-project. Set RecastDemo and Tests projects to C++20
We don't care as much about ultra-compatibility with RecastDemo or Tests.  C++20 seems fairly universal at this point considering Unreal 5 ships with it as the default requirement.

We want to keep the other stuff to C++98 still because eventaully we'll convert it to C99 and not having a ton of modern C++ features everywhere make it significantly easier.
2025-03-29 14:00:10 -04:00
Graham Pentheny
bd98d84c27 Silence integer narrowing conversion warnings
These started after we switched from rcIntArray to rcTempVector<int>
2025-03-29 13:43:59 -04:00
Zach Toogood
0096f0dae9 Add exit condition to raycast() if DT_BUFFER_TOO_SMALL (#753) 2025-03-18 09:46:28 -07:00
Graham Pentheny
2253271091 Remove the deprecated rcIntArray (#769)
* Replaced references to rcIntArray with rcTempVector<int>

rcIntArray is deprecated and has been replaced with rcTempVector.  The current implementation is just a wrapper for rcTempVector.

* remove rcIntArray implementation

Since it's no longer referenced
2025-03-18 09:43:10 -07:00
Graham Pentheny
3527a8270d Replace xorb with xor operator (#770)
The xorb function just gets compiled to an xor instruction in -O3, so this is just unnecessary pessimistic code.

https://godbolt.org/z/o5TGjsx6T
2025-03-18 09:42:55 -07:00
Song
7c951a494f chore: ensure that the bits of poly ref do not overflow. (#763) 2025-03-18 09:42:20 -07:00
Graham Pentheny
77f7e54bc8 Don't remove custom assert failure registering code when disabling assertions (#751)
Otherwise, when disabling assertions, client code that calls these custom assertion failure callback registration functions will break.
2024-12-31 12:59:59 -05:00
Graham Pentheny
6bc79535bb Cleanup docstrings and some formatting in RecastAlloc.h 2024-12-31 12:49:06 -05:00
Graham Pentheny
361775849d Explicitly use html tags in Changelog to work around bug in doxygen (#750)
There's a bug in doxygen's markdown html generator when specifying header text that's just link text.  This is fixed in newer versions of doxygen, but the ubuntu images in github actions runners don't have a new enough version to work around this.  Instead, just write out the html explicitly for now.
2024-12-31 01:27:57 -05:00
Graham Pentheny
c126555c10 Explicitly specify Ubuntu 24.04 rather than ubuntu-latest (#749)
Since ubuntu-latest is using 22.04, and the version of doxygen it uses is generating some incorrect headers.
2024-12-31 00:29:23 -05:00
listenwind
1f0ce60544 feat: add window resizing support (#746)
- Add SDL_WINDOW_RESIZABLE flag to enable window resizing
- Handle SDL_WINDOWEVENT_RESIZED event to update window dimensions
- Update OpenGL viewport and projection matrix when window is resized

This change allows users to resize the application window while maintaining
proper aspect ratio and rendering.
2024-12-30 23:29:37 -05:00
Graham Pentheny
03c1101b18 Use newer clang and ubuntu version when building linux tests project (#748)
Since we need to build with clang 18 and ubuntu-latest is still set to 22.04 which uses clang 14.
2024-12-30 23:20:12 -05:00
Kurt
f79938bbee Fix typo and paper link (#702) 2024-12-30 23:15:23 -05:00
Roman Siromakha
63dd4aa332 Support enabling and disabling asserts for CMake builds (#728) 2024-12-29 12:39:07 -05:00
Graham Pentheny
93bd042349 Disable calls to isfinite when compiling with -ffast-math (#747)
Fast math is not required, but it speeds up some calculations at the expense of accuracy. There are some functions like dtMathIsfinite that use floating point functions that become undefined behavior when compiled with fast-math, so we need to conditionally short-circuit these functions when compiled with that flag.

-Wnan-infinity-disabled is complaining about the isfinite call in dtMathIsfinite.

This also sets the linux runner explicitly to Ubuntu 24.04, since ubuntu-latest defaults to 22.04 for some reason. This also updates gcc and clang to the latest versions in apt and logs their version to the run output.  We need at least clang18 to disable the -Wnan-infinity-disabled warning for Catch.

Finally, this also removes some unused code that was throwing a warning (and thus an error) on newer compiler versions.
2024-12-29 12:36:08 -05:00
Graham Pentheny
ac4376d597 Install libglu1-mesa-dev as a linux build dependency in Github Actions
Because something changed and now we're getting errors about not being able to find glu.h
2024-12-28 01:09:03 -05:00
Graham Pentheny
8c8df48811 Changelog links use simple formatting
Because the docs pages don't render the footnote-style markdown links correctly.
2024-12-27 14:16:37 -05:00
Graham Pentheny
455a019e7a Added coordinate system and winding order to FAQ 2024-04-28 16:38:34 -04:00
RoboSchmied
c2a0d94d02 Fix: 6 typos (#698)
Signed-off-by: RoboSchmied <github@roboschmie.de>
2024-04-12 11:54:01 -04:00
Graham Pentheny
44ff936db5 Fixed typo in README.md 2024-03-23 10:10:48 -07:00
Someone
bae7b4f194 CMake: .pc: let GNUInstallDirs generate the paths (#692)
The concatenation was resulting in paths like
libdir=${exec_prefix}//nix/store/...-recastnavigation-1.6.0/lib
2024-03-16 12:48:16 -04:00
Roman Siromakha
599fd0f023 Fix out of bounds access in dtMergeCorridorStartMoved and add tests (#635)
size can become negative if req > maxPath. This may happen when visited buffer is larger than path buffer.

Add tests to cover different use cases of the function including Should add visited points not present in path up to the path capacity to cover the fix.

List tests files explicitly. When new file is added CMake does not add it to the already generated list if GLOB is used.
2024-01-28 13:26:50 -05:00
Graham Pentheny
b2d8fa9796 Fixed old parameter names in out-of-line Recast function documentation 2024-01-07 16:08:28 -05:00
Graham Pentheny
c393f055cb Fixed broken doc file links after re-name 2024-01-06 19:09:53 -05:00
Graham Pentheny
f974101ec6 Fixed ordering of custom pages in doxygen's sidebar
Apparently it's alphabetical and based on the order in which the files are specified in INPUT
2024-01-06 16:57:22 -05:00
Graham Pentheny
cc131d8261 Added introduction documentation 2024-01-06 16:56:40 -05:00
Graham Pentheny
218e9e8ff3 Removed link brakets from old versions in changelog 2024-01-06 16:56:15 -05:00
Graham Pentheny
1605a558c4 Ported FAQ to a markdown file in the docs folder
So that it's shipped with the code and also part of the doxygen docs at recastnav.com
2024-01-05 01:34:05 -05:00
Graham Pentheny
bc0d1b1f77 Backported old release notes to Changelog.md for posterity 2024-01-05 00:58:57 -05:00
Graham Pentheny
c36a40645a Cleanup filter code and improved documentation (#683)
This mostly just changes variable names and adds some comments to make the code more clear.

It also has a few small fixup changes to the unit tests.
2024-01-01 14:56:47 -05:00
Graham Pentheny
fc18ed8194 Some unit tests for heightfield filtering functions (#682)
This adds some unit tests for the functions in RecastFilter.cpp, and updates docs around these functions. This also splits up the Tests_Recast.cpp file into a few smaller, more focused files.
2023-12-31 14:55:41 -05:00
Cupcake
3e94c3b6fc Code cleanup and small optimizations in RecastFilter.cpp rcFilterLedgeSpans (#672)
* Code cleanup and minor refactor in RecastFilter.cpp rcFilterLedgeSpans

Because span.smax is always > 0, bot > 0 as well, and (-walkableClimb - bot) is always < -walkableClimb. Furthermore, as long as minNeighborHeight < -walkableClimb' at least once, there is no need to continue the traversal.

* Code cleanup and minor refactor in RecastFilter.cpp rcFilterLedgeSpans

Because span.smax is always > 0, bot > 0 as well, and (-walkableClimb - bot) is always < -walkableClimb. Furthermore, as long as minNeighborHeight < -walkableClimb' at least once, there is no need to continue the traversal.

* Update RecastFilter.cpp

Revise Comment
2023-12-31 14:27:07 -05:00
Graham Pentheny
246ca3c849 Specify C++ compiler verision requirement in README.md 2023-12-30 19:39:13 -05:00
Graham Pentheny
7e32b75a7d Fixed README.md 2023-12-30 19:35:57 -05:00
Graham Pentheny
8f7b9a84fb Fix centering in README.md
Since github has some weird rules about how they handle html in markdown.
2023-12-28 18:24:43 -05:00
Graham Pentheny
1c87cff00c Improved doxygen output (#681)
Added logo, updated doxyfile, fixed alignment of top-level readme, and changed the logo url to an s3-hosted file since github has restrictions that prevent it from loading on recastnav.com
2023-12-28 18:23:26 -05:00
Graham Pentheny
afe7d9e8e4 Fixed logo href in README.md 2023-12-28 17:08:34 -05:00
Graham Pentheny
53089459fa Docs Overhaul (#680)
A lot of the auxiliary project documentation was pretty old, redundant, or could use some polishing.  This change fixes up some wording, grammar, layout and generally cleans up the docs a bit.  It's not perfection, but it's an improvement

I also tried to streamline and beautify the top-level `README.md` to be more appealing, clear, and to direct people to the official docs.  To this end, I moved the building instructions to This is based on what I've seen in some other popular github projects.
2023-12-28 17:06:03 -05:00
Jakob Botsch Nielsen
c393777d26 Make detail mesh edge detection more robust (#657)
Instead of using a distance check which can fail at large magnitudes due
to low precision we can check whether the edges are actually on the
hull.
2023-12-20 00:46:50 -05:00
Anders Elfgren
9044200bc0 Added links in readme to docs site and github repo to make it easy to find one from the other. (#677) 2023-12-20 00:41:24 -05:00
shine
ddaa361b08 fix:rcBuildLayerRegions missing areaType (#470)
Co-authored-by: sunming <359944951@qq.com>
Co-authored-by: Graham Pentheny <grahamboree@users.noreply.github.com>
2023-11-12 16:30:28 -05:00
Gamemechanic
cd898904b7 Minor refactor in RecastMesh.cpp (#661) 2023-09-04 10:53:41 -04:00