diff options
| author | Sheikh Dawood Abdul Ajees <[email protected]> | 2018-09-25 11:33:48 -0500 |
|---|---|---|
| committer | Sheikh Dawood Abdul Ajees <[email protected]> | 2018-09-25 11:33:48 -0500 |
| commit | ad993f2926db6fe4ba2c75e17c4f099d9d853038 (patch) | |
| tree | 426f831e7aa870a4704b8dd082538ff292e751f9 /PhysX_3.4/Source/LowLevelAABB/src/BpBroadPhaseMBP.cpp | |
| parent | PhysX 3.4, APEX 1.4 patch release @24698370 (diff) | |
| download | physx-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/LowLevelAABB/src/BpBroadPhaseMBP.cpp')
| -rw-r--r-- | PhysX_3.4/Source/LowLevelAABB/src/BpBroadPhaseMBP.cpp | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/PhysX_3.4/Source/LowLevelAABB/src/BpBroadPhaseMBP.cpp b/PhysX_3.4/Source/LowLevelAABB/src/BpBroadPhaseMBP.cpp index 313e27f3..cdaa2145 100644 --- a/PhysX_3.4/Source/LowLevelAABB/src/BpBroadPhaseMBP.cpp +++ b/PhysX_3.4/Source/LowLevelAABB/src/BpBroadPhaseMBP.cpp @@ -3354,6 +3354,14 @@ void BroadPhaseMBP::update(const PxU32 numCpuTasks, PxcScratchAllocator* scratch } } +void BroadPhaseMBP::singleThreadedUpdate(PxcScratchAllocator* /*scratchAllocator*/, const BroadPhaseUpdateData& updateData) +{ + // PT: TODO: the scratchAllocator isn't actually needed, is it? + setUpdateData(updateData); + update(); + postUpdate(); +} + static PX_FORCE_INLINE void computeMBPBounds(MBP_AABB& aabb, const PxBounds3* PX_RESTRICT boundsXYZ, const PxReal* PX_RESTRICT contactDistances, const BpHandle index) { const PxBounds3& b = boundsXYZ[index]; @@ -3614,23 +3622,24 @@ bool BroadPhaseMBP::isValid(const BroadPhaseUpdateData& updateData) const const BpHandle* created = updateData.getCreatedHandles(); if(created) { + Ps::HashSet<BpHandle> set; + PxU32 nbObjects = mMBP->mMBP_Objects.size(); + const MBP_Object* PX_RESTRICT objects = mMBP->mMBP_Objects.begin(); + while(nbObjects--) + { + if(!(objects->mFlags & MBP_REMOVED)) + set.insert(objects->mUserID); + objects++; + } + PxU32 nbToGo = updateData.getNumCreatedHandles(); while(nbToGo--) { const BpHandle index = *created++; PX_ASSERT(index<mCapacity); - PxU32 nbObjects = mMBP->mMBP_Objects.size(); - const MBP_Object* PX_RESTRICT objects = mMBP->mMBP_Objects.begin(); - while(nbObjects--) - { - if(!(objects->mFlags & MBP_REMOVED)) - { - if(objects->mUserID==index) - return false; // This object has been added already - } - objects++; - } + if(set.contains(index)) + return false; // This object has been added already } } |