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

Method advance

physx/source/physx/src/NpScene.cpp:1900–1927  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1898}
1899
1900void NpScene::advance( physx::PxBaseTask* completionTask)
1901{
1902 NP_WRITE_CHECK(this);
1903 //issue error if advance() doesn't get called between fetchCollision() and fetchResult()
1904 if(getSimulationStage() != Sc::SimulationStage::eFETCHCOLLIDE)
1905 {
1906 Ps::getFoundation().error(PxErrorCode::eINVALID_OPERATION, __FILE__, __LINE__, "PxScene::advance: advance() called illegally! advance() needed to be called after fetchCollision() and before fetchResult()!!");
1907 return;
1908 }
1909
1910 //apply buffering for forces, velocities, kinematic targets and wake-up events
1911 mScene.syncWriteThroughProperties();
1912
1913 //if mSimulateStage == eFETCHCOLLIDE, which means collide() has been kicked off and finished running, we can run advance() safely
1914 {
1915 //change the mSimulateStaget to eADVANCE to indicate the next stage to run is fetchResult()
1916 setSimulationStage(Sc::SimulationStage::eADVANCE);
1917
1918 {
1919 PX_PROFILE_ZONE("Sim.taskFrameworkSetup", getContextId());
1920
1921 mSceneCompletion.setDependent(completionTask);
1922 mSceneAdvance.setContinuation(*mTaskManager, &mSceneCompletion);
1923 mSceneCompletion.removeReference();
1924 mSceneAdvance.removeReference();
1925 }
1926 }
1927}
1928
1929void NpScene::collide(PxReal elapsedTime, physx::PxBaseTask* completionTask, void* scratchBlock, PxU32 scratchBlockSize, bool controlSimulation)
1930{

Callers 4

stepPhysicsFunction · 0.45
cleanupPhysicsFunction · 0.45
executeAdvanceMethod · 0.45
advanceFunction · 0.45

Calls 7

errorMethod · 0.80
setDependentMethod · 0.80
setContinuationMethod · 0.80
setSimulationStageFunction · 0.70
getContextIdFunction · 0.50
removeReferenceMethod · 0.45

Tested by

no test coverage detected