| 239 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 240 | |
| 241 | PxAgain IncrementalAABBPruner::overlap(const ShapeData& queryVolume, PrunerCallback& pcb) const |
| 242 | { |
| 243 | PxAgain again = true; |
| 244 | |
| 245 | if(mAABBTree && mAABBTree->getNodes()) |
| 246 | { |
| 247 | switch(queryVolume.getType()) |
| 248 | { |
| 249 | case PxGeometryType::eBOX: |
| 250 | { |
| 251 | if(queryVolume.isOBB()) |
| 252 | { |
| 253 | const Gu::OBBAABBTest test(queryVolume.getPrunerWorldPos(), queryVolume.getPrunerWorldRot33(), queryVolume.getPrunerBoxGeomExtentsInflated()); |
| 254 | again = AABBTreeOverlap<Gu::OBBAABBTest, IncrementalAABBTree, IncrementalAABBTreeNode, PrunerPayload, PrunerCallback>()(mPool.getObjects(), mPool.getCurrentWorldBoxes(), *mAABBTree, test, pcb); |
| 255 | } |
| 256 | else |
| 257 | { |
| 258 | const Gu::AABBAABBTest test(queryVolume.getPrunerInflatedWorldAABB()); |
| 259 | again = AABBTreeOverlap<Gu::AABBAABBTest, IncrementalAABBTree, IncrementalAABBTreeNode, PrunerPayload, PrunerCallback>()(mPool.getObjects(), mPool.getCurrentWorldBoxes(), *mAABBTree, test, pcb); |
| 260 | } |
| 261 | } |
| 262 | break; |
| 263 | case PxGeometryType::eCAPSULE: |
| 264 | { |
| 265 | const Gu::Capsule& capsule = queryVolume.getGuCapsule(); |
| 266 | const Gu::CapsuleAABBTest test( capsule.p1, queryVolume.getPrunerWorldRot33().column0, |
| 267 | queryVolume.getCapsuleHalfHeight()*2.0f, PxVec3(capsule.radius*SQ_PRUNER_INFLATION)); |
| 268 | again = AABBTreeOverlap<Gu::CapsuleAABBTest, IncrementalAABBTree, IncrementalAABBTreeNode, PrunerPayload, PrunerCallback>()(mPool.getObjects(), mPool.getCurrentWorldBoxes(), *mAABBTree, test, pcb); |
| 269 | } |
| 270 | break; |
| 271 | case PxGeometryType::eSPHERE: |
| 272 | { |
| 273 | const Gu::Sphere& sphere = queryVolume.getGuSphere(); |
| 274 | Gu::SphereAABBTest test(sphere.center, sphere.radius); |
| 275 | again = AABBTreeOverlap<Gu::SphereAABBTest, IncrementalAABBTree, IncrementalAABBTreeNode, PrunerPayload, PrunerCallback>()(mPool.getObjects(), mPool.getCurrentWorldBoxes(), *mAABBTree, test, pcb); |
| 276 | } |
| 277 | break; |
| 278 | case PxGeometryType::eCONVEXMESH: |
| 279 | { |
| 280 | const Gu::OBBAABBTest test(queryVolume.getPrunerWorldPos(), queryVolume.getPrunerWorldRot33(), queryVolume.getPrunerBoxGeomExtentsInflated()); |
| 281 | again = AABBTreeOverlap<Gu::OBBAABBTest, IncrementalAABBTree, IncrementalAABBTreeNode, PrunerPayload, PrunerCallback>()(mPool.getObjects(), mPool.getCurrentWorldBoxes(), *mAABBTree, test, pcb); |
| 282 | } |
| 283 | break; |
| 284 | case PxGeometryType::ePLANE: |
| 285 | case PxGeometryType::eTRIANGLEMESH: |
| 286 | case PxGeometryType::eHEIGHTFIELD: |
| 287 | case PxGeometryType::eGEOMETRY_COUNT: |
| 288 | case PxGeometryType::eINVALID: |
| 289 | PX_ALWAYS_ASSERT_MESSAGE("unsupported overlap query volume geometry type"); |
| 290 | } |
| 291 | } |
| 292 | |
| 293 | return again; |
| 294 | } |
| 295 | |
| 296 | PxAgain IncrementalAABBPruner::sweep(const ShapeData& queryVolume, const PxVec3& unitDir, PxReal& inOutDistance, PrunerCallback& pcb) const |
| 297 | { |
nothing calls this directly
no test coverage detected