diff options
author | jackpoz <giacomopoz@gmail.com> | 2014-02-21 23:06:27 +0100 |
---|---|---|
committer | jackpoz <giacomopoz@gmail.com> | 2014-02-23 12:39:16 +0100 |
commit | f7bc86a17cc0dd1c59c338539c1a7f1d7d6e5f64 (patch) | |
tree | 52a7d6137bbfd619094c3bb9157424cff1573436 /src | |
parent | 66b4b5e05559e67ce85109436d39c2700b4c3003 (diff) |
Core/MMAPs: Update recast
Update recast from https://github.com/memononen/recastnavigation/commit/1be9de72d87dcfdecf6bea30f5461745f7d7afe6 to https://github.com/memononen/recastnavigation/commit/740a7ba51600a3c87ce5667ae276a38284a1ce75 .
This differs from https://github.com/TrinityCore/TrinityCore/commit/aa645683b8b25bfb35cb977678daf5c56c1531e6 because it includes a fix https://github.com/memononen/recastnavigation/commit/77ebf643531c90ea712b496e23c48f0b0671f43d which correctly extract tile connections when using rcMergePolyMeshes(), used by mmaps_generator.
MMAPs version is now set to 5.
Re-extract MMAPs using mmaps_generator , any old extracted MMAPs will not work.
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Miscellaneous/SharedDefines.h | 2 | ||||
-rw-r--r-- | src/server/game/Movement/PathGenerator.cpp | 10 | ||||
-rw-r--r-- | src/tools/mmaps_generator/MapBuilder.cpp | 15 |
3 files changed, 9 insertions, 18 deletions
diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 7cf4f9fa192..b52e640afc7 100644 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -3550,7 +3550,7 @@ enum PartyResult }; const uint32 MMAP_MAGIC = 0x4d4d4150; // 'MMAP' -#define MMAP_VERSION 3 +#define MMAP_VERSION 5 struct MmapTileHeader { diff --git a/src/server/game/Movement/PathGenerator.cpp b/src/server/game/Movement/PathGenerator.cpp index 1f36b7c3106..2cda9b21c20 100644 --- a/src/server/game/Movement/PathGenerator.cpp +++ b/src/server/game/Movement/PathGenerator.cpp @@ -99,7 +99,7 @@ dtPolyRef PathGenerator::GetPathPolyByPosition(dtPolyRef const* polyPath, uint32 for (uint32 i = 0; i < polyPathSize; ++i) { float closestPoint[VERTEX_SIZE]; - if (dtStatusFailed(_navMeshQuery->closestPointOnPoly(polyPath[i], point, closestPoint))) + if (dtStatusFailed(_navMeshQuery->closestPointOnPoly(polyPath[i], point, closestPoint, NULL))) continue; float d = dtVdist2DSqr(point, closestPoint); @@ -230,7 +230,7 @@ void PathGenerator::BuildPolyPath(G3D::Vector3 const& startPos, G3D::Vector3 con { float closestPoint[VERTEX_SIZE]; // we may want to use closestPointOnPolyBoundary instead - if (dtStatusSucceed(_navMeshQuery->closestPointOnPoly(endPoly, endPoint, closestPoint))) + if (dtStatusSucceed(_navMeshQuery->closestPointOnPoly(endPoly, endPoint, closestPoint, NULL))) { dtVcopy(endPoint, closestPoint); SetActualEndPosition(G3D::Vector3(endPoint[2], endPoint[0], endPoint[1])); @@ -321,13 +321,13 @@ void PathGenerator::BuildPolyPath(G3D::Vector3 const& startPos, G3D::Vector3 con // we need any point on our suffix start poly to generate poly-path, so we need last poly in prefix data float suffixEndPoint[VERTEX_SIZE]; - if (dtStatusFailed(_navMeshQuery->closestPointOnPoly(suffixStartPoly, endPoint, suffixEndPoint))) + if (dtStatusFailed(_navMeshQuery->closestPointOnPoly(suffixStartPoly, endPoint, suffixEndPoint, NULL))) { // we can hit offmesh connection as last poly - closestPointOnPoly() don't like that // try to recover by using prev polyref --prefixPolyLength; suffixStartPoly = _pathPolyRefs[prefixPolyLength-1]; - if (dtStatusFailed(_navMeshQuery->closestPointOnPoly(suffixStartPoly, endPoint, suffixEndPoint))) + if (dtStatusFailed(_navMeshQuery->closestPointOnPoly(suffixStartPoly, endPoint, suffixEndPoint, NULL))) { // suffixStartPoly is still invalid, error state BuildShortcut(); @@ -581,7 +581,7 @@ bool PathGenerator::HaveTile(const G3D::Vector3& p) const if (tx < 0 || ty < 0) return false; - return (_navMesh->getTileAt(tx, ty) != NULL); + return (_navMesh->getTileAt(tx, ty, 0) != NULL); } uint32 PathGenerator::FixupCorridor(dtPolyRef* path, uint32 npath, uint32 maxPath, dtPolyRef const* visited, uint32 nvisited) diff --git a/src/tools/mmaps_generator/MapBuilder.cpp b/src/tools/mmaps_generator/MapBuilder.cpp index 5524b994175..d60924a83f9 100644 --- a/src/tools/mmaps_generator/MapBuilder.cpp +++ b/src/tools/mmaps_generator/MapBuilder.cpp @@ -36,7 +36,7 @@ namespace DisableMgr } #define MMAP_MAGIC 0x4d4d4150 // 'MMAP' -#define MMAP_VERSION 3 +#define MMAP_VERSION 5 struct MmapTileHeader { @@ -701,14 +701,6 @@ namespace MMAP delete[] dmmerge; delete[] tiles; - // remove padding for extraction - for (int i = 0; i < iv.polyMesh->nverts; ++i) - { - unsigned short* v = &iv.polyMesh->verts[i * 3]; - v[0] -= (unsigned short)config.borderSize; - v[2] -= (unsigned short)config.borderSize; - } - // set polygons as walkable // TODO: special flags for DYNAMIC polygons, ie surfaces that can be turned on and off for (int i = 0; i < iv.polyMesh->npolys; ++i) @@ -747,9 +739,8 @@ namespace MMAP rcVcopy(params.bmax, bmax); params.cs = config.cs; params.ch = config.ch; - params.tileSize = VERTEX_PER_MAP; - /*params.tileLayer = 0; - params.buildBvTree = true;*/ + params.tileLayer = 0; + params.buildBvTree = true; // will hold final navmesh unsigned char* navData = NULL; |