aboutsummaryrefslogtreecommitdiff
path: root/PhysX_3.4/Source/SceneQuery/src
diff options
context:
space:
mode:
authorSheikh Dawood Abdul Ajees <[email protected]>2018-01-26 19:43:03 -0600
committerSheikh Dawood Abdul Ajees <[email protected]>2018-01-26 19:43:03 -0600
commitb6db9a56548cd1c41bee309e721d76ea2c9320da (patch)
tree1f0436b187db50c21e576b4f4d491530113c91bc /PhysX_3.4/Source/SceneQuery/src
parentPhysX 3.4.1, APEX 1.4.1 Release @23307153 (diff)
downloadphysx-3.4-b6db9a56548cd1c41bee309e721d76ea2c9320da.tar.xz
physx-3.4-b6db9a56548cd1c41bee309e721d76ea2c9320da.zip
PhysX 3.4, APEX 1.4 patch release @23472123
Diffstat (limited to 'PhysX_3.4/Source/SceneQuery/src')
-rw-r--r--PhysX_3.4/Source/SceneQuery/src/SqPruningStructure.cpp9
-rw-r--r--PhysX_3.4/Source/SceneQuery/src/SqSceneQueryManager.cpp32
2 files changed, 33 insertions, 8 deletions
diff --git a/PhysX_3.4/Source/SceneQuery/src/SqPruningStructure.cpp b/PhysX_3.4/Source/SceneQuery/src/SqPruningStructure.cpp
index 0a2cee50..432a6fbc 100644
--- a/PhysX_3.4/Source/SceneQuery/src/SqPruningStructure.cpp
+++ b/PhysX_3.4/Source/SceneQuery/src/SqPruningStructure.cpp
@@ -124,7 +124,7 @@ void PruningStructure::release()
}
template <typename ActorType>
-static void getShapeBounds(PxRigidActor* actor, bool dynamic, PxBounds3& bounds, PxU32& numShapes)
+static void getShapeBounds(PxRigidActor* actor, bool dynamic, PxBounds3* bounds, PxU32& numShapes)
{
PruningIndex::Enum treeStructure = dynamic ? PruningIndex::eDYNAMIC : PruningIndex::eSTATIC;
ActorType& a = *static_cast<ActorType*>(actor);
@@ -137,7 +137,8 @@ static void getShapeBounds(PxRigidActor* actor, bool dynamic, PxBounds3& bounds,
const Scb::Shape& scbShape = shape->getScbShape();
const Scb::Actor& scbActor = a.getScbActorFast();
- (gComputeBoundsTable[treeStructure])(bounds, scbShape, scbActor);
+ (gComputeBoundsTable[treeStructure])(*bounds, scbShape, scbActor);
+ bounds++;
numShapes++;
}
}
@@ -235,12 +236,12 @@ bool PruningStructure::build(PxRigidActor*const* actors, PxU32 nbActors)
if (type == PxConcreteType::eRIGID_STATIC)
{
getShapeBounds<NpRigidStatic>(actors[actorsDone], false,
- bounds[PruningIndex::eSTATIC][numShapes[PruningIndex::eSTATIC]], numShapes[PruningIndex::eSTATIC]);
+ &bounds[PruningIndex::eSTATIC][numShapes[PruningIndex::eSTATIC]], numShapes[PruningIndex::eSTATIC]);
}
else if (type == PxConcreteType::eRIGID_DYNAMIC)
{
getShapeBounds<NpRigidDynamic>(actors[actorsDone], true,
- bounds[PruningIndex::eDYNAMIC][numShapes[PruningIndex::eDYNAMIC]], numShapes[PruningIndex::eDYNAMIC]);
+ &bounds[PruningIndex::eDYNAMIC][numShapes[PruningIndex::eDYNAMIC]], numShapes[PruningIndex::eDYNAMIC]);
}
}
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)++;
}