| 1674 | } |
| 1675 | |
| 1676 | void AABBManager::finalizeUpdate(PxU32 numCpuTasks, PxcScratchAllocator* scratchAllocator, PxBaseTask* continuation, PxBaseTask* narrowPhaseUnlockTask) |
| 1677 | { |
| 1678 | PX_PROFILE_ZONE("AABBManager::finalizeUpdate", getContextId()); |
| 1679 | |
| 1680 | const bool singleThreaded = gSingleThreaded || numCpuTasks<2; |
| 1681 | if(!singleThreaded) |
| 1682 | { |
| 1683 | const PxU32 size = mDirtyAggregates.size(); |
| 1684 | for(PxU32 i=0;i<size;i++) |
| 1685 | { |
| 1686 | Aggregate* aggregate = mDirtyAggregates[i]; |
| 1687 | mBoundsArray.begin()[aggregate->mIndex] = aggregate->getMergedBounds(); |
| 1688 | } |
| 1689 | } |
| 1690 | |
| 1691 | const BroadPhaseUpdateData updateData( mAddedHandles.begin(), mAddedHandles.size(), |
| 1692 | mUpdatedHandles.begin(), mUpdatedHandles.size(), |
| 1693 | mRemovedHandles.begin(), mRemovedHandles.size(), |
| 1694 | mBoundsArray.begin(), mGroups.begin(), |
| 1695 | #ifdef BP_FILTERING_USES_TYPE_IN_GROUP |
| 1696 | &mLUT[0][0], |
| 1697 | #endif |
| 1698 | mContactDistance.begin(), mBoundsArray.getCapacity(), |
| 1699 | mPersistentStateChanged || mBoundsArray.hasChanged()); |
| 1700 | mPersistentStateChanged = false; |
| 1701 | |
| 1702 | PX_ASSERT(updateData.isValid()); |
| 1703 | |
| 1704 | //KS - skip broad phase if there are no updated shapes. |
| 1705 | if (updateData.getNumCreatedHandles() != 0 || updateData.getNumRemovedHandles() != 0 || updateData.getNumUpdatedHandles() != 0) |
| 1706 | mBroadPhase.update(numCpuTasks, scratchAllocator, updateData, continuation, narrowPhaseUnlockTask); |
| 1707 | else |
| 1708 | narrowPhaseUnlockTask->removeReference(); |
| 1709 | } |
| 1710 | |
| 1711 | static PX_FORCE_INLINE void createOverlap(Ps::Array<AABBOverlap>* overlaps, const Ps::Array<VolumeData>& volumeData, PxU32 id0, PxU32 id1) |
| 1712 | { |
no test coverage detected