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

Method addCompoundShape

physx/source/scenequery/src/SqSceneQueryManager.cpp:555–579  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

553}
554
555void SceneQueryManager::addCompoundShape(const Gu::BVHStructure& bvhStructure, PrunerCompoundId compoundId, const PxTransform& compoundTransform, PrunerData* prunerData, const Scb::Shape** scbShapes, const Scb::Actor& scbActor)
556{
557 PX_ASSERT(mCompoundPrunerExt.mPruner);
558
559 const PxU32 nbShapes = bvhStructure.getNbBounds();
560
561 PX_ALLOCA(res, PrunerHandle, nbShapes);
562 PX_ALLOCA(payloads, PrunerPayload, nbShapes);
563
564 for(PxU32 i = 0; i < nbShapes; i++)
565 {
566 payloads[i].data[0] = size_t(scbShapes[i]); //PAYLOAD
567 payloads[i].data[1] = size_t(&scbActor); //PAYLOAD
568 }
569
570 CompoundFlag::Enum flags = (scbActor.getActorType() == PxActorType::eRIGID_DYNAMIC) ? CompoundFlag::DYNAMIC_COMPOUND : CompoundFlag::STATIC_COMPOUND;
571 mCompoundPrunerExt.mPruner->addCompound(res, bvhStructure, compoundId, compoundTransform, flags, payloads);
572 const PxU32 index = (flags & CompoundFlag::STATIC_COMPOUND) ? PxU32(0) : PxU32(1);
573 mPrunerExt[index].invalidateTimestamp();
574
575 for(PxU32 i = 0; i < nbShapes; i++)
576 {
577 prunerData[i] = createPrunerData(index, res[i]);
578 }
579}
580
581void SceneQueryManager::updateCompoundActors(Sc::BodyCore*const* bodies, PxU32 numBodies)
582{

Callers 1

addBVHStructureShapesMethod · 0.80

Calls 3

getNbBoundsMethod · 0.80
invalidateTimestampMethod · 0.80
addCompoundMethod · 0.45

Tested by

no test coverage detected