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

Method update

deps/physx/physx/source/lowleveldynamics/src/DyTGSDynamics.cpp:554–742  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

552
553
554void DynamicsTGSContext::update(IG::SimpleIslandManager& simpleIslandManager, PxBaseTask* continuation, PxBaseTask* lostTouchTask,
555 PxsContactManager** /*foundPatchManagers*/, PxU32 /*nbFoundPatchManagers*/,
556 PxsContactManager** /*lostPatchManagers*/, PxU32 /*nbLostPatchManagers*/,
557 PxU32 /*maxPatchesPerCM*/,
558 PxsContactManagerOutputIterator& iterator,
559 PxsContactManagerOutput*,
560 const PxReal dt, const PxVec3& gravity, const PxU32 /*bitMapWordCounts*/)
561{
562 PX_PROFILE_ZONE("Dynamics.solverQueueTasks", mContextID);
563
564 PX_UNUSED(simpleIslandManager);
565
566 mOutputIterator = iterator;
567
568 //const PxU32 nbSubsteps = 16;
569
570 mDt = dt;
571 mInvDt = 1.f / dt;
572
573 mGravity = gravity;
574
575 const IG::IslandSim& islandSim = simpleIslandManager.getAccurateIslandSim();
576
577 const PxU32 islandCount = islandSim.getNbActiveIslands();
578
579 const PxU32 activatedContactCount = islandSim.getNbActivatedEdges(IG::Edge::eCONTACT_MANAGER);
580 const IG::EdgeIndex* const activatingEdges = islandSim.getActivatedEdges(IG::Edge::eCONTACT_MANAGER);
581
582 for (PxU32 a = 0; a < activatedContactCount; ++a)
583 {
584 PxsContactManager* cm = simpleIslandManager.getContactManager(activatingEdges[a]);
585 if (cm)
586 {
587 cm->getWorkUnit().frictionPatchCount = 0; //KS - zero the friction patch count on any activating edges
588 }
589 }
590
591#if PX_ENABLE_SIM_STATS
592 if (islandCount > 0)
593 {
594 mSimStats.mNbActiveKinematicBodies = islandSim.getNbActiveKinematics();
595 mSimStats.mNbActiveDynamicBodies = islandSim.getNbActiveNodes(IG::Node::eRIGID_BODY_TYPE);
596 mSimStats.mNbActiveConstraints = islandSim.getNbActiveEdges(IG::Edge::eCONSTRAINT);
597 }
598 else
599 {
600 mSimStats.mNbActiveKinematicBodies = islandSim.getNbActiveKinematics();
601 mSimStats.mNbActiveDynamicBodies = 0;
602 mSimStats.mNbActiveConstraints = 0;
603 }
604#endif
605
606 mThresholdStreamOut = 0;
607
608 resetThreadContexts();
609
610 //If there is no work to do then we can do nothing at all.
611 if (0 == islandCount)

Callers

nothing calls this directly

Calls 15

PX_UNUSEDFunction · 0.85
PxMinFunction · 0.85
getNbActiveIslandsMethod · 0.80
getNbActivatedEdgesMethod · 0.80
getActivatedEdgesMethod · 0.80
getContactManagerMethod · 0.80
getNbActiveKinematicsMethod · 0.80
getNbActiveNodesMethod · 0.80
getNbActiveEdgesMethod · 0.80
setContinuationMethod · 0.80
getActiveKinematicsMethod · 0.80
PxVec3Class · 0.50

Tested by

no test coverage detected