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

Method addBody

physx/source/simulationcontroller/src/ScScene.cpp:4876–4901  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4874}
4875
4876void Sc::Scene::addBody(BodyCore& body, void*const *shapes, PxU32 nbShapes, size_t shapePtrOffset, PxBounds3* outBounds, bool compound)
4877{
4878 // sim objects do all the necessary work of adding themselves to broad phase,
4879 // activation, registering with the interaction system, etc
4880
4881 BodySim* sim = mBodySimPool->construct(*this, body, compound);
4882
4883 const bool isArticulationLink = sim->isArticulationLink();
4884
4885 if (sim->getLowLevelBody().mCore->mFlags & PxRigidBodyFlag::eENABLE_SPECULATIVE_CCD)
4886 {
4887 if (isArticulationLink)
4888 {
4889 if (sim->getNodeIndex().isValid())
4890 mSpeculativeCDDArticulationBitMap.growAndSet(sim->getNodeIndex().index());
4891 }
4892 else
4893 mSpeculativeCCDRigidBodyBitMap.growAndSet(sim->getNodeIndex().index());
4894 }
4895 //if rigid body is articulation link, the node index will be invalid. We should add the link to the scene after we add the
4896 //articulation for gpu
4897 if(sim->getNodeIndex().isValid())
4898 mSimulationController->addDynamic(&sim->getLowLevelBody(), sim->getNodeIndex());
4899 mNbRigidDynamics++;
4900 addShapes(shapes, nbShapes, shapePtrOffset, *sim, outBounds);
4901}
4902
4903void Sc::Scene::removeBody(BodyCore& body, Ps::InlineArray<const Sc::ShapeCore*,64>& removedShapes, bool wakeOnLostTouch)
4904{

Callers 4

ArticulationJointSimMethod · 0.45
NpScene.cppFile · 0.45
switchRigidFromNoSimMethod · 0.45
addOrRemoveRigidObjectFunction · 0.45

Calls 9

isArticulationLinkMethod · 0.80
growAndSetMethod · 0.80
indexMethod · 0.80
addDynamicMethod · 0.80
allocateAndPrefetchMethod · 0.80
prefetchFunction · 0.50
constructMethod · 0.45
isValidMethod · 0.45
getCountMethod · 0.45

Tested by

no test coverage detected