From 6460c9e8612f8b369b611702fcc629be2ff98f69 Mon Sep 17 00:00:00 2001 From: amantley Date: Tue, 3 Jul 2018 17:11:19 -0700 Subject: [PATCH] fixed case for 0.0 as the filter length --- interface/src/avatar/MyAvatar.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index ac85645f78..397e0fd73a 100755 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -89,6 +89,8 @@ const float MyAvatar::ZOOM_MAX = 25.0f; const float MyAvatar::ZOOM_DEFAULT = 1.5f; const float MIN_SCALE_CHANGED_DELTA = 0.001f; +//#define DEBUG_DRAW_HMD_MOVING_AVERAGE + MyAvatar::MyAvatar(QThread* thread) : Avatar(thread), _yawSpeed(YAW_SPEED_DEFAULT), @@ -414,7 +416,7 @@ void MyAvatar::reset(bool andRecenter, bool andReload, bool andHead) { void MyAvatar::update(float deltaTime) { // update moving average of HMD facing in xz plane. - const float HMD_FACING_TIMESCALE = getRotationRecenterFilterLength(); + const float HMD_FACING_TIMESCALE = getRotationRecenterFilterLength(); float tau = deltaTime / HMD_FACING_TIMESCALE; _headControllerFacingMovingAverage = lerp(_headControllerFacingMovingAverage, _headControllerFacing, tau); @@ -2176,12 +2178,15 @@ void MyAvatar::setHasAudioEnabledFaceMovement(bool hasAudioEnabledFaceMovement) } void MyAvatar::setRotationRecenterFilterLength(float length) { - _rotationRecenterFilterLength = length; + if (length > 0.01f) { + _rotationRecenterFilterLength = length; + } else { + _rotationRecenterFilterLength = 0.01f; + } } void MyAvatar::setRotationThreshold(float angleRadians) { _rotationThreshold = angleRadians; - qCDebug(interfaceapp) << "setting the rotation threshold " << _rotationThreshold; } void MyAvatar::updateOrientation(float deltaTime) {