aboutsummaryrefslogtreecommitdiff
path: root/PhysX_3.4/Source/LowLevelCloth/src
diff options
context:
space:
mode:
authorsschirm <[email protected]>2016-12-23 14:20:36 +0100
committersschirm <[email protected]>2016-12-23 14:56:17 +0100
commitef6937e69e8ee3f409cf9d460d5ad300a65d5924 (patch)
tree710426e8daa605551ce3f34b581897011101c30f /PhysX_3.4/Source/LowLevelCloth/src
parentInitial commit: (diff)
downloadphysx-3.4-ef6937e69e8ee3f409cf9d460d5ad300a65d5924.tar.xz
physx-3.4-ef6937e69e8ee3f409cf9d460d5ad300a65d5924.zip
PhysX 3.4 / APEX 1.4 release candidate @21506124
Diffstat (limited to 'PhysX_3.4/Source/LowLevelCloth/src')
-rw-r--r--PhysX_3.4/Source/LowLevelCloth/src/SwFactory.cpp17
-rw-r--r--PhysX_3.4/Source/LowLevelCloth/src/windows/CuCloth.cpp29
-rw-r--r--PhysX_3.4/Source/LowLevelCloth/src/windows/CuFactory.cpp10
3 files changed, 13 insertions, 43 deletions
diff --git a/PhysX_3.4/Source/LowLevelCloth/src/SwFactory.cpp b/PhysX_3.4/Source/LowLevelCloth/src/SwFactory.cpp
index 92f17c98..b443d983 100644
--- a/PhysX_3.4/Source/LowLevelCloth/src/SwFactory.cpp
+++ b/PhysX_3.4/Source/LowLevelCloth/src/SwFactory.cpp
@@ -33,7 +33,6 @@
#include "SwCloth.h"
#include "SwSolver.h"
#include "ClothImpl.h"
-#include <string.h> // for memcpy
using namespace physx;
@@ -164,21 +163,21 @@ void cloth::SwFactory::extractCollisionData(const Cloth& cloth, Range<PxVec4> sp
PX_ASSERT(triangles.empty() || triangles.size() == swCloth.mStartCollisionTriangles.size());
if(!swCloth.mStartCollisionSpheres.empty() && !spheres.empty())
- memcpy(spheres.begin(), &swCloth.mStartCollisionSpheres.front(),
+ PxMemCopy(spheres.begin(), &swCloth.mStartCollisionSpheres.front(),
swCloth.mStartCollisionSpheres.size() * sizeof(PxVec4));
if(!swCloth.mCapsuleIndices.empty() && !capsules.empty())
- memcpy(capsules.begin(), &swCloth.mCapsuleIndices.front(), swCloth.mCapsuleIndices.size() * sizeof(IndexPair));
+ PxMemCopy(capsules.begin(), &swCloth.mCapsuleIndices.front(), swCloth.mCapsuleIndices.size() * sizeof(IndexPair));
if(!swCloth.mStartCollisionPlanes.empty() && !planes.empty())
- memcpy(planes.begin(), &swCloth.mStartCollisionPlanes.front(),
+ PxMemCopy(planes.begin(), &swCloth.mStartCollisionPlanes.front(),
swCloth.mStartCollisionPlanes.size() * sizeof(PxVec4));
if(!swCloth.mConvexMasks.empty() && !convexes.empty())
- memcpy(convexes.begin(), &swCloth.mConvexMasks.front(), swCloth.mConvexMasks.size() * sizeof(uint32_t));
+ PxMemCopy(convexes.begin(), &swCloth.mConvexMasks.front(), swCloth.mConvexMasks.size() * sizeof(uint32_t));
if(!swCloth.mStartCollisionTriangles.empty() && !triangles.empty())
- memcpy(triangles.begin(), &swCloth.mStartCollisionTriangles.front(),
+ PxMemCopy(triangles.begin(), &swCloth.mStartCollisionTriangles.front(),
swCloth.mStartCollisionTriangles.size() * sizeof(PxVec3));
}
@@ -197,7 +196,7 @@ void cloth::SwFactory::extractMotionConstraints(const Cloth& cloth, Range<PxVec4
// make sure dest array is big enough
PX_ASSERT(destConstraints.size() == srcConstraints.size());
- memcpy(destConstraints.begin(), &srcConstraints.front(), srcConstraints.size() * sizeof(PxVec4));
+ PxMemCopy(destConstraints.begin(), &srcConstraints.front(), srcConstraints.size() * sizeof(PxVec4));
}
}
@@ -216,7 +215,7 @@ void cloth::SwFactory::extractSeparationConstraints(const Cloth& cloth, Range<Px
// make sure dest array is big enough
PX_ASSERT(destConstraints.size() == srcConstraints.size());
- memcpy(destConstraints.begin(), &srcConstraints.front(), srcConstraints.size() * sizeof(PxVec4));
+ PxMemCopy(destConstraints.begin(), &srcConstraints.front(), srcConstraints.size() * sizeof(PxVec4));
}
}
@@ -231,7 +230,7 @@ void cloth::SwFactory::extractParticleAccelerations(const Cloth& cloth, Range<Px
// make sure dest array is big enough
PX_ASSERT(destAccelerations.size() == swCloth.mParticleAccelerations.size());
- memcpy(destAccelerations.begin(), &swCloth.mParticleAccelerations.front(),
+ PxMemCopy(destAccelerations.begin(), &swCloth.mParticleAccelerations.front(),
swCloth.mParticleAccelerations.size() * sizeof(PxVec4));
}
}
diff --git a/PhysX_3.4/Source/LowLevelCloth/src/windows/CuCloth.cpp b/PhysX_3.4/Source/LowLevelCloth/src/windows/CuCloth.cpp
index 6ecd1aeb..d4cdcf2e 100644
--- a/PhysX_3.4/Source/LowLevelCloth/src/windows/CuCloth.cpp
+++ b/PhysX_3.4/Source/LowLevelCloth/src/windows/CuCloth.cpp
@@ -439,35 +439,6 @@ void ClothImpl<CuCloth>::clearParticleAccelerations()
mCloth.wakeUp();
}
-namespace
-{
-uint32_t calculateNumReplays(const Vector<Vec4u>::Type& triplets, const Vector<uint32_t>::Type setSizes)
-{
- uint32_t result = 0;
-
- Vector<Vec4u>::Type::ConstIterator tIt = triplets.begin();
- Vector<uint32_t>::Type::ConstIterator sIt, sEnd = setSizes.end();
- uint32_t index = 0;
- for(sIt = setSizes.begin(); sIt != sEnd; ++sIt, ++index)
- {
- Vector<Vec4u>::Type::ConstIterator tEnd = tIt + *sIt, tLast = tIt;
- while(tLast != tEnd)
- {
- uint8_t numConflicts[3][32] = {};
- uint8_t numReplays[3] = {};
-
- for(tLast += PxMin(ptrdiff_t(32), tEnd - tLast); tIt != tLast; ++tIt)
- for(int i = 0; i < 3; ++i)
- numReplays[i] = PxMax(numReplays[i], ++numConflicts[i][(*tIt)[i] & 31]);
-
- result += numReplays[0] + numReplays[1] + numReplays[2];
- }
- }
-
- return result;
-}
-}
-
template <>
void ClothImpl<CuCloth>::setVirtualParticles(Range<const uint32_t[4]> indices, Range<const PxVec3> weights)
{
diff --git a/PhysX_3.4/Source/LowLevelCloth/src/windows/CuFactory.cpp b/PhysX_3.4/Source/LowLevelCloth/src/windows/CuFactory.cpp
index 8847780e..8170e622 100644
--- a/PhysX_3.4/Source/LowLevelCloth/src/windows/CuFactory.cpp
+++ b/PhysX_3.4/Source/LowLevelCloth/src/windows/CuFactory.cpp
@@ -249,21 +249,21 @@ void cloth::CuFactory::extractCollisionData(const Cloth& cloth, Range<PxVec4> sp
// collision spheres are in pinned memory, so memcpy directly
if(!cuCloth.mStartCollisionSpheres.empty() && !spheres.empty())
- memcpy(spheres.begin(), &cuCloth.mStartCollisionSpheres.front(),
+ PxMemCopy(spheres.begin(), &cuCloth.mStartCollisionSpheres.front(),
cuCloth.mStartCollisionSpheres.size() * sizeof(PxVec4));
if(!cuCloth.mCapsuleIndices.empty() && !capsules.empty())
- memcpy(capsules.begin(), &cuCloth.mCapsuleIndices.front(), cuCloth.mCapsuleIndices.size() * sizeof(IndexPair));
+ PxMemCopy(capsules.begin(), &cuCloth.mCapsuleIndices.front(), cuCloth.mCapsuleIndices.size() * sizeof(IndexPair));
if(!cuCloth.mStartCollisionPlanes.empty() && !planes.empty())
- memcpy(planes.begin(), &cuCloth.mStartCollisionPlanes.front(),
+ PxMemCopy(planes.begin(), &cuCloth.mStartCollisionPlanes.front(),
cuCloth.mStartCollisionPlanes.size() * sizeof(PxVec4));
if(!cuCloth.mConvexMasks.empty() && !convexes.empty())
- memcpy(convexes.begin(), &cuCloth.mConvexMasks.front(), cuCloth.mConvexMasks.size() * sizeof(uint32_t));
+ PxMemCopy(convexes.begin(), &cuCloth.mConvexMasks.front(), cuCloth.mConvexMasks.size() * sizeof(uint32_t));
if(!cuCloth.mStartCollisionTriangles.empty() && !triangles.empty())
- memcpy(triangles.begin(), &cuCloth.mStartCollisionTriangles.front(),
+ PxMemCopy(triangles.begin(), &cuCloth.mStartCollisionTriangles.front(),
cuCloth.mStartCollisionTriangles.size() * sizeof(PxVec3));
}