|
|
@ -284,7 +284,7 @@ void plAnimatedMovementStrategy::RecalcVelocity(double timeNow, float elapsed, b |
|
|
|
|
|
|
|
|
|
|
|
// Update controller rotation
|
|
|
|
// Update controller rotation
|
|
|
|
float zRot = fAnimAngularVel + fTurnStr; |
|
|
|
float zRot = fAnimAngularVel + fTurnStr; |
|
|
|
if (hsABS(zRot) > 0.0001f) |
|
|
|
if (fabs(zRot) > 0.0001f) |
|
|
|
fController->IncrementAngle(zRot * elapsed); |
|
|
|
fController->IncrementAngle(zRot * elapsed); |
|
|
|
|
|
|
|
|
|
|
|
// Update controller velocity
|
|
|
|
// Update controller velocity
|
|
|
@ -396,7 +396,7 @@ void plWalkingStrategy::Apply(float delSecs) |
|
|
|
hsVector3 achievedVelocity = fController->GetAchievedLinearVelocity(); |
|
|
|
hsVector3 achievedVelocity = fController->GetAchievedLinearVelocity(); |
|
|
|
|
|
|
|
|
|
|
|
// Add in gravity if the avatar's z velocity isn't being set explicitly
|
|
|
|
// Add in gravity if the avatar's z velocity isn't being set explicitly
|
|
|
|
if (hsABS(velocity.fZ) < 0.001f) |
|
|
|
if (fabs(velocity.fZ) < 0.001f) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Get our previous z velocity. If we're on the ground, clamp it to zero at
|
|
|
|
// Get our previous z velocity. If we're on the ground, clamp it to zero at
|
|
|
|
// the largest, so we won't launch into the air if we're running uphill.
|
|
|
|
// the largest, so we won't launch into the air if we're running uphill.
|
|
|
@ -625,7 +625,7 @@ void plSwimStrategy::Apply(float delSecs) |
|
|
|
hsVector3 linCurrent(0.0f, 0.0f, 0.0f); |
|
|
|
hsVector3 linCurrent(0.0f, 0.0f, 0.0f); |
|
|
|
fCurrentRegion->GetCurrent(fController, linCurrent, angCurrent, delSecs); |
|
|
|
fCurrentRegion->GetCurrent(fController, linCurrent, angCurrent, delSecs); |
|
|
|
|
|
|
|
|
|
|
|
if (hsABS(angCurrent) > 0.0001f) |
|
|
|
if (fabs(angCurrent) > 0.0001f) |
|
|
|
fController->IncrementAngle(angCurrent * delSecs); |
|
|
|
fController->IncrementAngle(angCurrent * delSecs); |
|
|
|
|
|
|
|
|
|
|
|
velocity += linCurrent; |
|
|
|
velocity += linCurrent; |
|
|
@ -710,7 +710,7 @@ void plDynamicWalkingStrategy::Apply(float delSecs) |
|
|
|
hsVector3 achievedVelocity = fController->GetAchievedLinearVelocity(); |
|
|
|
hsVector3 achievedVelocity = fController->GetAchievedLinearVelocity(); |
|
|
|
|
|
|
|
|
|
|
|
// Add in gravity if the avatar's z velocity isn't being set explicitly
|
|
|
|
// Add in gravity if the avatar's z velocity isn't being set explicitly
|
|
|
|
if (hsABS(velocity.fZ) < 0.001f) |
|
|
|
if (fabs(velocity.fZ) < 0.001f) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Get our previous z velocity. If we're on the ground, clamp it to zero at
|
|
|
|
// Get our previous z velocity. If we're on the ground, clamp it to zero at
|
|
|
|
// the largest, so we won't launch into the air if we're running uphill.
|
|
|
|
// the largest, so we won't launch into the air if we're running uphill.
|
|
|
|