From 568f1a19b16f7febfd6ff3963f28840399aec8b5 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 15 Jan 2024 22:30:54 +0200 Subject: SL-20783 Avatar turning animation was affected by framerate --- indra/newview/llvoavatar.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index fee00eb6f4..550be30919 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -4283,6 +4283,15 @@ void LLVOAvatar::updateOrientation(LLAgent& agent, F32 speed, F32 delta_time) if (mTurning) { pelvis_rot_threshold *= 0.4f; + // account for fps, assume that above value is for ~60fps + constexpr F32 default_frame_sec = 0.016f; + F32 prev_frame_sec = LLFrameTimer::getFrameDeltaTimeF32(); + if (default_frame_sec > prev_frame_sec) + { + // reduce threshold since turn rate per second is constant, + // shorter frame means shorter turn. + pelvis_rot_threshold *= prev_frame_sec/default_frame_sec; + } } // am I done turning? -- cgit v1.2.3