1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-26 06:27:45 +00:00

Merge branch 'develop' of https://github.com/SapphireMordred/Sapphire into develop

This commit is contained in:
mordred 2019-01-24 13:15:41 +01:00
commit 27668368cc
2 changed files with 16 additions and 16 deletions

View file

@ -107,7 +107,7 @@ int32_t Sapphire::World::Navi::NaviProvider::fixupShortcuts( dtPolyRef* path, in
return npath;
// Get connected polygons
static const int32_t maxNeis = 16;
const int32_t maxNeis = 16;
dtPolyRef neis[ maxNeis ];
int32_t nneis = 0;
@ -128,7 +128,7 @@ int32_t Sapphire::World::Navi::NaviProvider::fixupShortcuts( dtPolyRef* path, in
// If any of the neighbour polygons is within the next few polygons
// in the path, short cut to that polygon directly.
static const int32_t maxLookAhead = 6;
const int32_t maxLookAhead = 6;
int32_t cut = 0;
for( int32_t i = dtMin( maxLookAhead, npath ) - 1; i > 1 && cut == 0; i-- )
{
@ -166,7 +166,7 @@ bool Sapphire::World::Navi::NaviProvider::getSteerTarget( dtNavMeshQuery* navQue
float* outPoints, int32_t* outPointCount )
{
// Find steer target.
static const int32_t MAX_STEER_POINTS = 3;
const int32_t MAX_STEER_POINTS = 3;
float steerPath[ MAX_STEER_POINTS * 3 ];
uint8_t steerPathFlags[ MAX_STEER_POINTS ];
dtPolyRef steerPathPolys[ MAX_STEER_POINTS ];
@ -250,8 +250,8 @@ std::vector< Sapphire::Common::FFXIVARR_POSITION3 >
iterPos[ 0 ], iterPos[ 1 ], iterPos[ 2 ],
targetPos[ 0 ], targetPos[ 1 ], targetPos[ 2 ] );
static const float STEP_SIZE = 1.2f;
static const float SLOP = 0.15f;
const float STEP_SIZE = 1.2f;
const float SLOP = 0.15f;
int32_t numSmoothPath = 0;
float smoothPath[ MAX_SMOOTH * 3 ];

View file

@ -12,8 +12,8 @@ namespace Sapphire::World::Navi
class NaviProvider
{
static const int32_t NAVMESHSET_MAGIC = 'M' << 24 | 'S' << 16 | 'E' << 8 | 'T'; //'MSET'
static const int32_t NAVMESHSET_VERSION = 1;
const int32_t NAVMESHSET_MAGIC = 'M' << 24 | 'S' << 16 | 'E' << 8 | 'T'; //'MSET'
const int32_t NAVMESHSET_VERSION = 1;
struct NavMeshSetHeader
{
@ -29,11 +29,11 @@ namespace Sapphire::World::Navi
int32_t dataSize;
};
static const int32_t MAX_POLYS = 256;
static const int32_t MAX_SMOOTH = 2048;
const int32_t MAX_POLYS = 256;
const int32_t MAX_SMOOTH = 2048;
public:
NaviProvider( const std::string& internalName );
explicit NaviProvider( const std::string& internalName );
bool init();
void loadMesh( const std::string& path );
@ -55,12 +55,12 @@ namespace Sapphire::World::Navi
float m_polyFindRange[ 3 ];
private:
static int32_t fixupCorridor( dtPolyRef* path, int32_t npath, int32_t maxPath, const dtPolyRef* visited, int32_t nvisited );
static int32_t fixupShortcuts( dtPolyRef* path, int32_t npath, dtNavMeshQuery* navQuery );
inline static bool inRange( const float* v1, const float* v2, const float r, const float h );
static bool getSteerTarget( dtNavMeshQuery* navQuery, const float* startPos, const float* endPos, const float minTargetDist,
const dtPolyRef* path, const int32_t pathSize, float* steerPos, uint8_t& steerPosFlag,
dtPolyRef& steerPosRef, float* outPoints = 0, int32_t* outPointCount = 0 );
int32_t fixupCorridor( dtPolyRef* path, int32_t npath, int32_t maxPath, const dtPolyRef* visited, int32_t nvisited );
int32_t fixupShortcuts( dtPolyRef* path, int32_t npath, dtNavMeshQuery* navQuery );
inline bool inRange( const float* v1, const float* v2, const float r, const float h );
bool getSteerTarget( dtNavMeshQuery* navQuery, const float* startPos, const float* endPos, const float minTargetDist,
const dtPolyRef* path, const int32_t pathSize, float* steerPos, uint8_t& steerPosFlag,
dtPolyRef& steerPosRef, float* outPoints = 0, int32_t* outPointCount = 0 );
};