MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/PhysX / addBVHStructureShapes

Method addBVHStructureShapes

physx/source/physx/src/NpShapeManager.cpp:328–357  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

326//
327
328void NpShapeManager::addBVHStructureShapes(SceneQueryManager& sqManager, const PxRigidActor& actor, const Gu::BVHStructure* bvhStructure)
329{
330 PX_ASSERT(bvhStructure);
331
332 const Scb::Actor& scbActor = NpActor::getScbFromPxActor(actor);
333 const PxU32 nbShapes = getNbShapes();
334
335 PX_ALLOCA(scbShapes, const Scb::Shape*, nbShapes);
336 PX_ALLOCA(prunerData, Sq::PrunerData, nbShapes);
337
338 PxU32 numSqShapes = 0;
339 for(PxU32 i = 0; i < nbShapes; i++)
340 {
341 const NpShape& shape = *getShapes()[i];
342 if(isSceneQuery(shape))
343 scbShapes[numSqShapes++] = &shape.getScbShape();
344 }
345 PX_ASSERT(numSqShapes == bvhStructure->getNbBounds());
346
347 mSqCompoundId = static_cast<const Sc::RigidCore&>(NpActor::getScbFromPxActor(actor).getActorCore()).getRigidID();
348 sqManager.addCompoundShape(*bvhStructure, mSqCompoundId, actor.getGlobalPose(), prunerData, scbShapes, scbActor);
349
350 numSqShapes = 0;
351 for(PxU32 i = 0; i < nbShapes; i++)
352 {
353 const NpShape& shape = *getShapes()[i];
354 if(isSceneQuery(shape))
355 setPrunerData(i, prunerData[numSqShapes++]);
356 }
357}
358
359void NpShapeManager::addPrunerShape(SceneQueryManager& sqManager, PxU32 index, const NpShape& shape, const PxRigidActor& actor, bool dynamic, const PxBounds3* bound, bool hasPrunerStructure)
360{

Callers

nothing calls this directly

Calls 6

getNbShapesFunction · 0.85
isSceneQueryFunction · 0.85
getNbBoundsMethod · 0.80
addCompoundShapeMethod · 0.80
getRigidIDMethod · 0.45
getGlobalPoseMethod · 0.45

Tested by

no test coverage detected