X-Git-Url: https://git.jsancho.org/?p=lugaru.git;a=blobdiff_plain;f=Source%2FAnimation%2FMuscle.cpp;h=ab94d3c449caf7722bcebae2bbda8699ed751d81;hp=da43de4f02bb5258513ce1bb8f465eadd2d821f1;hb=b9a46d8e2b7e7e22c706e7dd3734f31015db4408;hpb=8b6e8f3ad7390309795eb35c0959264cb7924402 diff --git a/Source/Animation/Muscle.cpp b/Source/Animation/Muscle.cpp index da43de4..ab94d3c 100644 --- a/Source/Animation/Muscle.cpp +++ b/Source/Animation/Muscle.cpp @@ -135,27 +135,34 @@ void Muscle::DoConstraint(bool spinny) } // clamp strength - if (strength < 0) + if (strength < 0) { strength = 0; - if (strength > 1) + } + if (strength > 1) { strength = 1; + } length -= (length - relaxlength) * (1 - strength) * multiplier * 10000; length -= (length - targetlength) * strength * multiplier * 10000; - if (strength == 0) + if (strength == 0) { length = relaxlength; + } - if ((relaxlength - length > 0 && relaxlength - oldlength < 0) || (relaxlength - length < 0 && relaxlength - oldlength > 0)) + if ((relaxlength - length > 0 && relaxlength - oldlength < 0) || (relaxlength - length < 0 && relaxlength - oldlength > 0)) { length = relaxlength; + } // clamp length - if (length < minlength) + if (length < minlength) { length = minlength; - if (length > maxlength) + } + if (length > maxlength) { length = maxlength; + } - if (length == relaxlength) + if (length == relaxlength) { return; + } // relax muscle?