Permalink
Browse files

Update recastnavigation to recastnavigation/recastnavigation@64385e9

  • Loading branch information...
schnek authored and Zyres committed Feb 9, 2018
1 parent 36e46dc commit a25f45b95c0f9dc38f8525dd7e675c21cf07980b
Showing with 1,189 additions and 784 deletions.
  1. +4 −4 dep/README.md
  2. +4 −2 dep/recastnavigation/Detour/Include/DetourAlloc.h
  3. +18 −0 dep/recastnavigation/Detour/Include/DetourCommon.h
  4. +50 −47 dep/recastnavigation/Detour/Include/DetourNavMesh.h
  5. +46 −7 dep/recastnavigation/Detour/Include/DetourNavMeshQuery.h
  6. +23 −25 dep/recastnavigation/Detour/Include/DetourNode.h
  7. +2 −2 dep/recastnavigation/Detour/Source/DetourAlloc.cpp
  8. +51 −42 dep/recastnavigation/Detour/Source/DetourNavMesh.cpp
  9. +20 −18 dep/recastnavigation/Detour/Source/DetourNavMeshBuilder.cpp
  10. +313 −191 dep/recastnavigation/Detour/Source/DetourNavMeshQuery.cpp
  11. +3 −1 dep/recastnavigation/Detour/Source/DetourNode.cpp
  12. +33 −10 dep/recastnavigation/README.md
  13. +68 −14 dep/recastnavigation/Recast/Include/Recast.h
  14. +37 −15 dep/recastnavigation/Recast/Include/RecastAlloc.h
  15. +30 −15 dep/recastnavigation/Recast/Source/Recast.cpp
  16. +11 −13 dep/recastnavigation/Recast/Source/RecastAlloc.cpp
  17. +5 −16 dep/recastnavigation/Recast/Source/RecastArea.cpp
  18. +7 −8 dep/recastnavigation/Recast/Source/RecastContour.cpp
  19. +7 −12 dep/recastnavigation/Recast/Source/RecastFilter.cpp
  20. +51 −25 dep/recastnavigation/Recast/Source/RecastLayers.cpp
  21. +40 −32 dep/recastnavigation/Recast/Source/RecastMesh.cpp
  22. +223 −173 dep/recastnavigation/Recast/Source/RecastMeshDetail.cpp
  23. +57 −27 dep/recastnavigation/Recast/Source/RecastRasterization.cpp
  24. +86 −85 dep/recastnavigation/Recast/Source/RecastRegion.cpp
