| 262 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 263 | |
| 264 | PxAgain AABBPruner::overlap(const ShapeData& queryVolume, PrunerCallback& pcb) const |
| 265 | { |
| 266 | PX_ASSERT(!mUncommittedChanges); |
| 267 | |
| 268 | PxAgain again = true; |
| 269 | |
| 270 | if(mAABBTree) |
| 271 | { |
| 272 | switch(queryVolume.getType()) |
| 273 | { |
| 274 | case PxGeometryType::eBOX: |
| 275 | { |
| 276 | if(queryVolume.isOBB()) |
| 277 | { |
| 278 | const Gu::OBBAABBTest test(queryVolume.getPrunerWorldPos(), queryVolume.getPrunerWorldRot33(), queryVolume.getPrunerBoxGeomExtentsInflated()); |
| 279 | again = AABBTreeOverlap<Gu::OBBAABBTest, AABBTree, AABBTreeRuntimeNode, PrunerPayload, PrunerCallback>()(mPool.getObjects(), mPool.getCurrentWorldBoxes(), *mAABBTree, test, pcb); |
| 280 | } |
| 281 | else |
| 282 | { |
| 283 | const Gu::AABBAABBTest test(queryVolume.getPrunerInflatedWorldAABB()); |
| 284 | again = AABBTreeOverlap<Gu::AABBAABBTest, AABBTree, AABBTreeRuntimeNode, PrunerPayload, PrunerCallback>()(mPool.getObjects(), mPool.getCurrentWorldBoxes(), *mAABBTree, test, pcb); |
| 285 | } |
| 286 | } |
| 287 | break; |
| 288 | case PxGeometryType::eCAPSULE: |
| 289 | { |
| 290 | const Gu::Capsule& capsule = queryVolume.getGuCapsule(); |
| 291 | const Gu::CapsuleAABBTest test( capsule.p1, queryVolume.getPrunerWorldRot33().column0, |
| 292 | queryVolume.getCapsuleHalfHeight()*2.0f, PxVec3(capsule.radius*SQ_PRUNER_INFLATION)); |
| 293 | again = AABBTreeOverlap<Gu::CapsuleAABBTest, AABBTree, AABBTreeRuntimeNode, PrunerPayload, PrunerCallback>()(mPool.getObjects(), mPool.getCurrentWorldBoxes(), *mAABBTree, test, pcb); |
| 294 | } |
| 295 | break; |
| 296 | case PxGeometryType::eSPHERE: |
| 297 | { |
| 298 | const Gu::Sphere& sphere = queryVolume.getGuSphere(); |
| 299 | Gu::SphereAABBTest test(sphere.center, sphere.radius); |
| 300 | again = AABBTreeOverlap<Gu::SphereAABBTest, AABBTree, AABBTreeRuntimeNode, PrunerPayload, PrunerCallback>()(mPool.getObjects(), mPool.getCurrentWorldBoxes(), *mAABBTree, test, pcb); |
| 301 | } |
| 302 | break; |
| 303 | case PxGeometryType::eCONVEXMESH: |
| 304 | { |
| 305 | const Gu::OBBAABBTest test(queryVolume.getPrunerWorldPos(), queryVolume.getPrunerWorldRot33(), queryVolume.getPrunerBoxGeomExtentsInflated()); |
| 306 | again = AABBTreeOverlap<Gu::OBBAABBTest, AABBTree, AABBTreeRuntimeNode, PrunerPayload, PrunerCallback>()(mPool.getObjects(), mPool.getCurrentWorldBoxes(), *mAABBTree, test, pcb); |
| 307 | } |
| 308 | break; |
| 309 | case PxGeometryType::ePLANE: |
| 310 | case PxGeometryType::eTRIANGLEMESH: |
| 311 | case PxGeometryType::eHEIGHTFIELD: |
| 312 | case PxGeometryType::eGEOMETRY_COUNT: |
| 313 | case PxGeometryType::eINVALID: |
| 314 | PX_ALWAYS_ASSERT_MESSAGE("unsupported overlap query volume geometry type"); |
| 315 | } |
| 316 | } |
| 317 | |
| 318 | if(again && mIncrementalRebuild && mBucketPruner.getNbObjects()) |
| 319 | again = mBucketPruner.overlap(queryVolume, pcb); |
| 320 | |
| 321 | return again; |
nothing calls this directly
no test coverage detected