Browse Source

Convert the impact velocity to avatar-local coordinates, because that's what {Running|Ground}Impact::PreCondition() expects.

Fixes landing animations depending on what direction relative to the age you jump rather than whether you land forward or straight down.
landing
Christian Walther 13 years ago
parent
commit
fba99c4cb1
  1. 2
      MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAvatar/plAvCallbackAction.cpp
  2. 1
      MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAvatar/plPhysicalControllerCore.h

2
MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAvatar/plAvCallbackAction.cpp

@ -137,6 +137,8 @@ void plWalkingController::RecalcVelocity(double timeNow, double timePrev, hsBool
// LinearVelocity is always (0,0,0) outside the PhysController
fImpactTime = fWalkingStrategy->GetAirTime();
fImpactVelocity = fController->GetAchievedLinearVelocity();
// convert orientation from subworld to avatar-local coordinates
fImpactVelocity = (hsVector3)fController->GetLocalRotation().Rotate(&fImpactVelocity);
fClearImpact = false;
}
else

1
MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAvatar/plPhysicalControllerCore.h

@ -147,6 +147,7 @@ public:
virtual void CheckAndHandleAnyStateChanges();
virtual void UpdateSubstepNonPhysical();
virtual const hsPoint3& GetLocalPosition()=0;
const hsQuat& GetLocalRotation() { return fLocalRotation; }
virtual void MoveActorToSim();
virtual void OverrideAchievedVelocity(hsVector3 newAchievedVel)

Loading…
Cancel
Save