aboutsummaryrefslogtreecommitdiff
path: root/PhysX_3.4/Source/LowLevel/common/src
diff options
context:
space:
mode:
authorSheikh Dawood Abdul Ajees <[email protected]>2018-09-25 11:33:48 -0500
committerSheikh Dawood Abdul Ajees <[email protected]>2018-09-25 11:33:48 -0500
commitad993f2926db6fe4ba2c75e17c4f099d9d853038 (patch)
tree426f831e7aa870a4704b8dd082538ff292e751f9 /PhysX_3.4/Source/LowLevel/common/src
parentPhysX 3.4, APEX 1.4 patch release @24698370 (diff)
downloadphysx-3.4-ad993f2926db6fe4ba2c75e17c4f099d9d853038.tar.xz
physx-3.4-ad993f2926db6fe4ba2c75e17c4f099d9d853038.zip
PhysX 3.4, APEX 1.4 patch release @24990349
Diffstat (limited to 'PhysX_3.4/Source/LowLevel/common/src')
-rw-r--r--PhysX_3.4/Source/LowLevel/common/src/pipeline/PxcNpBatch.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/PhysX_3.4/Source/LowLevel/common/src/pipeline/PxcNpBatch.cpp b/PhysX_3.4/Source/LowLevel/common/src/pipeline/PxcNpBatch.cpp
index 3b2d98c1..1700a765 100644
--- a/PhysX_3.4/Source/LowLevel/common/src/pipeline/PxcNpBatch.cpp
+++ b/PhysX_3.4/Source/LowLevel/common/src/pipeline/PxcNpBatch.cpp
@@ -91,8 +91,11 @@ static bool copyBuffers(PxsContactManagerOutput& cmOutput, Gu::Cache& cache, Pxc
ret = true;
PxU8* oldPatches = cmOutput.contactPatches;
PxU8* oldContacts = cmOutput.contactPoints;
+ PxReal* oldForces = cmOutput.contactForces;
PxU32 forceSize = cmOutput.nbContacts * sizeof(PxReal);
+ if(isMeshType)
+ forceSize += cmOutput.nbContacts * sizeof(PxU32);
PxU8* PX_RESTRICT contactPatches = NULL;
PxU8* PX_RESTRICT contactPoints = NULL;
@@ -127,8 +130,6 @@ static bool copyBuffers(PxsContactManagerOutput& cmOutput, Gu::Cache& cache, Pxc
if(forceSize)
{
- forceSize = isMeshType ? (forceSize * 2) : forceSize;
-
index = PxU32(Ps::atomicAdd(&context.mForceAndIndiceStreamPool->mSharedDataIndex, PxI32(forceSize)));
if(context.mForceAndIndiceStreamPool->isOverflown())
@@ -150,6 +151,10 @@ static bool copyBuffers(PxsContactManagerOutput& cmOutput, Gu::Cache& cache, Pxc
{
PxMemCopy(contactPatches, oldPatches, patchSize);
PxMemCopy(contactPoints, oldContacts, contactSize);
+ if (isMeshType)
+ {
+ PxMemCopy(forceBuffer + cmOutput.nbContacts, oldForces + cmOutput.nbContacts, sizeof(PxU32) * cmOutput.nbContacts);
+ }
}
}
else
@@ -164,6 +169,10 @@ static bool copyBuffers(PxsContactManagerOutput& cmOutput, Gu::Cache& cache, Pxc
contactPoints = data + cmOutput.nbPatches * sizeof(PxContactPatch);
PxMemCopy(data, oldPatches, oldSize);
+ if (isMeshType)
+ {
+ PxMemCopy(forceBuffer + cmOutput.nbContacts, oldForces + cmOutput.nbContacts, sizeof(PxU32) * cmOutput.nbContacts);
+ }
}
if(forceSize)