mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-07 23:02:24 +02:00
Move magic number to constant for SLOW_SPEED_THRESHOLD.
This commit is contained in:
parent
a043f0a17e
commit
0510215240
1 changed files with 2 additions and 1 deletions
|
@ -1435,11 +1435,12 @@ void Rig::computeMotionAnimationState(float deltaTime, const glm::vec3& worldPos
|
|||
|
||||
//stategraph vars based on input
|
||||
const float INPUT_DEADZONE_THRESHOLD = 0.05f;
|
||||
const float SLOW_SPEED_THRESHOLD = 1.5f;
|
||||
|
||||
if (fabsf(_previousControllerParameters.inputX) <= INPUT_DEADZONE_THRESHOLD &&
|
||||
fabsf(_previousControllerParameters.inputZ) <= INPUT_DEADZONE_THRESHOLD) {
|
||||
// no WASD input
|
||||
if (fabsf(forwardSpeed) <= 1.5f && fabsf(lateralSpeed) <= 1.5f) {
|
||||
if (fabsf(forwardSpeed) <= SLOW_SPEED_THRESHOLD && fabsf(lateralSpeed) <= SLOW_SPEED_THRESHOLD) {
|
||||
_animVars.set("isInputForward", false);
|
||||
_animVars.set("isInputBackward", false);
|
||||
_animVars.set("isInputRight", false);
|
||||
|
|
Loading…
Reference in a new issue