aboutsummaryrefslogtreecommitdiff
path: root/PhysX_3.4/Source/SceneQuery/src/SqSceneQueryManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'PhysX_3.4/Source/SceneQuery/src/SqSceneQueryManager.cpp')
-rw-r--r--PhysX_3.4/Source/SceneQuery/src/SqSceneQueryManager.cpp32
1 files changed, 28 insertions, 4 deletions
diff --git a/PhysX_3.4/Source/SceneQuery/src/SqSceneQueryManager.cpp b/PhysX_3.4/Source/SceneQuery/src/SqSceneQueryManager.cpp
index 0c9850dc..3bc88dba 100644
--- a/PhysX_3.4/Source/SceneQuery/src/SqSceneQueryManager.cpp
+++ b/PhysX_3.4/Source/SceneQuery/src/SqSceneQueryManager.cpp
@@ -490,11 +490,35 @@ void SceneQueryManager::shiftOrigin(const PxVec3& shift)
mPrunerExt[i].pruner()->shiftOrigin(shift);
}
-void DynamicBoundsSync::sync(const PrunerHandle* handles, const PxU32* indices, const PxBounds3* bounds, PxU32 count)
+void DynamicBoundsSync::sync(const PrunerHandle* handles, const PxU32* indices, const PxBounds3* bounds, PxU32 count, const Cm::BitMap& dirtyShapeSimMap)
{
- mPruner->updateObjectsAndInflateBounds(handles, indices, bounds, count);
+ if(!count)
+ return;
+
+ PxU32 startIndex = 0;
+ PxU32 numIndices = count;
+
+ // if shape sim map is not empty, parse the indices and skip update for the dirty one
+ if(dirtyShapeSimMap.count())
+ {
+ numIndices = 0;
+
+ for(PxU32 i=0; i<count; i++)
+ {
+ if(dirtyShapeSimMap.test(indices[i]))
+ {
+ mPruner->updateObjectsAndInflateBounds(handles + startIndex, indices + startIndex, bounds, numIndices);
+ numIndices = 0;
+ startIndex = i + 1;
+ }
+ else
+ numIndices++;
+ }
+ // PT: we fallback to the next line on purpose - no "else"
+ }
+
+ mPruner->updateObjectsAndInflateBounds(handles + startIndex, indices + startIndex, bounds, numIndices);
- if(count)
- (*mTimestamp)++;
+ (*mTimestamp)++;
}