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

Method sceneQueriesUpdate

deps/physx/physx/source/physx/src/NpScene.cpp:2947–3001  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2945}
2946
2947void NpScene::sceneQueriesUpdate(physx::PxBaseTask* completionTask, bool controlSimulation)
2948{
2949 PX_SIMD_GUARD;
2950
2951 bool runUpdateTasks[PruningIndex::eCOUNT] = {true, true};
2952 {
2953 // write guard must end before scene queries tasks kicks off worker threads
2954 NP_WRITE_CHECK(this);
2955
2956 PX_PROFILE_START_CROSSTHREAD("Basic.sceneQueriesUpdate", getContextId());
2957
2958 if(mSceneQueriesUpdateRunning)
2959 {
2960 //fetchSceneQueries doesn't get called
2961 Ps::getFoundation().error(PxErrorCode::eINVALID_OPERATION, __FILE__, __LINE__, "PxScene::fetchSceneQueries was not called!");
2962 return;
2963 }
2964
2965 // flush scene queries updates
2966 mSQManager.flushUpdates();
2967
2968 // prepare scene queries for build - copy bounds
2969 runUpdateTasks[PruningIndex::eSTATIC] = mSQManager.prepareSceneQueriesUpdate(PruningIndex::eSTATIC);
2970 runUpdateTasks[PruningIndex::eDYNAMIC] = mSQManager.prepareSceneQueriesUpdate(PruningIndex::eDYNAMIC);
2971
2972 mSceneQueriesUpdateRunning = true;
2973 }
2974
2975 {
2976 PX_PROFILE_ZONE("Sim.sceneQueriesTaskSetup", getContextId());
2977
2978 if (controlSimulation)
2979 {
2980 {
2981 PX_PROFILE_ZONE("Sim.resetDependencies", getContextId());
2982 // Only reset dependencies, etc if we own the TaskManager. Will be false
2983 // when an NpScene is controlled by an APEX scene.
2984 mTaskManager->resetDependencies();
2985 }
2986 mTaskManager->startSimulation();
2987 }
2988
2989 mSceneQueriesCompletion.setContinuation(*mTaskManager, completionTask);
2990 if(runUpdateTasks[PruningIndex::eSTATIC])
2991 mSceneQueriesStaticPrunerUpdate.setContinuation(&mSceneQueriesCompletion);
2992 if(runUpdateTasks[PruningIndex::eDYNAMIC])
2993 mSceneQueriesDynamicPrunerUpdate.setContinuation(&mSceneQueriesCompletion);
2994
2995 mSceneQueriesCompletion.removeReference();
2996 if(runUpdateTasks[PruningIndex::eSTATIC])
2997 mSceneQueriesStaticPrunerUpdate.removeReference();
2998 if(runUpdateTasks[PruningIndex::eDYNAMIC])
2999 mSceneQueriesDynamicPrunerUpdate.removeReference();
3000 }
3001}
3002
3003bool NpScene::checkSceneQueriesInternal(bool block)
3004{

Callers

nothing calls this directly

Calls 8

flushUpdatesMethod · 0.80
resetDependenciesMethod · 0.80
startSimulationMethod · 0.80
setContinuationMethod · 0.80
getContextIdFunction · 0.50
errorMethod · 0.45
removeReferenceMethod · 0.45

Tested by

no test coverage detected