807 Commits

Author SHA1 Message Date
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
Alexey Sokolov
a015950eaa
Use external Catch2 if available in cmake build (#600) 2023-03-25 13:29:08 -04:00
FcAYH
b0ed8b7a3c
fixed a typo (countour -> contour) (#617) 2023-03-25 13:22:02 -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
ede5c5d85a Added code of conduct to doxygen input 2023-03-18 18:18:58 -04:00
Graham Pentheny
c2c92e6d18 Added link to Q&A section of Github Discussions to the contributing doc as the proper place to post questions 2023-03-18 18:15:28 -04:00
Graham Pentheny
286b154c39 Updated Code of Conduct
Fixed dead link, changed to contributor covenant.
2023-03-18 18:15:28 -04:00
Graham Pentheny
d18a4a6bbd
Gh pages deploy workflow (#608)
Build and deploys doxygen docs to a gh-pages branch so they can be hosted in GitHub pages.
2023-03-18 17:27:33 -04:00
Alexander
3c4a34968a
Fix for out of bounds read in tile cache builder. (#601)
Fix for reading data out of bounds in tile cache builder in
removeVertex.
While removing a vertex data is read from i+1 index from mesh.verts,
which becomes out of bound for the last vertex, which we shouldn't copy
over in this case.
2023-03-15 23:04:41 -04:00
Graham Pentheny
405cc095ab Add missing null check in rcFreePolyMeshDetail 2023-01-02 17:20:10 -05:00
Graham Pentheny
a4be369ac3 Removed rcPolyMeshDetail destructor to maintain backwards-compatibility
https://github.com/recastnavigation/recastnavigation/pull/598#discussion_r1059522812
2023-01-02 14:05:02 -05:00
Graham Pentheny
b43c82c808
Removed _USE_MATH_DEFINES directive (#596)
Since none of the `M_` prefixed constants are used anywhere in the code, this is unnecessary.  It's also Windows-specific, so these non-standard defines shouldn't be used anyway.

Ref: https://learn.microsoft.com/en-us/cpp/c-runtime-library/math-constants?view=msvc-170
2022-12-29 15:09:01 -05:00
Graham Pentheny
7501007439
More Recast code cleanup (#598)
* Code formatting, dosctring consolidation, spelling fixes
* Fixed rule-of-three for rcCompactHeightfield, rcHeightfieldLayerSet, rcContourSet, rcPolyMesh
* Better names for variables and parameters mostly in Recast.cpp
* Added constructor and destructor to rcPolyMeshDetail
* Remove redundant default-value specifiers in constructor initialization lists.
2022-12-29 14:57:46 -05:00
Graham Pentheny
b51925bb87
Cleanup Rasterization Code (#592)
Mostly just improving variable names for clarity.

Removed a redundant base-case check in AddSpan that resulted in a small but measurable perf improvement due to removing a branch. Also tightened up the bounding box overlap check so it early-outs faster, which also has a small perf improvement to rasterization times.

Updated docstrings for user-facing functions.

* Moved docstring comments to the header with the rest of the docstring
* Removed unused function
* Make a cpp-only function static
* Added docstring for rasterizeTri
* Use spaces to indent function parameter lists so they look good regardless of the editor's tab width
* Better parameter names for rcClamp
* Cleanup code formatting, a couple variable names, and some comments in rasterizeTri
* Clean up dividePoly, added rcAxis enum
* Cleanup rasterizeTri docstring
* Faster overlapBounds check in rasterization
* Renamed some vars in rasterizeTri
* cleanup addSpan and remove redundant branch
* addSpan docstring
* Cleanup the implementations of rcRasterizeTriangle and rcRasterizeTriangles overloads
* Added docstrings and renamed vars in rcAllocSpan and rcFreeSpan
* Clean up rcRasterizeTriangle and rcRasterizeTriangles in the header.  Removed redundant const qualifiers on value parameters
* Better parameter names for rasterizeTri, updated docstring, fixed some incorrect comments
* Improved parameter names of rcRasterizeTriangle, rcRasterizeTriangles, and rcAddSpan
* Fixed some old variable names referenced in the docstring for rcAddSpan
2022-12-22 12:16:04 -05:00
Graham Pentheny
d0b2ed8ff5 Run apt-get update before trying to install libgli and libsdl2 on linux build machines
Fixes this issue https://github.com/actions/runner-images/issues/5562
2022-11-27 20:00:12 -05:00
Graham Pentheny
04ea2a57b1
Update README.md 2022-11-25 21:45:32 -05:00
Graham Pentheny
5f642c5e5c Updated readme with better grammar and high-level overview 2022-11-25 21:44:54 -05:00
Graham Pentheny
250c3041ce Added development roadmap 2022-11-25 21:38:11 -05:00
Graham Pentheny
67ba9a2a15
Fix macOS CMake SDL linking (#584)
* Ignore cmake intermediate build dir

* Fix C++ language version in cmake build scripts

* Set a default SDL2_ROOT_DIR value for macOS in cmake scripts

* Fixed macOS SDL framework linking in cmake scripts

* Added macos-cmake target for CI builds in github workflows

* Use C++17 for building Tests instead of 20, since we build them with VS2019 in some jobs
2022-11-25 20:29:11 -05:00
Graham Pentheny
4fef044660 Unit test to check for crashes in rasterizing long, skinny triangles
Specifically, when rasterizing a triangle into a heightfield with width or height of 0.  This can happen when the input geometry bounding box extents are less than half the cell size in either x or z.  This is a degenerate case, but can crop up in real life scenarios (see https://github.com/godotengine/godot/issues/65764) so we should at least ensure it doesn't crash here.
2022-11-25 19:55:38 -05:00
Piotr Piastucki
3901c5854c
Fix incorrect rasterization at tile borders (#476)
* Fix incorrect rasterization at tile borders

Clip the polygon at the tile border and disregard coordinates outside of
the tile before clamping.

* Added unit test with minimal repro case for the rasterization issue fixed in PR #476

Co-authored-by: Graham Pentheny <graham.pentheny@gmail.com>
2022-11-23 02:42:03 -05: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
b1e04cf59c
Updated build badges in Readme to use workflows 2022-11-12 13:37:41 -05:00
Graham Pentheny
3d0f0a3d9e
Github Workflows based CI system to replace Appveyor and Travis (#580)
The goal here is to replace the current (slightly broken) Travis + Appveyor setup with something that covers more cases and is a bit better supported and easier to maintain. This hopefully helps us catch cross-platform issues quicker. For example, the linux and clang compilation issues that have existed for a while could have been caught if we were building those targets in CI.

This adds a build script that builds the following configurations for every repo commit and PR:

    macOS, premake, Debug
    macOS, premake, Release
    linux, premake, gcc, Debug
    linux, premake, gcc, Release
    linux, premake, clang, Debug
    linux, premake, clang, Release
    linux, cmake, Debug
    linux, cmake, Release
    windows, premake, vs2019, Debug
    windows, premake, vs2019, Release
    windows, premake, vs2022, Debug
    windows, premake, vs2022, Release
    windows, cmake, vs2019, Debug
    windows, cmake, vs2019, Release
    windows, cmake, vs2022, Debug
    windows, cmake, vs2022, Release

It also builds and runs the catch tests executable in the following configurations. A failed test will fail the build.

    macOS, premake, Debug
    linux, premake, clang, Debug
    windows, premake, vs2022, Debug

It doesn't currently build cmake on macOS because there is a one blocker there (#577). We could also add additional builds like cmake with both clang and gcc on linux, but for now this is much better coverage than we have currently.
2022-11-12 13:27:46 -05:00
Graham Pentheny
17a19d0e82
Simplified macOS Build Process (#579)
This makes the default xcode project generated by premake work out of the box, and is generally easier for mac users.  Especially those who don't have permissions to modify /Library/Frameworks/

- Look for SDL in RecastDemo/Bin by default rather than /Library/Frameworks/
- Updated README build instructions
- Ignore SDL2.framework in RecastDemo/Bin
2022-11-11 21:04:29 -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
Graham Pentheny
ea7bfbee70
Fix clang linux builds (#578)
Also remove hard-coded filter on gmake premake target since it's deprecated in favor of gmake2. It also doesn't matter; what matters is that we filter on gcc, since the warnings we've disabled don't exist in clang and will throw errors.
2022-11-11 20:11:14 -05:00
Siddharth J Singh
e6b675bb9a
Fastlz fix for -Wno-class-memaccess' is valid for C++/ObjC++ but not for C (#479)
* Added a selective filter for *.c files compiled on linux using make

Co-authored-by: Graham Pentheny <graham.pentheny@gmail.com>
2022-11-09 11:54:56 -05:00
Graham Pentheny
b0d71bed92 Removed VS2015 and fixed cmake generators for 2019, 2022
Catch seems to only work with VS 2017+
2022-11-07 23:34:36 -05:00
Graham Pentheny
80e55ebfb7 Update to a newer premake version that supports vs2019 and vs2022 2022-11-07 23:34:36 -05:00
Graham Pentheny
9098a81682 Change to C++14 instead of C++20
Updated appveyor version matrix.  Removed vs2013
2022-11-07 23:34:36 -05:00
Graham Pentheny
bab65d759d Updated cmake build with Catch2 library location 2022-11-07 23:34:36 -05:00
Graham Pentheny
7dfa9849ca Updated Catch2 testing library to v3.1.1
https://github.com/catchorg/Catch2

Updated tests with new API changes as well.
2022-11-07 23:34:36 -05:00
Graham Pentheny
d576e71b25 Disable class-memaccess error to fix builds on Ubuntu with newer versions of GCC
Based on SgtVincent's suggestion here: https://github.com/recastnavigation/recastnavigation/issues/497#issuecomment-1293318731

Fixes #497
2022-10-29 14:37:10 -04:00
Graham Pentheny
0d1cbd3d67 Don't explicitly create a GL context since SDL_CreateWindowAndRenderer does it internally.
Having two GL contexts causes rendering problems on Ubuntu.  Fixes #521
2022-10-25 23:18:11 -04:00
Graham Pentheny
96dc90b6ff Fix deprecation warnings when using premake5
The premake script generates some deprecation warnings when generating with premake5:
- "configuration" has been deprecated in favor of "filter"
- "solution" was renamed to "workspace"
2022-10-25 23:17:58 -04:00
Graham Pentheny
c14a5a5897 Ignore generated dSYM debug symbols archive on mac 2022-10-25 23:17:08 -04:00
Graham Pentheny
4e233f22b4 Added configuration protips from Mikko's blog to a FAQ 2022-10-15 01:59:47 -04: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
grdowns
a425d03b0e Add vcpkg installation instructions 2022-10-11 23:48:55 -04:00
Andrei Kortunov
30edaf442c Fix -Wextra-semi GCC warnings by removing redundant semicolons 2022-10-11 23:45:27 -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
Graham Pentheny
c187b7e88b
Removed broken IssueStats badges from README.md 2022-06-03 02:56:44 -04:00
Brian Swenson
c02d6fa81e -Wunused-but-set-variable flagged variables removed 2022-06-03 02:24:29 -04:00
Prin_E
5a870d427e Fixed RecastDemo crash in macOS 10.11+
* Set hints to always use OpenGL render driver (instead of Metal driver)
* Compile error fix in Xcode 13
2022-03-20 15:33:19 -04:00