diff options
| author | Sheikh Dawood <[email protected]> | 2018-08-13 13:37:04 -0500 |
|---|---|---|
| committer | Sheikh Dawood <[email protected]> | 2018-08-13 13:37:04 -0500 |
| commit | 3f9977d72f8a481e76b6ad643a3d312a8cf9b551 (patch) | |
| tree | 8dfa563cf2a06498b56b055af133bd066f1f349c /PhysX_3.4/Source/SimulationController/src | |
| parent | PhysX 3.4, APEX 1.4 patch release @24214033 (diff) | |
| download | physx-3.4-3f9977d72f8a481e76b6ad643a3d312a8cf9b551.tar.xz physx-3.4-3f9977d72f8a481e76b6ad643a3d312a8cf9b551.zip | |
PhysX 3.4, APEX 1.4 patch release @24698370
Diffstat (limited to 'PhysX_3.4/Source/SimulationController/src')
3 files changed, 36 insertions, 18 deletions
diff --git a/PhysX_3.4/Source/SimulationController/src/ScScene.cpp b/PhysX_3.4/Source/SimulationController/src/ScScene.cpp index 1cc84a0d..702be637 100644 --- a/PhysX_3.4/Source/SimulationController/src/ScScene.cpp +++ b/PhysX_3.4/Source/SimulationController/src/ScScene.cpp @@ -630,6 +630,7 @@ Sc::Scene::Scene(const PxSceneDesc& desc, PxU64 contextID) : mRigidBodyNarrowPhase (contextID, this, "ScScene.rigidBodyNarrowPhase"), mRigidBodyNPhaseUnlock (contextID, this, "ScScene.unblockNarrowPhase"), mPostBroadPhase (contextID, this, "ScScene.postBroadPhase"), + mPostBroadPhaseCont (contextID, this, "ScScene.postBroadPhaseCont"), mPostBroadPhase2 (contextID, this, "ScScene.postBroadPhase2"), mPostBroadPhase3 (contextID, this, "ScScene.postBroadPhase3"), mPreallocateContactManagers (contextID, this, "ScScene.preallocateContactManagers"), @@ -703,7 +704,7 @@ Sc::Scene::Scene(const PxSceneDesc& desc, PxU64 contextID) : useGpuDynamics = false; } - if (desc.broadPhaseType & PxBroadPhaseType::eGPU) + if (desc.broadPhaseType == PxBroadPhaseType::eGPU) { useGpuBroadphase = true; if (mTaskManager->getGpuDispatcher() == NULL) @@ -2076,17 +2077,6 @@ void Sc::Scene::advanceStep(PxBaseTask* continuation) // } //} -/*-------------------------------*\ -| For generating a task graph of the runtime task -| execution have a look at the DOT_LOG define and -| https://wiki.nvidia.com/engwiki/index.php/PhysX/sdk/InternalDoc_Example_TaskGraph -| -| A method for understanding the code used to schedule tasks -| is to read from the bottom to the top. -| Functions like Task& taskA = scheduleTask(taskB, taskC) -| can be read as "taskB and taskC depend on taskA" -\*-------------------------------*/ - void Sc::Scene::collideStep(PxBaseTask* continuation) { PX_PROFILE_ZONE("Sim.collideQueueTasks", getContextId()); @@ -2149,14 +2139,18 @@ void Sc::Scene::postBroadPhase(PxBaseTask* continuation) //Notify narrow phase that broad phase has completed mLLContext->getNphaseImplementationContext()->postBroadPhaseUpdateContactManager(); - mAABBManager->postBroadPhase(continuation, &mRigidBodyNPhaseUnlock); + mAABBManager->postBroadPhase(continuation, &mRigidBodyNPhaseUnlock, *getFlushPool()); + +} +void Sc::Scene::postBroadPhaseContinuation(PxBaseTask* continuation) +{ mAABBManager->getChangedAABBMgActorHandleMap().clear(); - + // - Finishes broadphase update // - Adds new interactions (and thereby contact managers if needed) - finishBroadPhase(0, continuation); -} + finishBroadPhase(0, continuation); +} void Sc::Scene::postBroadPhaseStage2(PxBaseTask* continuation) { @@ -2417,7 +2411,8 @@ void Sc::Scene::rigidBodyNarrowPhase(PxBaseTask* continuation) mPostBroadPhase3.addDependent(*continuation); mPostBroadPhase2.setContinuation(&mPostBroadPhase3); - mPostBroadPhase.setContinuation(&mPostBroadPhase2); + mPostBroadPhaseCont.setContinuation(&mPostBroadPhase2); + mPostBroadPhase.setContinuation(&mPostBroadPhaseCont); mBroadPhase.setContinuation(&mPostBroadPhase); mRigidBodyNPhaseUnlock.setContinuation(continuation); mRigidBodyNPhaseUnlock.addReference(); @@ -2456,6 +2451,7 @@ void Sc::Scene::rigidBodyNarrowPhase(PxBaseTask* continuation) mPostBroadPhase3.removeReference(); mPostBroadPhase2.removeReference(); + mPostBroadPhaseCont.removeReference(); mPostBroadPhase.removeReference(); mBroadPhase.removeReference(); } @@ -3304,7 +3300,7 @@ void Sc::Scene::updateCCDSinglePass(PxBaseTask* continuation) PX_PROFILE_ZONE("Sim.updateCCDSinglePass", getContextId()); mReportShapePairTimeStamp++; // This will makes sure that new report pairs will get created instead of re-using the existing ones. - mAABBManager->postBroadPhase(continuation, NULL); + mAABBManager->postBroadPhase(NULL, NULL, *getFlushPool()); const PxU32 currentPass = mCCDContext->getCurrentCCDPass() + 1; // 0 is reserved for discrete collision phase finishBroadPhase(currentPass, continuation); @@ -6339,6 +6335,9 @@ public: Sc::ElementSim* e0 = reinterpret_cast<Sc::ElementSim*>(pair.mUserData0); Sc::ElementSim* e1 = reinterpret_cast<Sc::ElementSim*>(pair.mUserData1); + PX_ASSERT(e0 != NULL); + PX_ASSERT(e1 != NULL); + const PxFilterInfo finfo = mNPhaseCore->onOverlapFilter(e0, e1); mFinfo[a] = finfo; diff --git a/PhysX_3.4/Source/SimulationController/src/ScShapeInteraction.cpp b/PhysX_3.4/Source/SimulationController/src/ScShapeInteraction.cpp index 6ee9218d..edea6734 100644 --- a/PhysX_3.4/Source/SimulationController/src/ScShapeInteraction.cpp +++ b/PhysX_3.4/Source/SimulationController/src/ScShapeInteraction.cpp @@ -844,6 +844,23 @@ void Sc::ShapeInteraction::updateState(const PxU8 externalDirtyFlags) mManager->setDominance1(cdom.dominance1); } + if (dirtyFlags & InteractionDirtyFlag::eBODY_KINEMATIC) + { + //Kinematic flags changed - clear flag for kinematic on the pair + Sc::BodySim* bs1 = shapeSim1.getBodySim(); + if (bs1 != NULL) + { + if (bs1->isKinematic()) + { + mManager->getWorkUnit().flags |= PxcNpWorkUnitFlag::eHAS_KINEMATIC_ACTOR; + } + else + { + mManager->getWorkUnit().flags &= (~PxcNpWorkUnitFlag::eHAS_KINEMATIC_ACTOR); + } + } + } + // Update skin width if (dirtyFlags & InteractionDirtyFlag::eREST_OFFSET) { diff --git a/PhysX_3.4/Source/SimulationController/src/ScShapeSim.cpp b/PhysX_3.4/Source/SimulationController/src/ScShapeSim.cpp index d4e10a93..8b07c702 100644 --- a/PhysX_3.4/Source/SimulationController/src/ScShapeSim.cpp +++ b/PhysX_3.4/Source/SimulationController/src/ScShapeSim.cpp @@ -449,6 +449,8 @@ void ShapeSim::updateBPGroup() { Sc::Scene& scene = getScene(); scene.getAABBManager()->setBPGroup(getElementID(), getBPGroup()); + + //reinsertBroadPhase(); } } |