aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent_Michael <Vincent_Michael@gmx.de>2014-01-18 20:31:41 +0100
committerVincent_Michael <Vincent_Michael@gmx.de>2014-01-18 20:31:41 +0100
commit20c3eebfa70d07b4020f44dafdeb36a331a9d7d7 (patch)
tree5597a80ffa167eb350099abadebf7b3d8fb00518
parentad8c046916262918b88917cbe4194a943ce75d16 (diff)
Fix revert fail in ad8c046916262918b88917cbe4194a943ce75d16
-rw-r--r--src/tools/mesh_extractor/MeshExtractor.cpp48
-rw-r--r--src/tools/mesh_extractor/TileBuilder.cpp6
-rw-r--r--src/tools/mesh_extractor/WorldModelHandler.cpp2
3 files changed, 4 insertions, 52 deletions
diff --git a/src/tools/mesh_extractor/MeshExtractor.cpp b/src/tools/mesh_extractor/MeshExtractor.cpp
index df1393f7e6b..1926734ac72 100644
--- a/src/tools/mesh_extractor/MeshExtractor.cpp
+++ b/src/tools/mesh_extractor/MeshExtractor.cpp
@@ -395,13 +395,8 @@ int main(int argc, char* argv[])
if (extractFlags & Constants::EXTRACT_FLAG_TEST)
{
-<<<<<<< .mine
- float start[] = { -45.4745407f, -29.5000954f, -21.4456501f };
- float end[] = { -107.686218f, -32.3544769f, -30.3459435f };
-=======
float start[] = { 16226.200195f, 16257.000000f, 13.202200f };
float end[] = { 16245.725586f, 16382.465820f, 47.384956f };
->>>>>>> .theirs
//
float m_spos[3];
@@ -467,40 +462,8 @@ int main(int argc, char* argv[])
return 0;
}
-<<<<<<< .mine
- dtStatus status;
- status = navMeshQuery->initSlicedFindPath(m_startRef, m_endRef, m_spos, m_epos, &m_filter);
- while (status != DT_SUCCESS)
- status = navMeshQuery->updateSlicedFindPath(1, 0);
-
- dtPolyRef* pathRefs = new dtPolyRef[2048];
- int pcount = 0;
- int resultHopCount = 0;
- float* straightPath = new float[2048 * 3];
- unsigned char* pathFlags = new unsigned char[2048];
-=======
int hops;
-
-
-
-
-
-
-
-
-
->>>>>>> .theirs
dtPolyRef* hopBuffer = new dtPolyRef[8192];
-<<<<<<< .mine
-
- navMeshQuery->finalizeSlicedFindPath(pathRefs, &pcount, 200);
-
-
-
-
-
-
-=======
dtStatus status = navMeshQuery->findPath(m_startRef, m_endRef, m_spos, m_epos, &m_filter, hopBuffer, &hops, 8192);
int resultHopCount;
@@ -509,20 +472,11 @@ int main(int argc, char* argv[])
dtPolyRef* pathRefs = new dtPolyRef[2048];
status = navMeshQuery->findStraightPath(m_spos, m_epos, hopBuffer, hops, straightPath, pathFlags, pathRefs, &resultHopCount, 2048);
->>>>>>> .theirs
std::vector<Vector3> FinalPath;
-<<<<<<< .mine
-
- for (int i = 0; i < pcount; ++i)
-=======
FinalPath.reserve(resultHopCount);
for (uint32 i = 0; i < resultHopCount; ++i)
->>>>>>> .theirs
{
- navMeshQuery->findStraightPath(m_spos, m_epos, &pathRefs[i], 1,
- straightPath, pathFlags,
- hopBuffer, &resultHopCount, 200);
- Vector3 finalV = Utils::ToWoWCoords(Vector3(straightPath[0 * 3 + 0], straightPath[0 * 3 + 1], straightPath[0 * 3 + 2]));
+ Vector3 finalV = Utils::ToWoWCoords(Vector3(straightPath[i * 3 + 0], straightPath[i * 3 + 1], straightPath[i * 3 + 2]));
FinalPath.push_back(finalV);
printf("Point %f %f %f\n", finalV.x, finalV.y, finalV.z);
}
diff --git a/src/tools/mesh_extractor/TileBuilder.cpp b/src/tools/mesh_extractor/TileBuilder.cpp
index a9774abe6ce..768314e5101 100644
--- a/src/tools/mesh_extractor/TileBuilder.cpp
+++ b/src/tools/mesh_extractor/TileBuilder.cpp
@@ -234,8 +234,7 @@ uint8* TileBuilder::BuildTiled(dtNavMeshParams& navMeshParams)
CalculateTileBounds(bmin, bmax, navMeshParams);
_Geometry->CalculateMinMaxHeight(bmin[1], bmax[1]);
- // This is commented out to reduce the size of the resulting files (and the time it takes to generate them), we shouldn't need to load 4 more ADTs each time.
- /*// again, we load everything - wasteful but who cares
+ // again, we load everything - wasteful but who cares
for (int ty = Y - 1; ty <= Y + 1; ty++)
{
for (int tx = X - 1; tx <= X + 1; tx++)
@@ -255,7 +254,7 @@ uint8* TileBuilder::BuildTiled(dtNavMeshParams& navMeshParams)
_Geometry->AddAdt(_adt);
delete _adt;
}
- }*/
+ }
OutputDebugVertices();
@@ -352,7 +351,6 @@ uint8* TileBuilder::BuildTiled(dtNavMeshParams& navMeshParams)
rcFreeHeightField(hf);
rcFreeCompactHeightfield(chf);
rcFreeContourSet(contours);
-
delete vertices;
delete triangles;
delete areas;
diff --git a/src/tools/mesh_extractor/WorldModelHandler.cpp b/src/tools/mesh_extractor/WorldModelHandler.cpp
index fa816627435..c272496c0a7 100644
--- a/src/tools/mesh_extractor/WorldModelHandler.cpp
+++ b/src/tools/mesh_extractor/WorldModelHandler.cpp
@@ -111,7 +111,7 @@ void WorldModelHandler::InsertModelGeometry( std::vector<Vector3>& verts, std::v
for (uint32 i = 0; i < group->Triangles.size(); ++i)
{
// only include colliding tris
- if ((group->TriangleFlags[i] & 0x04) != 0 || group->TriangleMaterials[i] == 0xFF)
+ if ((group->TriangleFlags[i] & 0x04) != 0 && group->TriangleMaterials[i] != 0xFF)
continue;
Triangle<uint16> tri = group->Triangles[i];
tris.push_back(Triangle<uint32>(Constants::TRIANGLE_TYPE_WMO, tri.V0 + vertOffset, tri.V1 + vertOffset, tri.V2 + vertOffset));