Compare commits
10 Commits
cc944f28c1
...
6dc1667f58
Author | SHA1 | Date | |
---|---|---|---|
![]() |
6dc1667f58 | ||
![]() |
e9aa38645a | ||
![]() |
a87a328b8b | ||
![]() |
ee2d4ef6e6 | ||
![]() |
9432fd6381 | ||
![]() |
53f7818027 | ||
![]() |
32e5f94b11 | ||
![]() |
6d1f9711b3 | ||
![]() |
f4a65fd317 | ||
![]() |
5c494ad1ee |
59
CHANGELOG.md
Normal file
59
CHANGELOG.md
Normal file
@ -0,0 +1,59 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
|
||||
|
||||
## [1.6.0] - 2023-05-21
|
||||
|
||||
### Added
|
||||
- CMake build support
|
||||
- Unit testing with Catch2 (#147)
|
||||
- Support for AABB and OBB obstacles in `dtTileCache` (#215, #278)
|
||||
- `dtTileCache` supports timesliced updates (#203)
|
||||
- Support for custom assertion functions (#250)
|
||||
- Variant of `findNearestPoly` that exposes distance and isOverPoly (#448)
|
||||
- `dtNavMeshQuery::getPathFromDijkstraSearch` gets a path from the explored nodes in a navmesh search (#211)
|
||||
- A version of `dtPolyQuery::queryPolygon` that operates on batches of polygons rather than just 128 (#175) (Fixes #107)
|
||||
- `rcNew`/`rcDelete` to match `rcAlloc`/`rcFree` (#324)
|
||||
- Better error reporting and input sanitization (#179, #303)
|
||||
- Better debug draw (#253, #254, #255, #256)
|
||||
- Improved docstrings, documentation
|
||||
- (RecastDemo) Load/Save navmesh data (#258)
|
||||
|
||||
### Fixed
|
||||
- Improved robustness, speed and accuracy of navmesh point queries (#205, #208, #228, #231, #364, #381, #560)
|
||||
- Incorrect rasterization at tile borders (#476)
|
||||
- Off-mesh links in tiles were sometimes added twice (#202)
|
||||
- Potential heap corruption when collecting region layers (#214)
|
||||
- `findPath` returns `DT_OUT_OF_NODES` appropriately (#222)
|
||||
- Spans are filtered if there is just enough height (#626)
|
||||
- Increased epsilon in detour common segment polygon intersection test (#612)
|
||||
- Array overrun in `removeVertex` in `DetourTileCacheBuilder` (#601)
|
||||
- Potential rounding error computing bounding box size in `dtNavMesh::connectExtLinks` (#428)
|
||||
- An indexing error in updating agents in `DetourCrowd` (#450)
|
||||
- Allocation perf issues in rcVectorBase (#467)
|
||||
- Dead website links in comments
|
||||
- RecastDemo bugs (#180, #184, #186, #187, #200)
|
||||
- Uninitialized class member values, small memory leaks, rule-of-three violations, other minor issues
|
||||
|
||||
### Changed
|
||||
- Updated stb_image (#184)
|
||||
- Updated stb_truetype (#183)
|
||||
|
||||
### Removed
|
||||
- Use of _USE_MATH_DEFINES directive (#596)
|
||||
|
||||
|
||||
## [1.5.1] - 2016-02-22
|
||||
|
||||
|
||||
|
||||
[unreleased]: https://github.com/recastnavigation/recastnavigation/compare/1.6.0...HEAD
|
||||
[1.6.0]: https://github.com/recastnavigation/recastnavigation/compare/1.5.1...1.6.0
|
||||
[1.5.1]: https://github.com/recastnavigation/recastnavigation/compare/1.5.0...1.5.1
|
@ -4,7 +4,7 @@ project(RecastNavigation)
|
||||
|
||||
# lib versions
|
||||
SET(SOVERSION 1)
|
||||
set(LIB_VERSION 1.5.1)
|
||||
set(LIB_VERSION 1.6.0)
|
||||
string(REPLACE "." "," LIB_VERSION_NUM "${LIB_VERSION}.0")
|
||||
|
||||
set_property(GLOBAL PROPERTY CXX_STANDARD 98)
|
||||
@ -12,6 +12,8 @@ set_property(GLOBAL PROPERTY CXX_STANDARD 98)
|
||||
option(RECASTNAVIGATION_DEMO "Build demo" ON)
|
||||
option(RECASTNAVIGATION_TESTS "Build tests" ON)
|
||||
option(RECASTNAVIGATION_EXAMPLES "Build examples" ON)
|
||||
option(RECASTNAVIGATION_DT_POLYREF64 "Use 64bit polyrefs instead of 32bit for Detour" OFF)
|
||||
option(RECASTNAVIGATION_DT_VIRTUAL_QUERYFILTER "Use dynamic dispatch for dtQueryFilter in Detour to allow for custom filters" OFF)
|
||||
|
||||
if(MSVC AND BUILD_SHARED_LIBS)
|
||||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
||||
@ -33,6 +35,12 @@ set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
|
||||
set(bindir "\${exec_prefix}/${CMAKE_INSTALL_BINDIR}")
|
||||
set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
set(PACKAGE_VERSION "${LIB_VERSION}")
|
||||
if(RECASTNAVIGATION_DT_POLYREF64)
|
||||
set(PKG_CONFIG_CFLAGS "${PKG_CONFIG_CFLAGS} -DDT_POLYREF64")
|
||||
endif()
|
||||
if(RECASTNAVIGATION_DT_VIRTUAL_QUERYFILTER)
|
||||
set(PKG_CONFIG_CFLAGS "${PKG_CONFIG_CFLAGS} -DDT_VIRTUAL_QUERYFILTER")
|
||||
endif()
|
||||
configure_file(
|
||||
"${RecastNavigation_SOURCE_DIR}/recastnavigation.pc.in"
|
||||
"${RecastNavigation_BINARY_DIR}/recastnavigation.pc"
|
||||
|
@ -6,6 +6,13 @@ set_target_properties(Detour PROPERTIES DEBUG_POSTFIX -d)
|
||||
|
||||
set(Detour_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Include")
|
||||
|
||||
if(RECASTNAVIGATION_DT_POLYREF64)
|
||||
target_compile_definitions(Detour PUBLIC DT_POLYREF64)
|
||||
endif()
|
||||
if(RECASTNAVIGATION_DT_VIRTUAL_QUERYFILTER)
|
||||
target_compile_definitions(Detour PUBLIC DT_VIRTUAL_QUERYFILTER)
|
||||
endif()
|
||||
|
||||
target_include_directories(Detour PUBLIC
|
||||
"$<BUILD_INTERFACE:${Detour_INCLUDE_DIR}>"
|
||||
)
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
#ifdef NDEBUG
|
||||
|
||||
// From http://cnicholson.net/2009/02/stupid-c-tricks-adventures-in-assert/
|
||||
// From https://web.archive.org/web/20210117002833/http://cnicholson.net/2009/02/stupid-c-tricks-adventures-in-assert/
|
||||
# define dtAssert(x) do { (void)sizeof(x); } while((void)(__LINE__==-1),false)
|
||||
|
||||
#else
|
||||
|
@ -890,7 +890,7 @@ static bool buildMeshAdjacency(dtTileCacheAlloc* alloc,
|
||||
const dtTileCacheContourSet& lcset)
|
||||
{
|
||||
// Based on code by Eric Lengyel from:
|
||||
// http://www.terathon.com/code/edges.php
|
||||
// https://web.archive.org/web/20080704083314/http://www.terathon.com/code/edges.php
|
||||
|
||||
const int maxEdgeCount = npolys*MAX_VERTS_PER_POLY;
|
||||
dtFixedArray<unsigned short> firstEdge(alloc, nverts + maxEdgeCount);
|
||||
|
@ -1083,7 +1083,7 @@ int rcGetHeightFieldSpanCount(rcContext* context, const rcHeightfield& heightfie
|
||||
/// @param[out] compactHeightfield The resulting compact heightfield. (Must be pre-allocated.)
|
||||
/// @returns True if the operation completed successfully.
|
||||
bool rcBuildCompactHeightfield(rcContext* context, int walkableHeight, int walkableClimb,
|
||||
rcHeightfield& heightfield, rcCompactHeightfield& compactHeightfield);
|
||||
const rcHeightfield& heightfield, rcCompactHeightfield& compactHeightfield);
|
||||
|
||||
/// Erodes the walkable area within the heightfield by the specified radius.
|
||||
/// @ingroup recast
|
||||
@ -1256,7 +1256,7 @@ inline int rcGetDirForOffset(int offsetX, int offsetZ)
|
||||
/// to be considered walkable. [Limit: >= 3] [Units: vx]
|
||||
/// @param[out] lset The resulting layer set. (Must be pre-allocated.)
|
||||
/// @returns True if the operation completed successfully.
|
||||
bool rcBuildHeightfieldLayers(rcContext* ctx, rcCompactHeightfield& chf,
|
||||
bool rcBuildHeightfieldLayers(rcContext* ctx, const rcCompactHeightfield& chf,
|
||||
int borderSize, int walkableHeight,
|
||||
rcHeightfieldLayerSet& lset);
|
||||
|
||||
@ -1271,7 +1271,7 @@ bool rcBuildHeightfieldLayers(rcContext* ctx, rcCompactHeightfield& chf,
|
||||
/// @param[out] cset The resulting contour set. (Must be pre-allocated.)
|
||||
/// @param[in] buildFlags The build flags. (See: #rcBuildContoursFlags)
|
||||
/// @returns True if the operation completed successfully.
|
||||
bool rcBuildContours(rcContext* ctx, rcCompactHeightfield& chf,
|
||||
bool rcBuildContours(rcContext* ctx, const rcCompactHeightfield& chf,
|
||||
float maxError, int maxEdgeLen,
|
||||
rcContourSet& cset, int buildFlags = RC_CONTOUR_TESS_WALL_EDGES);
|
||||
|
||||
@ -1283,7 +1283,7 @@ bool rcBuildContours(rcContext* ctx, rcCompactHeightfield& chf,
|
||||
/// contour to polygon conversion process. [Limit: >= 3]
|
||||
/// @param[out] mesh The resulting polygon mesh. (Must be re-allocated.)
|
||||
/// @returns True if the operation completed successfully.
|
||||
bool rcBuildPolyMesh(rcContext* ctx, rcContourSet& cset, const int nvp, rcPolyMesh& mesh);
|
||||
bool rcBuildPolyMesh(rcContext* ctx, const rcContourSet& cset, const int nvp, rcPolyMesh& mesh);
|
||||
|
||||
/// Merges multiple polygon meshes into a single mesh.
|
||||
/// @ingroup recast
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
#ifdef NDEBUG
|
||||
|
||||
// From http://cnicholson.net/2009/02/stupid-c-tricks-adventures-in-assert/
|
||||
// From https://web.archive.org/web/20210117002833/http://cnicholson.net/2009/02/stupid-c-tricks-adventures-in-assert/
|
||||
# define rcAssert(x) do { (void)sizeof(x); } while ((void)(__LINE__==-1), false)
|
||||
|
||||
#else
|
||||
|
@ -401,7 +401,7 @@ int rcGetHeightFieldSpanCount(rcContext* context, const rcHeightfield& heightfie
|
||||
}
|
||||
|
||||
bool rcBuildCompactHeightfield(rcContext* context, const int walkableHeight, const int walkableClimb,
|
||||
rcHeightfield& heightfield, rcCompactHeightfield& compactHeightfield)
|
||||
const rcHeightfield& heightfield, rcCompactHeightfield& compactHeightfield)
|
||||
{
|
||||
rcAssert(context);
|
||||
|
||||
|
@ -101,7 +101,7 @@ static int getCornerHeight(int x, int y, int i, int dir,
|
||||
}
|
||||
|
||||
static void walkContour(int x, int y, int i,
|
||||
rcCompactHeightfield& chf,
|
||||
const rcCompactHeightfield& chf,
|
||||
unsigned char* flags, rcIntArray& points)
|
||||
{
|
||||
// Choose the first non-connected edge
|
||||
@ -820,7 +820,7 @@ static void mergeRegionHoles(rcContext* ctx, rcContourRegion& region)
|
||||
/// See the #rcConfig documentation for more information on the configuration parameters.
|
||||
///
|
||||
/// @see rcAllocContourSet, rcCompactHeightfield, rcContourSet, rcConfig
|
||||
bool rcBuildContours(rcContext* ctx, rcCompactHeightfield& chf,
|
||||
bool rcBuildContours(rcContext* ctx, const rcCompactHeightfield& chf,
|
||||
const float maxError, const int maxEdgeLen,
|
||||
rcContourSet& cset, const int buildFlags)
|
||||
{
|
||||
|
@ -174,7 +174,7 @@ void rcFilterWalkableLowHeightSpans(rcContext* context, const int walkableHeight
|
||||
{
|
||||
const int bot = (int)(span->smax);
|
||||
const int top = span->next ? (int)(span->next->smin) : MAX_HEIGHT;
|
||||
if ((top - bot) <= walkableHeight)
|
||||
if ((top - bot) < walkableHeight)
|
||||
{
|
||||
span->area = RC_NULL_AREA;
|
||||
}
|
||||
|
@ -28,8 +28,21 @@
|
||||
|
||||
// Must be 255 or smaller (not 256) because layer IDs are stored as
|
||||
// a byte where 255 is a special value.
|
||||
static const int RC_MAX_LAYERS = 63;
|
||||
static const int RC_MAX_NEIS = 16;
|
||||
#ifndef RC_MAX_LAYERS_DEF
|
||||
#define RC_MAX_LAYERS_DEF 63
|
||||
#endif
|
||||
|
||||
#if RC_MAX_LAYERS_DEF > 255
|
||||
#error RC_MAX_LAYERS_DEF must be 255 or smaller
|
||||
#endif
|
||||
|
||||
#ifndef RC_MAX_NEIS_DEF
|
||||
#define RC_MAX_NEIS_DEF 16
|
||||
#endif
|
||||
|
||||
// Keep type checking.
|
||||
static const int RC_MAX_LAYERS = RC_MAX_LAYERS_DEF;
|
||||
static const int RC_MAX_NEIS = RC_MAX_NEIS_DEF;
|
||||
|
||||
struct rcLayerRegion
|
||||
{
|
||||
@ -88,7 +101,7 @@ struct rcLayerSweepSpan
|
||||
/// See the #rcConfig documentation for more information on the configuration parameters.
|
||||
///
|
||||
/// @see rcAllocHeightfieldLayerSet, rcCompactHeightfield, rcHeightfieldLayerSet, rcConfig
|
||||
bool rcBuildHeightfieldLayers(rcContext* ctx, rcCompactHeightfield& chf,
|
||||
bool rcBuildHeightfieldLayers(rcContext* ctx, const rcCompactHeightfield& chf,
|
||||
const int borderSize, const int walkableHeight,
|
||||
rcHeightfieldLayerSet& lset)
|
||||
{
|
||||
|
@ -34,7 +34,7 @@ static bool buildMeshAdjacency(unsigned short* polys, const int npolys,
|
||||
const int nverts, const int vertsPerPoly)
|
||||
{
|
||||
// Based on code by Eric Lengyel from:
|
||||
// http://www.terathon.com/code/edges.php
|
||||
// https://web.archive.org/web/20080704083314/http://www.terathon.com/code/edges.php
|
||||
|
||||
int maxEdgeCount = npolys*vertsPerPoly;
|
||||
unsigned short* firstEdge = (unsigned short*)rcAlloc(sizeof(unsigned short)*(nverts + maxEdgeCount), RC_ALLOC_TEMP);
|
||||
@ -986,7 +986,7 @@ static bool removeVertex(rcContext* ctx, rcPolyMesh& mesh, const unsigned short
|
||||
/// limit must be retricted to <= #DT_VERTS_PER_POLYGON.
|
||||
///
|
||||
/// @see rcAllocPolyMesh, rcContourSet, rcPolyMesh, rcConfig
|
||||
bool rcBuildPolyMesh(rcContext* ctx, rcContourSet& cset, const int nvp, rcPolyMesh& mesh)
|
||||
bool rcBuildPolyMesh(rcContext* ctx, const rcContourSet& cset, const int nvp, rcPolyMesh& mesh)
|
||||
{
|
||||
rcAssert(ctx);
|
||||
|
||||
|
@ -238,6 +238,11 @@ project "Tests"
|
||||
-- distribute executable in RecastDemo/Bin directory
|
||||
targetdir "Bin"
|
||||
|
||||
-- enable ubsan and asan when compiling with clang
|
||||
filter "toolset:clang"
|
||||
buildoptions { "-fsanitize=undefined", "-fsanitize=address" } -- , "-fsanitize=memory" }
|
||||
linkoptions { "-fsanitize=undefined", "-fsanitize=address" } --, "-fsanitize=memory" }
|
||||
|
||||
-- linux library cflags and libs
|
||||
filter "system:linux"
|
||||
buildoptions {
|
||||
|
Loading…
x
Reference in New Issue
Block a user