| 2910 | } |
| 2911 | |
| 2912 | void Sc::Scene::updateCCDMultiPass(PxBaseTask* parentContinuation) |
| 2913 | { |
| 2914 | getCcdBodies().forceSize_Unsafe(mSimulationControllerCallback->getNbCcdBodies()); |
| 2915 | |
| 2916 | // second run of the broadphase for making sure objects we have integrated did not tunnel. |
| 2917 | if(mPublicFlags & PxSceneFlag::eENABLE_CCD) |
| 2918 | { |
| 2919 | if (mContactReportsNeedPostSolverVelocity) |
| 2920 | { |
| 2921 | // the CCD code will overwrite the post solver body velocities, hence, we need to extract the info |
| 2922 | // first if any CCD enabled pair requested it. |
| 2923 | collectPostSolverVelocitiesBeforeCCD(); |
| 2924 | } |
| 2925 | |
| 2926 | //We use 2 CCD task chains to be able to chain together an arbitrary number of ccd passes |
| 2927 | if(mPostCCDPass.size() != 2) |
| 2928 | { |
| 2929 | mPostCCDPass.clear(); |
| 2930 | mUpdateCCDSinglePass.clear(); |
| 2931 | mCCDBroadPhase.clear(); |
| 2932 | mCCDBroadPhaseAABB.clear(); |
| 2933 | mPostCCDPass.reserve(2); |
| 2934 | mUpdateCCDSinglePass.reserve(2); |
| 2935 | mUpdateCCDSinglePass2.reserve(2); |
| 2936 | mUpdateCCDSinglePass3.reserve(2); |
| 2937 | mCCDBroadPhase.reserve(2); |
| 2938 | mCCDBroadPhaseAABB.reserve(2); |
| 2939 | for (int j = 0; j < 2; j++) |
| 2940 | { |
| 2941 | mPostCCDPass.pushBack(Cm::DelegateTask<Sc::Scene, &Sc::Scene::postCCDPass>(getContextId(), this, "ScScene.postCCDPass")); |
| 2942 | mUpdateCCDSinglePass.pushBack(Cm::DelegateTask<Sc::Scene, &Sc::Scene::updateCCDSinglePass>(getContextId(), this, "ScScene.updateCCDSinglePass")); |
| 2943 | mUpdateCCDSinglePass2.pushBack(Cm::DelegateTask<Sc::Scene, &Sc::Scene::updateCCDSinglePassStage2>(getContextId(), this, "ScScene.updateCCDSinglePassStage2")); |
| 2944 | mUpdateCCDSinglePass3.pushBack(Cm::DelegateTask<Sc::Scene, &Sc::Scene::updateCCDSinglePassStage3>(getContextId(), this, "ScScene.updateCCDSinglePassStage3")); |
| 2945 | mCCDBroadPhase.pushBack(Cm::DelegateTask<Sc::Scene, &Sc::Scene::ccdBroadPhase>(getContextId(), this, "ScScene.ccdBroadPhase")); |
| 2946 | mCCDBroadPhaseAABB.pushBack(Cm::DelegateTask<Sc::Scene, &Sc::Scene::ccdBroadPhaseAABB>(getContextId(), this, "ScScene.ccdBroadPhaseAABB")); |
| 2947 | } |
| 2948 | } |
| 2949 | |
| 2950 | //reset thread context in a place we know all tasks possibly accessing it, are in sync with. (see US6664) |
| 2951 | mLLContext->resetThreadContexts(); |
| 2952 | |
| 2953 | mCCDContext->updateCCDBegin(); |
| 2954 | |
| 2955 | mCCDBroadPhase[0].setContinuation(parentContinuation); |
| 2956 | mCCDBroadPhaseAABB[0].setContinuation(&mCCDBroadPhase[0]); |
| 2957 | mCCDBroadPhase[0].removeReference(); |
| 2958 | mCCDBroadPhaseAABB[0].removeReference(); |
| 2959 | } |
| 2960 | } |
| 2961 | |
| 2962 | class UpdateCCDBoundsTask : public Cm::Task |
| 2963 | { |
nothing calls this directly
no test coverage detected