From b907f8978ab96eed95d55ef930ad5cbede45bc5c Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Sat, 11 Feb 2012 01:08:47 -0500 Subject: [PATCH] Fix landing behaviors Looks like Cyan broke these when they fixed superjumps. It appears that LinearVelocity is only good while the PhysicalControllerCore is updating, and it stashes the result for later so nothing else can touch it. Regardless, we need to test AchievedLinearVelocity outside of the update proc. --- Sources/Plasma/PubUtilLib/plAvatar/plAvCallbackAction.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvCallbackAction.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvCallbackAction.cpp index c59b5f4f..235c3450 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvCallbackAction.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvCallbackAction.cpp @@ -133,8 +133,10 @@ void plWalkingController::RecalcVelocity(double timeNow, double timePrev, hsBool if (fController && !fWalkingStrategy->IsOnGround()) { + // PhysX Hack: AchievedLinearVelocity is a Cyanic fix for superjumps. LinearVelocity is + // always (0,0,0) outside of the controller update proc fImpactTime = fWalkingStrategy->GetAirTime(); - fImpactVelocity = fController->GetLinearVelocity(); + fImpactVelocity = fController->GetAchievedLinearVelocity(); fClearImpact = false; } else