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

Method onTickPreRender

physx/samples/samplebridges/SampleBridges.cpp:692–797  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

690}
691
692void SampleBridges::onTickPreRender(float dtime)
693{
694// shdfnd::printFormatted("SampleBridges::onTickPreRender\n");
695
696 const bool paused = isPaused();
697
698 // PT: keep track of elapsed render time
699 if(!paused)
700 mElapsedRenderTime += dtime;
701
702#ifdef CCT_ON_BRIDGES
703// const bool postUpdate = mCCTCamera->getCameraLinkToPhysics();
704 const bool postUpdate = true;
705// const bool postUpdate = false;
706
707 if(!postUpdate && !mPause)
708 {
709// shdfnd::printFormatted("CCT sync\n");
710 mActor->sync();
711 }
712#endif
713
714 if(!paused)
715 {
716// mPlatformManager.updatePhysicsPlatforms(dtime);
717
718 if(mBomb)
719 {
720 mBombTimer -= dtime;
721 if(mBombTimer<0.0f)
722 {
723 PxSceneWriteLock scopedLock(*mScene);
724 mBombTimer = 0.0f;
725
726 {
727 const PxVec3 bombPos = mBomb->getGlobalPose().p;
728 const PxReal bombActorRange = 30.0f;
729 const PxReal bombJointRange = 10.0f;
730 size_t nbJoints = mJoints.size();
731 for(PxU32 i=0;i<nbJoints;i++)
732 {
733 PxJoint* j = mJoints[i];
734 if(!j)
735 continue;
736
737 PxRigidActor* actor0;
738 PxRigidActor* actor1;
739 j->getActors(actor0, actor1);
740 const PxVec3 actorPos0 = actor0->getGlobalPose().p;
741 const PxVec3 actorPos1 = actor1->getGlobalPose().p;
742
743 applyBombForce(actor0, actorPos0, bombPos, bombActorRange);
744 applyBombForce(actor1, actorPos1, bombPos, bombActorRange);
745
746 const PxVec3 jointPos = (actorPos0 + actorPos1)*0.5f;
747 const PxReal d2 = (bombPos - jointPos).magnitudeSquared();
748 if(d2<bombJointRange*bombJointRange)
749 {

Callers

nothing calls this directly

Calls 11

applyBombForceFunction · 0.85
PX_UNUSEDFunction · 0.85
findAndReplaceWithLastFunction · 0.85
syncMethod · 0.45
getGlobalPoseMethod · 0.45
sizeMethod · 0.45
getActorsMethod · 0.45
magnitudeSquaredMethod · 0.45
releaseMethod · 0.45
getNbShapesMethod · 0.45
getShapesMethod · 0.45

Tested by

no test coverage detected