From 057566416bd7cb2aebced0b8eeb2cfeb48381819 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Mon, 9 May 2011 15:30:27 -0400 Subject: [PATCH] Fix for animated detector regions not actually animating (cleft bucket cloth, Er'cana harvester ladder) --- Sources/Plasma/PubUtilLib/plPhysX/plPXPhysical.cpp | 8 +++++--- .../PubUtilLib/plPhysX/plPXPhysicalControllerCore.cpp | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plPhysX/plPXPhysical.cpp b/Sources/Plasma/PubUtilLib/plPhysX/plPXPhysical.cpp index 9b0221c6..4a0d6ceb 100644 --- a/Sources/Plasma/PubUtilLib/plPhysX/plPXPhysical.cpp +++ b/Sources/Plasma/PubUtilLib/plPhysX/plPXPhysical.cpp @@ -837,10 +837,12 @@ void plPXPhysical::ISetTransformGlobal(const hsMatrix44& l2w) } } - if (GetProperty(plSimulationInterface::kPhysAnim)) - { hsAssert(fActor->readBodyFlag(NX_BF_KINEMATIC),"This Should be kinematic"); + // This used to check for the kPhysAnim flag, however animated detectors + // are also kinematic but not kPhysAnim, therefore, this would break on PhysX + // SDKs (yes, I'm looking at you, 2.6.4) that actually obey the ***GlobalPose + // rules set forth in the SDK documentation. + if (fActor->readBodyFlag(NX_BF_KINEMATIC)) fActor->moveGlobalPose(mat); - } else fActor->setGlobalPose(mat); } diff --git a/Sources/Plasma/PubUtilLib/plPhysX/plPXPhysicalControllerCore.cpp b/Sources/Plasma/PubUtilLib/plPhysX/plPXPhysicalControllerCore.cpp index 2a091e88..9ea60604 100644 --- a/Sources/Plasma/PubUtilLib/plPhysX/plPXPhysicalControllerCore.cpp +++ b/Sources/Plasma/PubUtilLib/plPhysX/plPXPhysicalControllerCore.cpp @@ -951,7 +951,7 @@ void plPXPhysicalControllerCore::HandleEnableChanged() // PHYSX FIXME - after re-enabling check to see if we are inside any convex hull detector regions hsPoint3 pos; IGetPositionSim(pos); - plSimulationMgr::GetInstance()->UpdateDetectorsInScene(fWorldKey,GetOwner(),pos,fEnable); + plSimulationMgr::GetInstance()->UpdateDetectorsInScene(fWorldKey,GetOwner(),pos,fEnabled); #endif // USE_PHYSX_CONVEXHULL_WORKAROUND //IInformDetectors(true); }