MCPcopy Create free account
hub / github.com/RavEngine/RavEngine / addArticulation

Method addArticulation

deps/physx/physx/source/physx/src/NpScene.cpp:805–833  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 4

createScissorLiftFunction · 0.45
createLongChainFunction · 0.45
fileToObjectMethod · 0.45

Calls 7

getFlagsMethod · 0.95
getPxSceneMethod · 0.80
getContextIdFunction · 0.50
getNbLinksMethod · 0.45
getConcreteTypeMethod · 0.45
errorMethod · 0.45
getImplMethod · 0.45

Tested by

no test coverage detected