aboutsummaryrefslogtreecommitdiff
path: root/PhysX_3.4/Source/PhysXCooking/src/convex/QuickHullConvexHullLib.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'PhysX_3.4/Source/PhysXCooking/src/convex/QuickHullConvexHullLib.cpp')
-rw-r--r--PhysX_3.4/Source/PhysXCooking/src/convex/QuickHullConvexHullLib.cpp25
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);
}
//////////////////////////////////////////////////////////////////////////