mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-20 04:09:16 +00:00
Fix controlled flight bug
fControlledFlight state should be handled outside of the physics step.
This commit is contained in:
@ -503,15 +503,6 @@ void plWalkingStrategy::Update(hsScalar delSecs)
|
|||||||
fImpactVelocity = (hsVector3)fController->GetLocalRotation().Rotate(&fImpactVelocity);
|
fImpactVelocity = (hsVector3)fController->GetLocalRotation().Rotate(&fImpactVelocity);
|
||||||
fClearImpact = false;
|
fClearImpact = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fControlledFlight != 0)
|
|
||||||
{
|
|
||||||
if (IsOnGround())
|
|
||||||
fControlledFlightTime = fTimeInAir;
|
|
||||||
|
|
||||||
if (fControlledFlightTime > kControlledFlightThreshold)
|
|
||||||
EnableControlledFlight(false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void plWalkingStrategy::AddContactNormals(hsVector3& vec)
|
void plWalkingStrategy::AddContactNormals(hsVector3& vec)
|
||||||
@ -535,6 +526,20 @@ void plWalkingStrategy::Reset(bool newAge)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void plWalkingStrategy::RecalcVelocity(double timeNow, hsScalar elapsed, hsBool useAnim)
|
||||||
|
{
|
||||||
|
if (fControlledFlight != 0)
|
||||||
|
{
|
||||||
|
if (IsOnGround())
|
||||||
|
fControlledFlightTime = fTimeInAir;
|
||||||
|
|
||||||
|
if (fControlledFlightTime > kControlledFlightThreshold)
|
||||||
|
EnableControlledFlight(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
plAnimatedMovementStrategy::RecalcVelocity(timeNow, elapsed, useAnim);
|
||||||
|
}
|
||||||
|
|
||||||
bool plWalkingStrategy::EnableControlledFlight(bool status)
|
bool plWalkingStrategy::EnableControlledFlight(bool status)
|
||||||
{
|
{
|
||||||
if (status)
|
if (status)
|
||||||
|
@ -214,7 +214,7 @@ public:
|
|||||||
plAnimatedMovementStrategy(plAGApplicator* rootApp, plPhysicalControllerCore* controller);
|
plAnimatedMovementStrategy(plAGApplicator* rootApp, plPhysicalControllerCore* controller);
|
||||||
virtual ~plAnimatedMovementStrategy() { }
|
virtual ~plAnimatedMovementStrategy() { }
|
||||||
|
|
||||||
void RecalcVelocity(double timeNow, hsScalar elapsed, hsBool useAnim = true);
|
virtual void RecalcVelocity(double timeNow, hsScalar elapsed, hsBool useAnim = true);
|
||||||
void SetTurnStrength(hsScalar val) { fTurnStr = val; }
|
void SetTurnStrength(hsScalar val) { fTurnStr = val; }
|
||||||
hsScalar GetTurnStrength() const { return fTurnStr; }
|
hsScalar GetTurnStrength() const { return fTurnStr; }
|
||||||
|
|
||||||
@ -240,6 +240,8 @@ public:
|
|||||||
virtual void AddContactNormals(hsVector3& vec);
|
virtual void AddContactNormals(hsVector3& vec);
|
||||||
virtual void Reset(bool newAge);
|
virtual void Reset(bool newAge);
|
||||||
|
|
||||||
|
virtual void RecalcVelocity(double timeNow, hsScalar elapsed, hsBool useAnim = true);
|
||||||
|
|
||||||
bool HitGroundInThisAge() const { return fHitGroundInThisAge; }
|
bool HitGroundInThisAge() const { return fHitGroundInThisAge; }
|
||||||
bool IsOnGround() const { return fTimeInAir < kAirTimeThreshold || fFalseGround; }
|
bool IsOnGround() const { return fTimeInAir < kAirTimeThreshold || fFalseGround; }
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user