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

Method addArticulation

physx/source/physx/src/NpScene.cpp:808–836  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

806///////////////////////////////////////////////////////////////////////////////
807
808void NpScene::addArticulation(PxArticulationBase& articulation)
809{
810 PX_PROFILE_ZONE("API.addArticulation", getContextId());
811 NP_WRITE_CHECK(this);
812
813 PX_CHECK_AND_RETURN(articulation.getNbLinks()>0, "PxScene::addArticulation: empty articulations may not be added to simulation.");
814 PX_SIMD_GUARD;
815
816 if (this->getFlags() & PxSceneFlag::eENABLE_GPU_DYNAMICS)
817 {
818 Ps::getFoundation().error(PxErrorCode::eINVALID_OPERATION, __FILE__, __LINE__, "PxScene::addArticulation(): Articulations are not currently supported when PxSceneFlag::eENABLE_GPU_DYNAMICS is set!");
819 return;
820 }
821
822 if (getSimulationStage() != Sc::SimulationStage::eCOMPLETE && articulation.getType() == PxArticulationBase::eReducedCoordinate)
823 {
824 Ps::getFoundation().error(PxErrorCode::eINVALID_OPERATION, __FILE__, __LINE__, "PxScene::addArticulation(): this call is not allowed while the simulation is running. Call will be ignored!");
825 return;
826 }
827
828 PxArticulationImpl& npa = *reinterpret_cast<PxArticulationImpl*>(articulation.getImpl());
829
830 Scb::Articulation& art = npa.getArticulation();
831 const Scb::ControlState::Enum cs = art.getControlState();
832 if ((cs == Scb::ControlState::eNOT_IN_SCENE) || ((cs == Scb::ControlState::eREMOVE_PENDING) && (art.getScbScene()->getPxScene() == this)))
833 addArticulationInternal(articulation);
834 else
835 Ps::getFoundation().error(PxErrorCode::eINVALID_OPERATION, __FILE__, __LINE__, "PxScene::addArticulation(): Articulation already assigned to a scene. Call will be ignored!");
836}
837
838void NpScene::addArticulationInternal(PxArticulationBase& npa)
839{

Callers 4

createScissorLiftFunction · 0.45
createLongChainFunction · 0.45
fileToObjectMethod · 0.45

Calls 8

getFlagsMethod · 0.95
errorMethod · 0.80
getArticulationMethod · 0.80
getPxSceneMethod · 0.80
getContextIdFunction · 0.50
getNbLinksMethod · 0.45
getTypeMethod · 0.45
getImplMethod · 0.45

Tested by

no test coverage detected