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

Method update

physx/source/lowleveldynamics/src/DyTGSDynamics.cpp:532–720  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

530
531
532void DynamicsTGSContext::update(IG::SimpleIslandManager& simpleIslandManager, PxBaseTask* continuation, PxBaseTask* lostTouchTask,
533 PxsContactManager** /*foundPatchManagers*/, PxU32 /*nbFoundPatchManagers*/,
534 PxsContactManager** /*lostPatchManagers*/, PxU32 /*nbLostPatchManagers*/,
535 PxU32 /*maxPatchesPerCM*/,
536 PxsContactManagerOutputIterator& iterator,
537 PxsContactManagerOutput*,
538 const PxReal dt, const PxVec3& gravity, const PxU32 /*bitMapWordCounts*/)
539{
540 PX_PROFILE_ZONE("Dynamics.solverQueueTasks", mContextID);
541
542 PX_UNUSED(simpleIslandManager);
543
544 mOutputIterator = iterator;
545
546 //const PxU32 nbSubsteps = 16;
547
548 mDt = dt;
549 mInvDt = 1.f / dt;
550
551 mGravity = gravity;
552
553 const IG::IslandSim& islandSim = simpleIslandManager.getAccurateIslandSim();
554
555 const PxU32 islandCount = islandSim.getNbActiveIslands();
556
557 const PxU32 activatedContactCount = islandSim.getNbActivatedEdges(IG::Edge::eCONTACT_MANAGER);
558 const IG::EdgeIndex* const activatingEdges = islandSim.getActivatedEdges(IG::Edge::eCONTACT_MANAGER);
559
560 for (PxU32 a = 0; a < activatedContactCount; ++a)
561 {
562 PxsContactManager* cm = simpleIslandManager.getContactManager(activatingEdges[a]);
563 if (cm)
564 {
565 cm->getWorkUnit().frictionPatchCount = 0; //KS - zero the friction patch count on any activating edges
566 }
567 }
568
569#if PX_ENABLE_SIM_STATS
570 if (islandCount > 0)
571 {
572 mSimStats.mNbActiveKinematicBodies = islandSim.getNbActiveKinematics();
573 mSimStats.mNbActiveDynamicBodies = islandSim.getNbActiveNodes(IG::Node::eRIGID_BODY_TYPE);
574 mSimStats.mNbActiveConstraints = islandSim.getNbActiveEdges(IG::Edge::eCONSTRAINT);
575 }
576 else
577 {
578 mSimStats.mNbActiveKinematicBodies = islandSim.getNbActiveKinematics();
579 mSimStats.mNbActiveDynamicBodies = 0;
580 mSimStats.mNbActiveConstraints = 0;
581 }
582#endif
583
584 mThresholdStreamOut = 0;
585
586 resetThreadContexts();
587
588 //If there is no work to do then we can do nothing at all.
589 if (0 == islandCount)

Callers

nothing calls this directly

Calls 15

PX_UNUSEDFunction · 0.85
PxMinFunction · 0.85
nextPowerOfTwoFunction · 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

Tested by

no test coverage detected