View
@@ -2,6 +2,10 @@
# Opensource software in this folder:
## Folder: recastnavigation
- Web: https://github.com/memononen/recastnavigation
- Version: 64385e9ed0822427bca5814d03a3f4c4d7a6db9f (2016/08/17)
## Folder: OpenSSL
- Web: https://www.openssl.org
- Version: 1.0.2n (2017-12-7)
@@ -18,10 +22,6 @@
- Web: https://www.lua.org
- Version: 5.3.4 (2017-01-12)
## Folder: recastnavigation
- Web: https://github.com/memononen/recastnavigation
- Version: 1dd5cf1883d61e723fef3d4957cf758c50e7a52b (2015/06/22)
## Folder: g3dlite
- Web: http://g3d.cs.williams.edu
- Version: 9 (2013/03/24)
@@ -19,6 +19,8 @@
#ifndef DETOURALLOCATOR_H
#define DETOURALLOCATOR_H
#include <stddef.h>
/// Provides hint values to the memory allocator on how long the
/// memory is expected to be used.
enum dtAllocHint
@@ -32,7 +34,7 @@ enum dtAllocHint
// @param[in] rcAllocHint A hint to the allocator on how long the memory is expected to be in use.
// @return A pointer to the beginning of the allocated memory block, or null if the allocation failed.
/// @see dtAllocSetCustom
typedef void* (dtAllocFunc)(int size, dtAllocHint hint);
typedef void* (dtAllocFunc)(size_t size, dtAllocHint hint);
/// A memory deallocation function.
/// @param[in] ptr A pointer to a memory block previously allocated using #dtAllocFunc.
@@ -49,7 +51,7 @@ void dtAllocSetCustom(dtAllocFunc *allocFunc, dtFreeFunc *freeFunc);
/// @param[in] hint A hint to the allocator on how long the memory is expected to be in use.
/// @return A pointer to the beginning of the allocated memory block, or null if the allocation failed.
/// @see dtFree
void* dtAlloc(int size, dtAllocHint hint);
void* dtAlloc(size_t size, dtAllocHint hint);
/// Deallocates a memory block.
/// @param[in] ptr A pointer to a memory block previously allocated using #dtAlloc.
@@ -20,6 +20,7 @@
#define DETOURCOMMON_H
#include "DetourMath.h"
#include <stddef.h>
/**
@defgroup detour Detour
@@ -482,6 +483,23 @@ inline void dtSwapEndian(float* v)
void dtRandomPointInConvexPoly(const float* pts, const int npts, float* areas,
const float s, const float t, float* out);
template<typename TypeToRetrieveAs>
TypeToRetrieveAs* dtGetThenAdvanceBufferPointer(const unsigned char*& buffer, const size_t distanceToAdvance)
{
TypeToRetrieveAs* returnPointer = reinterpret_cast<TypeToRetrieveAs*>(buffer);
buffer += distanceToAdvance;
return returnPointer;
}
template<typename TypeToRetrieveAs>
TypeToRetrieveAs* dtGetThenAdvanceBufferPointer(unsigned char*& buffer, const size_t distanceToAdvance)
{
TypeToRetrieveAs* returnPointer = reinterpret_cast<TypeToRetrieveAs*>(buffer);
buffer += distanceToAdvance;
return returnPointer;
}
/// @}
#endif // DETOURCOMMON_H
@@ -25,45 +25,48 @@
// Undefine (or define in a build cofnig) the following line to use 64bit polyref.
// Generally not needed, useful for very large worlds.
// Note: tiles build using 32bit refs are not compatible with 64bit refs!
//#define DT_POLYREF64 1
#define DT_POLYREF64 1
#ifdef DT_POLYREF64
// TODO: figure out a multiplatform version of uint64_t
// - maybe: https://code.google.com/p/msinttypes/
// - or: http://www.azillionmonkeys.com/qed/pstdint.h
#if defined(WIN32) && !defined(__MINGW32__)
/// Do not rename back to uint64. Otherwise mac complains about typedef redefinition
typedef unsigned __int64 uint64_d;
/// Do not rename back to uint64. Otherwise mac complains about typedef redefinition
typedef unsigned __int64 uint64_d;
#else
#include <stdint.h>
#ifndef uint64_t
#ifdef __linux__
#include <linux/types.h>
#endif
#endif
/// Do not rename back to uint64. Otherwise mac complains about typedef redefinition
typedef uint64_t uint64_d;
#include <stdint.h>
#ifndef uint64_t
#ifdef __linux__
#include <linux/types.h>
#endif
#endif
/// Do not rename back to uint64. Otherwise mac complains about typedef redefinition
typedef uint64_t uint64_d;
#endif
#endif
// Note: If you want to use 64-bit refs, change the types of both dtPolyRef & dtTileRef.
// It is also recommended that you change dtHashRef() to a proper 64-bit hash.
/// A handle to a polygon within a navigation mesh tile.
/// @ingroup detour
/*#ifdef DT_POLYREF64
static const unsigned int DT_SALT_BITS = 16;
static const unsigned int DT_TILE_BITS = 28;
static const unsigned int DT_POLY_BITS = 20;
typedef uint64_t dtPolyRef;
#ifdef DT_POLYREF64
static const unsigned int DT_SALT_BITS = 12;
static const unsigned int DT_TILE_BITS = 21;
static const unsigned int DT_POLY_BITS = 31;
typedef uint64_d dtPolyRef;
#else
typedef unsigned int dtPolyRef;
#endif*/
typedef uint64_d dtPolyRef;
#endif
/// A handle to a tile within a navigation mesh.
/// @ingroup detour
/*#ifdef DT_POLYREF64
typedef uint64_t dtTileRef;
#ifdef DT_POLYREF64
typedef uint64_d dtTileRef;
#else
typedef unsigned int dtTileRef;
#endif*/
typedef uint64_d dtTileRef;
#endif
/// The maximum number of vertices per navigation polygon.
/// @ingroup detour
@@ -103,11 +106,6 @@ static const unsigned int DT_OFFMESH_CON_BIDIR = 1;
/// @ingroup detour
static const int DT_MAX_AREAS = 64;
static const int STATIC_TILE_BITS = 21;
static const int STATIC_POLY_BITS = 31;
static const int STATIC_SALT_BITS = 12;
/// Tile flags used for various functions and fields.
/// For an example, see dtNavMesh::addTile().
enum dtTileFlags
@@ -132,11 +130,10 @@ enum dtStraightPathOptions
};
/// Options for dtNavMeshQuery::findPath
/// Options for dtNavMeshQuery::initSlicedFindPath and updateSlicedFindPath
enum dtFindPathOptions
{
DT_FINDPATH_LOW_QUALITY_FAR = 0x01, ///< [provisional] trade quality for performance far from the origin. The idea is that by then a new query will be issued
DT_FINDPATH_ANY_ANGLE = 0x02, ///< use raycasts during pathfind to "shortcut" (raycast still consider costs)
DT_FINDPATH_ANY_ANGLE = 0x02, ///< use raycasts during pathfind to "shortcut" (raycast still consider costs)
};
/// Options for dtNavMeshQuery::raycast
@@ -160,7 +157,7 @@ enum dtPolyTypes
};
/// Defines a polyogn within a dtMeshTile object.
/// Defines a polygon within a dtMeshTile object.
/// @ingroup detour
struct dtPoly
{
@@ -315,6 +312,9 @@ struct dtMeshTile
int dataSize; ///< Size of the tile data.
int flags; ///< Tile flags. (See: #dtTileFlags)
dtMeshTile* next; ///< The next free tile, or the next tile in the spatial grid.
private:
dtMeshTile(const dtMeshTile&);
dtMeshTile& operator=(const dtMeshTile&);
};
/// Configuration parameters used to define multi-tile navigation meshes.
@@ -525,11 +525,11 @@ class dtNavMesh
/// @param[in] ip The index of the polygon within the tile.
inline dtPolyRef encodePolyId(unsigned int salt, unsigned int it, unsigned int ip) const
{
/*#ifdef DT_POLYREF64
#ifdef DT_POLYREF64
return ((dtPolyRef)salt << (DT_POLY_BITS+DT_TILE_BITS)) | ((dtPolyRef)it << DT_POLY_BITS) | (dtPolyRef)ip;
#else*/
#else
return ((dtPolyRef)salt << (m_polyBits+m_tileBits)) | ((dtPolyRef)it << m_polyBits) | (dtPolyRef)ip;
//#endif
#endif
}
/// Decodes a standard polygon reference.
@@ -541,21 +541,21 @@ class dtNavMesh
/// @see #encodePolyId
inline void decodePolyId(dtPolyRef ref, unsigned int& salt, unsigned int& it, unsigned int& ip) const
{
/*#ifdef DT_POLYREF64
#ifdef DT_POLYREF64
const dtPolyRef saltMask = ((dtPolyRef)1<<DT_SALT_BITS)-1;
const dtPolyRef tileMask = ((dtPolyRef)1<<DT_TILE_BITS)-1;
const dtPolyRef polyMask = ((dtPolyRef)1<<DT_POLY_BITS)-1;
salt = (unsigned int)((ref >> (DT_POLY_BITS+DT_TILE_BITS)) & saltMask);
it = (unsigned int)((ref >> DT_POLY_BITS) & tileMask);
ip = (unsigned int)(ref & polyMask);
#else*/
#else
const dtPolyRef saltMask = ((dtPolyRef)1<<m_saltBits)-1;
const dtPolyRef tileMask = ((dtPolyRef)1<<m_tileBits)-1;
const dtPolyRef polyMask = ((dtPolyRef)1<<m_polyBits)-1;
salt = (unsigned int)((ref >> (m_polyBits+m_tileBits)) & saltMask);
it = (unsigned int)((ref >> m_polyBits) & tileMask);
ip = (unsigned int)(ref & polyMask);
//#endif
#endif
}
/// Extracts a tile's salt value from the specified polygon reference.
@@ -564,13 +564,13 @@ class dtNavMesh
/// @see #encodePolyId
inline unsigned int decodePolyIdSalt(dtPolyRef ref) const
{
/*#ifdef DT_POLYREF64
#ifdef DT_POLYREF64
const dtPolyRef saltMask = ((dtPolyRef)1<<DT_SALT_BITS)-1;
return (unsigned int)((ref >> (DT_POLY_BITS+DT_TILE_BITS)) & saltMask);
#else*/
#else
const dtPolyRef saltMask = ((dtPolyRef)1<<m_saltBits)-1;
return (unsigned int)((ref >> (m_polyBits+m_tileBits)) & saltMask);
//#endif
#endif
}
/// Extracts the tile's index from the specified polygon reference.
@@ -579,13 +579,13 @@ class dtNavMesh
/// @see #encodePolyId
inline unsigned int decodePolyIdTile(dtPolyRef ref) const
{
/*#ifdef DT_POLYREF64
#ifdef DT_POLYREF64
const dtPolyRef tileMask = ((dtPolyRef)1<<DT_TILE_BITS)-1;
return (unsigned int)((ref >> DT_POLY_BITS) & tileMask);
#else*/
#else
const dtPolyRef tileMask = ((dtPolyRef)1<<m_tileBits)-1;
return (unsigned int)((ref >> m_polyBits) & tileMask);
//#endif
#endif
}
/// Extracts the polygon's index (within its tile) from the specified polygon reference.
@@ -594,18 +594,21 @@ class dtNavMesh
/// @see #encodePolyId
inline unsigned int decodePolyIdPoly(dtPolyRef ref) const
{
/*#ifdef DT_POLYREF64
#ifdef DT_POLYREF64
const dtPolyRef polyMask = ((dtPolyRef)1<<DT_POLY_BITS)-1;
return (unsigned int)(ref & polyMask);
#else*/
#else
const dtPolyRef polyMask = ((dtPolyRef)1<<m_polyBits)-1;
return (unsigned int)(ref & polyMask);
//#endif
#endif
}
/// @}
private:
// Explicitly disabled copy constructor and copy assignment operator.
dtNavMesh(const dtNavMesh&);
dtNavMesh& operator=(const dtNavMesh&);
/// Returns pointer to tile in the tile array.
dtMeshTile* getTile(int i);
@@ -634,7 +637,7 @@ class dtNavMesh
void connectExtOffMeshLinks(dtMeshTile* tile, dtMeshTile* target, int side);
/// Removes external links at specified side.
void unconnectExtLinks(dtMeshTile* tile, dtMeshTile* target);
void unconnectLinks(dtMeshTile* tile, dtMeshTile* target);
// TODO: These methods are duplicates from dtNavMeshQuery, but are needed for off-mesh connection finding.
Oops, something went wrong.

0 comments on commit a25f45b

Please sign in to comment.