diff --git a/libraries/avatars/src/AvatarData.cpp b/libraries/avatars/src/AvatarData.cpp index a74bcaf189..52a2849ac4 100644 --- a/libraries/avatars/src/AvatarData.cpp +++ b/libraries/avatars/src/AvatarData.cpp @@ -68,10 +68,10 @@ AvatarData::AvatarData() : _errorLogExpiry(0), _owningAvatarMixer(), _targetVelocity(0.0f), - _smoothOrientationTime(SMOOTH_TIME_ORIENTATION), - _smoothOrientationTimer(std::numeric_limits::max()), - _smoothOrientationInitial(), - _smoothOrientationTarget() + _smoothOrientationTime(SMOOTH_TIME_ORIENTATION), + _smoothOrientationTimer(std::numeric_limits::max()), + _smoothOrientationInitial(), + _smoothOrientationTarget() { setBodyPitch(0.0f); setBodyYaw(-90.0f); @@ -1496,14 +1496,14 @@ void AvatarData::parseAvatarIdentityPacket(const QByteArray& data, Identity& ide } glm::quat AvatarData::getLocalOrientation() const { - if (!isMyAvatar() || (_smoothOrientationTimer > _smoothOrientationTime)) { - return (SpatiallyNestable::getLocalOrientation()); - } + if (!isMyAvatar() || (_smoothOrientationTimer > _smoothOrientationTime)) { + return (SpatiallyNestable::getLocalOrientation()); + } - // Smooth the remote avatar movement. - float t = _smoothOrientationTimer / _smoothOrientationTime; - float l = easeInOutQuad(glm::clamp(t, 0.0f, 1.0f)); - return (slerp(_smoothOrientationInitial, _smoothOrientationTarget, l)); + // Smooth the remote avatar movement. + float t = _smoothOrientationTimer / _smoothOrientationTime; + float l = easeInOutQuad(glm::clamp(t, 0.0f, 1.0f)); + return (slerp(_smoothOrientationInitial, _smoothOrientationTarget, l)); } static const QUrl emptyURL(""); diff --git a/libraries/avatars/src/AvatarData.h b/libraries/avatars/src/AvatarData.h index a18af4ea38..278d150259 100644 --- a/libraries/avatars/src/AvatarData.h +++ b/libraries/avatars/src/AvatarData.h @@ -602,10 +602,10 @@ public: return _lastSentJointData; } - // Overload the local orientation function for this. - virtual glm::quat getLocalOrientation() const override; + // Overload the local orientation function for this. + virtual glm::quat getLocalOrientation() const override; - static const float OUT_OF_VIEW_PENALTY; + static const float OUT_OF_VIEW_PENALTY; static void sortAvatars( QList avatarList, @@ -621,18 +621,18 @@ public: static float _avatarSortCoefficientCenter; static float _avatarSortCoefficientAge; - // Basic ease-in-ease-out function for smoothing values. - static inline float easeInOutQuad(float lerpValue) { - assert(!((lerpValue < 0.0f) || (lerpValue > 1.0f))); + // Basic ease-in-ease-out function for smoothing values. + static inline float easeInOutQuad(float lerpValue) { + assert(!((lerpValue < 0.0f) || (lerpValue > 1.0f))); - if (lerpValue < 0.5f) { - return (2.0f * lerpValue * lerpValue); - } + if (lerpValue < 0.5f) { + return (2.0f * lerpValue * lerpValue); + } - return (lerpValue*(4.0f - 2.0f * lerpValue) - 1.0f); - } + return (lerpValue*(4.0f - 2.0f * lerpValue) - 1.0f); + } - bool getIdentityDataChanged() const { return _identityDataChanged; } // has the identity data changed since the last time sendIdentityPacket() was called + bool getIdentityDataChanged() const { return _identityDataChanged; } // has the identity data changed since the last time sendIdentityPacket() was called void markIdentityDataChanged() { _identityDataChanged = true; _identityUpdatedAt = usecTimestampNow(); @@ -795,16 +795,16 @@ protected: quint64 _audioLoudnessChanged { 0 }; float _audioAverageLoudness { 0.0f }; - // Smoothing. - const float SMOOTH_TIME_ORIENTATION = 0.15f; + // Smoothing. + const float SMOOTH_TIME_ORIENTATION = 0.15f; - // Smoothing data for blending from one position/orientation to another on remote agents. - float _smoothOrientationTime; - float _smoothOrientationTimer; - glm::quat _smoothOrientationInitial; - glm::quat _smoothOrientationTarget; + // Smoothing data for blending from one position/orientation to another on remote agents. + float _smoothOrientationTime; + float _smoothOrientationTimer; + glm::quat _smoothOrientationInitial; + glm::quat _smoothOrientationTarget; - bool _identityDataChanged { false }; + bool _identityDataChanged { false }; quint64 _identityUpdatedAt { 0 }; private: