diff options
| author | sschirm <[email protected]> | 2016-12-23 14:20:36 +0100 |
|---|---|---|
| committer | sschirm <[email protected]> | 2016-12-23 14:56:17 +0100 |
| commit | ef6937e69e8ee3f409cf9d460d5ad300a65d5924 (patch) | |
| tree | 710426e8daa605551ce3f34b581897011101c30f /PhysX_3.4/Source/LowLevelAABB/src | |
| parent | Initial commit: (diff) | |
| download | physx-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/LowLevelAABB/src')
| -rw-r--r-- | PhysX_3.4/Source/LowLevelAABB/src/BpBroadPhaseMBP.cpp | 19 | ||||
| -rw-r--r-- | PhysX_3.4/Source/LowLevelAABB/src/BpSimpleAABBManager.cpp | 15 |
2 files changed, 9 insertions, 25 deletions
diff --git a/PhysX_3.4/Source/LowLevelAABB/src/BpBroadPhaseMBP.cpp b/PhysX_3.4/Source/LowLevelAABB/src/BpBroadPhaseMBP.cpp index 5227c7a4..fb73e5d8 100644 --- a/PhysX_3.4/Source/LowLevelAABB/src/BpBroadPhaseMBP.cpp +++ b/PhysX_3.4/Source/LowLevelAABB/src/BpBroadPhaseMBP.cpp @@ -36,7 +36,6 @@ #include "PsFoundation.h" #include "PsVecMath.h" - using namespace physx::shdfnd::aos; //#define CHECK_NB_OVERLAPS @@ -50,24 +49,6 @@ using namespace physx; using namespace Bp; using namespace Cm; - template<class T> - static PX_INLINE T* reserveContainerMemory(Ps::Array<T>& container, PxU32 nb) - { - const PxU32 maxNbEntries = container.capacity(); - const PxU32 requiredSize = container.size() + nb; - - if(requiredSize>maxNbEntries) - { - const PxU32 naturalGrowthSize = maxNbEntries ? maxNbEntries*2 : 2; - const PxU32 newSize = PxMax(requiredSize, naturalGrowthSize); - container.reserve(newSize); - } - - T* buf = container.end(); - container.forceSize_Unsafe(requiredSize); - return buf; - } - static PX_FORCE_INLINE void storeDwords(PxU32* dest, PxU32 nb, PxU32 value) { while(nb--) diff --git a/PhysX_3.4/Source/LowLevelAABB/src/BpSimpleAABBManager.cpp b/PhysX_3.4/Source/LowLevelAABB/src/BpSimpleAABBManager.cpp index 37b5027b..5b33c71b 100644 --- a/PhysX_3.4/Source/LowLevelAABB/src/BpSimpleAABBManager.cpp +++ b/PhysX_3.4/Source/LowLevelAABB/src/BpSimpleAABBManager.cpp @@ -1308,7 +1308,7 @@ void Aggregate::sortBounds() { Ps::Array<PxU32> copy = mAggregated; InflatedAABB* boundsCopy = reinterpret_cast<InflatedAABB*>(PX_ALLOC(sizeof(InflatedAABB)*(nbObjects+1), "mInflatedBounds")); - memcpy(boundsCopy, mInflatedBounds, (nbObjects+1)*sizeof(InflatedAABB)); + PxMemCopy(boundsCopy, mInflatedBounds, (nbObjects+1)*sizeof(InflatedAABB)); const PxU32* Sorted = mRS.GetRanks(); for(PxU32 i=0;i<nbObjects;i++) @@ -1832,11 +1832,14 @@ void SimpleAABBManager::handleOriginShift() { const AggregateHandle aggregateHandle = mVolumeData[i].getAggregate(); Aggregate* aggregate = getAggregateFromHandle(aggregateHandle); - aggregate->markAsDirty(mDirtyAggregates); - aggregate->allocateBounds(); - aggregate->computeBounds(mBoundsArray, mContactDistance.begin()); - mBoundsArray.begin()[aggregate->mIndex] = aggregate->mBounds; - mUpdatedHandles.pushBack(i); // PT: TODO: BoundsIndex-to-ShapeHandle confusion here + if(aggregate->getNbAggregated()) + { + aggregate->markAsDirty(mDirtyAggregates); + aggregate->allocateBounds(); + aggregate->computeBounds(mBoundsArray, mContactDistance.begin()); + mBoundsArray.begin()[aggregate->mIndex] = aggregate->mBounds; + mUpdatedHandles.pushBack(i); // PT: TODO: BoundsIndex-to-ShapeHandle confusion here + } } } } |