From ef6937e69e8ee3f409cf9d460d5ad300a65d5924 Mon Sep 17 00:00:00 2001 From: sschirm Date: Fri, 23 Dec 2016 14:20:36 +0100 Subject: PhysX 3.4 / APEX 1.4 release candidate @21506124 --- .../Source/GeomUtils/src/mesh/GuTriangleMesh.cpp | 229 +-------------------- 1 file changed, 9 insertions(+), 220 deletions(-) (limited to 'PhysX_3.4/Source/GeomUtils/src/mesh/GuTriangleMesh.cpp') diff --git a/PhysX_3.4/Source/GeomUtils/src/mesh/GuTriangleMesh.cpp b/PhysX_3.4/Source/GeomUtils/src/mesh/GuTriangleMesh.cpp index be47d3e1..231bddc0 100644 --- a/PhysX_3.4/Source/GeomUtils/src/mesh/GuTriangleMesh.cpp +++ b/PhysX_3.4/Source/GeomUtils/src/mesh/GuTriangleMesh.cpp @@ -27,14 +27,12 @@ // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. - #include "PsIntrinsics.h" #include "GuMidphaseInterface.h" #include "GuSerialize.h" #include "GuMeshFactory.h" #include "CmRenderOutput.h" #include "PxVisualizationParameter.h" -#include "GuConvexEdgeFlags.h" #include "GuBox.h" #include "PxMeshScale.h" #include "CmUtils.h" @@ -196,6 +194,15 @@ void Gu::TriangleMesh::importExtraData(PxDeserializationContext& context) if(mAdjacencies) mAdjacencies = context.readExtraData(3*mNbTriangles); + + mGRB_triIndices = NULL; + mGRB_triAdjacencies = NULL; + mGRB_vertValency = NULL; + mGRB_adjVertStart = NULL; + mGRB_adjVertices = NULL; + mGRB_meshAdjVerticiesTotal = 0; + mGRB_faceRemap = NULL; + mGRB_BV32Tree = NULL; } void Gu::TriangleMesh::onRefCountZero() @@ -236,222 +243,4 @@ PxBounds3 Gu::TriangleMesh::refitBVH() } #endif -#if PX_ENABLE_DEBUG_VISUALIZATION - -static void getTriangle(const Gu::TriangleMesh&, PxU32 i, PxVec3* wp, const PxVec3* vertices, const void* indices, bool has16BitIndices) -{ - PxU32 ref0, ref1, ref2; - - if(!has16BitIndices) - { - const PxU32* dtriangles = reinterpret_cast(indices); - ref0 = dtriangles[i*3+0]; - ref1 = dtriangles[i*3+1]; - ref2 = dtriangles[i*3+2]; - } - else - { - const PxU16* wtriangles = reinterpret_cast(indices); - ref0 = wtriangles[i*3+0]; - ref1 = wtriangles[i*3+1]; - ref2 = wtriangles[i*3+2]; - } - - wp[0] = vertices[ref0]; - wp[1] = vertices[ref1]; - wp[2] = vertices[ref2]; -} - -static void getTriangle(const Gu::TriangleMesh& mesh, PxU32 i, PxVec3* wp, const PxVec3* vertices, const void* indices, const Cm::Matrix34& absPose, bool has16BitIndices) -{ - PxVec3 localVerts[3]; - getTriangle(mesh, i, localVerts, vertices, indices, has16BitIndices); - - wp[0] = absPose.transform(localVerts[0]); - wp[1] = absPose.transform(localVerts[1]); - wp[2] = absPose.transform(localVerts[2]); -} - -static void visualizeActiveEdges(Cm::RenderOutput& out, const Gu::TriangleMesh& mesh, PxU32 nbTriangles, const PxU32* results, const Cm::Matrix34& absPose, const PxMat44& midt) -{ - const PxU8* extraTrigData = mesh.getExtraTrigData(); - PX_ASSERT(extraTrigData); - - const PxVec3* vertices = mesh.getVerticesFast(); - const void* indices = mesh.getTrianglesFast(); - - const PxU32 ecolor = PxU32(PxDebugColor::eARGB_YELLOW); - const bool has16Bit = mesh.has16BitIndices(); - for(PxU32 i=0; i(PX_ALLOC_TEMP(sizeof(PxU32)*nbTriangles, "tmp triangle indices")); - LimitedResults limitedResults(results, nbTriangles, 0); - Midphase::intersectBoxVsMesh(worldBox, *this, pose, scaling, &limitedResults); - nbTriangles = limitedResults.mNbResults; - - if (fscale) - { - const PxU32 fcolor = PxU32(PxDebugColor::eARGB_DARKRED); - - for (PxU32 i=0; i(PX_ALLOC(sizeof(PxVec3)*nbVertices, "PxVec3")); - for(PxU32 i=0;i