diff options
| author | Sheikh Dawood Abdul Ajees <[email protected]> | 2017-09-15 15:41:57 -0500 |
|---|---|---|
| committer | Sheikh Dawood Abdul Ajees <[email protected]> | 2017-09-15 15:41:57 -0500 |
| commit | d1c812f1162e5fdb13c215792725b2591d7428f5 (patch) | |
| tree | 407056c45c7e9320c48fca6a3697d81a061c4ea0 /PhysX_3.4/Source/LowLevel | |
| parent | PhysX 3.4, APEX 1.4 patch release @22121272 (diff) | |
| download | physx-3.4-d1c812f1162e5fdb13c215792725b2591d7428f5.tar.xz physx-3.4-d1c812f1162e5fdb13c215792725b2591d7428f5.zip | |
PhysX 3.4.1, APEX 1.4.1 Release @22845541v3.4.1
Diffstat (limited to 'PhysX_3.4/Source/LowLevel')
8 files changed, 28 insertions, 21 deletions
diff --git a/PhysX_3.4/Source/LowLevel/software/include/PxsCCD.h b/PhysX_3.4/Source/LowLevel/software/include/PxsCCD.h index 85ee5979..85c547dc 100644 --- a/PhysX_3.4/Source/LowLevel/software/include/PxsCCD.h +++ b/PhysX_3.4/Source/LowLevel/software/include/PxsCCD.h @@ -365,6 +365,7 @@ struct PxsCCDPair PxReal mRestitution; // The restitution coefficient PxU32 mEstimatePass; // The current estimation pass. Used after a sweep hit was found to determine if the pair needs re-estimating. PxReal mAppliedForce; // The applied force for this pair. Only valid if the pair has been responded to. + PxReal mMaxImpulse; // The maximum impulse to be applied E_TOIType mToiType; // The TOI type (estimate, precise). bool mHasFriction; // Whether we want to simulate CCD friction for this pair diff --git a/PhysX_3.4/Source/LowLevel/software/include/PxsHeapMemoryAllocator.h b/PhysX_3.4/Source/LowLevel/software/include/PxsHeapMemoryAllocator.h index b690a7cf..37cb66b2 100644 --- a/PhysX_3.4/Source/LowLevel/software/include/PxsHeapMemoryAllocator.h +++ b/PhysX_3.4/Source/LowLevel/software/include/PxsHeapMemoryAllocator.h @@ -31,8 +31,6 @@ #ifndef PXS_HEAP_MEMORY_ALLOCATOR_H #define PXS_HEAP_MEMORY_ALLOCATOR_H - -#include "DyGpuAPI.h" #include "foundation/PxSimpleTypes.h" namespace physx diff --git a/PhysX_3.4/Source/LowLevel/software/include/PxsKernelWrangler.h b/PhysX_3.4/Source/LowLevel/software/include/PxsKernelWrangler.h index a8d86229..3732f168 100644 --- a/PhysX_3.4/Source/LowLevel/software/include/PxsKernelWrangler.h +++ b/PhysX_3.4/Source/LowLevel/software/include/PxsKernelWrangler.h @@ -31,7 +31,6 @@ #ifndef PXS_KERNEL_WRANGLER_H #define PXS_KERNEL_WRANGLER_H -#include "DyGpuAPI.h" #include "foundation/PxSimpleTypes.h" namespace physx diff --git a/PhysX_3.4/Source/LowLevel/software/include/PxsMemoryManager.h b/PhysX_3.4/Source/LowLevel/software/include/PxsMemoryManager.h index 63b1aa2f..9a98a4d9 100644 --- a/PhysX_3.4/Source/LowLevel/software/include/PxsMemoryManager.h +++ b/PhysX_3.4/Source/LowLevel/software/include/PxsMemoryManager.h @@ -33,7 +33,6 @@ #include "foundation/PxPreprocessor.h" #include "foundation/PxSimpleTypes.h" -#include "DyGpuAPI.h" #include "CmPhysXCommon.h" namespace physx diff --git a/PhysX_3.4/Source/LowLevel/software/include/PxsSimulationController.h b/PhysX_3.4/Source/LowLevel/software/include/PxsSimulationController.h index 9a087825..4510c6b7 100644 --- a/PhysX_3.4/Source/LowLevel/software/include/PxsSimulationController.h +++ b/PhysX_3.4/Source/LowLevel/software/include/PxsSimulationController.h @@ -34,7 +34,6 @@ #include "foundation/PxSimpleTypes.h" #include "foundation/PxPreprocessor.h" #include "foundation/PxTransform.h" -#include "DyGpuAPI.h" #include "CmBitMap.h" #include "PsArray.h" diff --git a/PhysX_3.4/Source/LowLevel/software/include/PxvNphaseImplementationContext.h b/PhysX_3.4/Source/LowLevel/software/include/PxvNphaseImplementationContext.h index 20abe843..f3fd4140 100644 --- a/PhysX_3.4/Source/LowLevel/software/include/PxvNphaseImplementationContext.h +++ b/PhysX_3.4/Source/LowLevel/software/include/PxvNphaseImplementationContext.h @@ -35,10 +35,6 @@ #include "PxsContactManagerState.h" #include "PsArray.h" -#if PX_SUPPORT_GPU_PHYSX -#include "Pxg.h" -#endif - namespace physx { diff --git a/PhysX_3.4/Source/LowLevel/software/src/PxsCCD.cpp b/PhysX_3.4/Source/LowLevel/software/src/PxsCCD.cpp index f051b6de..f342cdba 100644 --- a/PhysX_3.4/Source/LowLevel/software/src/PxsCCD.cpp +++ b/PhysX_3.4/Source/LowLevel/software/src/PxsCCD.cpp @@ -688,7 +688,7 @@ bool PxsCCDPair::sweepAdvanceToToi(PxReal dt, bool clipTrajectoryToToi) #else const PxReal impulseDivisor = sumRecipMass; #endif - const PxReal jImp = normalResponse/impulseDivisor; + const PxReal jImp = PxMax(-mMaxImpulse, normalResponse/impulseDivisor); PxVec3 j(0.f); @@ -1016,7 +1016,7 @@ public: mCCDContext->getCCDContactModifyCallback()) { - PxU8 dataBuffer[sizeof(PxModifiableContact) + sizeof(PxContactPatch)]; + PX_ALIGN(16, PxU8 dataBuffer[sizeof(PxModifiableContact) + sizeof(PxContactPatch)]); PxContactPatch* patch = reinterpret_cast<PxContactPatch*>(dataBuffer); PxModifiableContact* point = reinterpret_cast<PxModifiableContact*>(patch + 1); @@ -1066,6 +1066,10 @@ public: pair.mMinToi = PX_MAX_REAL; continue; } + + if ((patch->internalFlags & PxContactPatch::eHAS_MAX_IMPULSE)) + pair.mMaxImpulse = point->maxImpulse; + pair.mDynamicFriction = point->dynamicFriction; pair.mStaticFriction = point->staticFriction; pair.mRestitution = point->restitution; @@ -1358,6 +1362,8 @@ void PxsCCDContext::updateCCD(PxReal dt, PxBaseTask* continuation, bool disableR mCCDOverlaps.clear_NoDelete(); + PxU32 nbKinematicStaticCollisions = 0; + bool needsSweep = false; @@ -1528,6 +1534,8 @@ void PxsCCDContext::updateCCD(PxReal dt, PxBaseTask* continuation, bool disableR } //We now create the CCD pair. These are used in the CCD sweep and update phases + if (ba0->isKinematic() && (ba1 == NULL || ba1->isKinematic())) + nbKinematicStaticCollisions++; { PxsCCDPair& p = mCCDPairs.pushBack(); p.mBa0 = ba0; @@ -1544,6 +1552,8 @@ void PxsCCDContext::updateCCD(PxReal dt, PxBaseTask* continuation, bool disableR p.mFaceIndex = PXC_CONTACT_NO_FACE_INDEX; p.mIsModifiable = cm->isChangeable() != 0; p.mAppliedForce = 0.f; + p.mMaxImpulse = PxMin((ba0->mCore->mFlags & PxRigidBodyFlag::eENABLE_CCD_MAX_CONTACT_IMPULSE) ? ba0->mCore->maxContactImpulse : PX_MAX_F32, + (ba1 && ba1->mCore->mFlags & PxRigidBodyFlag::eENABLE_CCD_MAX_CONTACT_IMPULSE) ? ba1->mCore->maxContactImpulse : PX_MAX_F32); #if PX_ENABLE_SIM_STATS mContext->mSimStats.mNbCCDPairs[PxMin(p.mG0, p.mG1)][PxMax(p.mG0, p.mG1)] ++; @@ -1594,7 +1604,7 @@ void PxsCCDContext::updateCCD(PxReal dt, PxBaseTask* continuation, bool disableR const PxU16 noLabelYet = 0xFFFF; //Temporary array allocations. Ideally, we should use the scratch pad for there - Array<PxU16> islandLabels; + Array<PxU32> islandLabels; islandLabels.resize(ccdBodyCount); Array<const PxsCCDBody*> stack; stack.reserve(ccdBodyCount); @@ -1608,7 +1618,7 @@ void PxsCCDContext::updateCCD(PxReal dt, PxBaseTask* continuation, bool disableR for (PxU32 j = 0; j < ccdBodyCount; j++) islandLabels[j] = noLabelYet; - PxU16 islandCount = 0; + PxU32 islandCount = 0; PxU32 stackSize = 0; const PxsCCDBody* top = NULL; @@ -1653,6 +1663,15 @@ void PxsCCDContext::updateCCD(PxReal dt, PxBaseTask* continuation, bool disableR islandCount++; } + PxU32 kinematicIslandId = islandCount; + + islandCount += nbKinematicStaticCollisions; + + for (PxU32 i = kinematicIslandId; i < islandCount; ++i) + mIslandSizes[i] = 1; + + + // -------------------------------------------------------------------------------------- // label pairs with island ids // (need an extra loop since we don't maintain a mapping from atom to all of it's pairs) @@ -1666,11 +1685,12 @@ void PxsCCDContext::updateCCD(PxReal dt, PxBaseTask* continuation, bool disableR PxsCCDPair& p = *mCCDPtrPairs[j]; PxU32 id0 = p.mBa0 && !p.mBa0->isKinematic()? islandLabels[p.mBa0->mCCD->getIndex()] : staticLabel; PxU32 id1 = p.mBa1 && !p.mBa1->isKinematic()? islandLabels[p.mBa1->mCCD->getIndex()] : staticLabel; - PX_ASSERT(id0 != 0xFFFF || id1 != 0xFFFF); - PX_ASSERT(id0 == staticLabel || id1 == staticLabel || (id0 == id1)); + PxU32 islandId = PxMin(id0, id1); + if (islandId == staticLabel) + islandId = kinematicIslandId++; - p.mIslandId = PxMin(id0, id1); + p.mIslandId = islandId; mCCDIslandHistogram[p.mIslandId] ++; PX_ASSERT(p.mIslandId != staticLabel); totalActivePairs++; diff --git a/PhysX_3.4/Source/LowLevel/software/src/PxsNphaseImplementationContext.cpp b/PhysX_3.4/Source/LowLevel/software/src/PxsNphaseImplementationContext.cpp index 5a2823a5..d5e6d7f7 100644 --- a/PhysX_3.4/Source/LowLevel/software/src/PxsNphaseImplementationContext.cpp +++ b/PhysX_3.4/Source/LowLevel/software/src/PxsNphaseImplementationContext.cpp @@ -32,11 +32,6 @@ #include "CmFlushPool.h" #include "PxsSimpleIslandManager.h" -//Enable tuner profiling. -#ifdef PX_PS3 -#include "CellTimerMarker.h" -#endif - #if PX_SUPPORT_GPU_PHYSX #include "PxPhysXGpu.h" #include "task/PxGpuDispatcher.h" |