| 1898 | } |
| 1899 | |
| 1900 | void 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 | |
| 1929 | void NpScene::collide(PxReal elapsedTime, physx::PxBaseTask* completionTask, void* scratchBlock, PxU32 scratchBlockSize, bool controlSimulation) |
| 1930 | { |
no test coverage detected