mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-18 19:29:09 +00:00
Use standard (f)abs functions
This commit is contained in:
@ -622,7 +622,7 @@ float QuatAngleDiff(const hsQuat &a, const hsQuat &b)
|
||||
|
||||
// Calling acos on 1.0 is returning an undefined value. Need to check for it.
|
||||
float epsilon = 0.00001;
|
||||
if (hsABS(cos_t - 1.f) < epsilon)
|
||||
if (fabs(cos_t - 1.f) < epsilon)
|
||||
return 0;
|
||||
|
||||
theta = acos(cos_t);
|
||||
|
@ -284,7 +284,7 @@ void plAnimatedMovementStrategy::RecalcVelocity(double timeNow, float elapsed, b
|
||||
|
||||
// Update controller rotation
|
||||
float zRot = fAnimAngularVel + fTurnStr;
|
||||
if (hsABS(zRot) > 0.0001f)
|
||||
if (fabs(zRot) > 0.0001f)
|
||||
fController->IncrementAngle(zRot * elapsed);
|
||||
|
||||
// Update controller velocity
|
||||
@ -396,7 +396,7 @@ void plWalkingStrategy::Apply(float delSecs)
|
||||
hsVector3 achievedVelocity = fController->GetAchievedLinearVelocity();
|
||||
|
||||
// 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
|
||||
// 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);
|
||||
fCurrentRegion->GetCurrent(fController, linCurrent, angCurrent, delSecs);
|
||||
|
||||
if (hsABS(angCurrent) > 0.0001f)
|
||||
if (fabs(angCurrent) > 0.0001f)
|
||||
fController->IncrementAngle(angCurrent * delSecs);
|
||||
|
||||
velocity += linCurrent;
|
||||
@ -710,7 +710,7 @@ void plDynamicWalkingStrategy::Apply(float delSecs)
|
||||
hsVector3 achievedVelocity = fController->GetAchievedLinearVelocity();
|
||||
|
||||
// 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
|
||||
// the largest, so we won't launch into the air if we're running uphill.
|
||||
|
Reference in New Issue
Block a user