diff options
| author | sschirm <[email protected]> | 2017-01-06 14:45:46 +0100 |
|---|---|---|
| committer | sschirm <[email protected]> | 2017-01-06 14:45:46 +0100 |
| commit | c7a921796332e8fcd51f3e05c1a318a41282e1e2 (patch) | |
| tree | 770db0c76e954045fe5178a36a7519b26df6942a /PhysX_3.4/Source/PhysXCooking/src/convex/QuickHullConvexHullLib.cpp | |
| parent | PhysX 3.4, APEX 1.4 release candidate update: @21511067-21511214 (diff) | |
| download | physx-3.4-c7a921796332e8fcd51f3e05c1a318a41282e1e2.tar.xz physx-3.4-c7a921796332e8fcd51f3e05c1a318a41282e1e2.zip | |
PhysX 3.4, APEX 1.4 release candidate update: @21542069
Diffstat (limited to 'PhysX_3.4/Source/PhysXCooking/src/convex/QuickHullConvexHullLib.cpp')
| -rw-r--r-- | PhysX_3.4/Source/PhysXCooking/src/convex/QuickHullConvexHullLib.cpp | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/PhysX_3.4/Source/PhysXCooking/src/convex/QuickHullConvexHullLib.cpp b/PhysX_3.4/Source/PhysXCooking/src/convex/QuickHullConvexHullLib.cpp index 13b88364..15d34b6e 100644 --- a/PhysX_3.4/Source/PhysXCooking/src/convex/QuickHullConvexHullLib.cpp +++ b/PhysX_3.4/Source/PhysXCooking/src/convex/QuickHullConvexHullLib.cpp @@ -23,7 +23,7 @@ // components in life support devices or systems without express written approval of // NVIDIA Corporation. // -// Copyright (c) 2008-2016 NVIDIA Corporation. All rights reserved. +// Copyright (c) 2008-2017 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. @@ -1744,11 +1744,23 @@ PxConvexMeshCookingResult::Enum QuickHullConvexHullLib::createConvexHull() PxU32 outvcount; // cleanup the vertices first - if(!cleanupVertices(mConvexMeshDesc.points.count, reinterpret_cast<const PxVec3*> (mConvexMeshDesc.points.data), mConvexMeshDesc.points.stride, - outvcount, outvsource, scale, center )) + if(mConvexMeshDesc.flags & PxConvexFlag::eSHIFT_VERTICES) { - PX_FREE(outvsource); - return res; + if(!shiftAndcleanupVertices(mConvexMeshDesc.points.count, reinterpret_cast<const PxVec3*> (mConvexMeshDesc.points.data), mConvexMeshDesc.points.stride, + outvcount, outvsource, scale, center )) + { + PX_FREE(outvsource); + return res; + } + } + else + { + if(!cleanupVertices(mConvexMeshDesc.points.count, reinterpret_cast<const PxVec3*> (mConvexMeshDesc.points.data), mConvexMeshDesc.points.stride, + outvcount, outvsource, scale, center )) + { + PX_FREE(outvsource); + return res; + } } // scale vertices back to their original size. @@ -2189,6 +2201,9 @@ void QuickHullConvexHullLib::fillConvexMeshDesc(PxConvexMeshDesc& desc) fillConvexMeshDescFromCroppedHull(desc); else fillConvexMeshDescFromQuickHull(desc); + + if(mConvexMeshDesc.flags & PxConvexFlag::eSHIFT_VERTICES) + shiftConvexMeshDesc(desc); } ////////////////////////////////////////////////////////////////////////// |