From 390597c3bd532b29b4dfb4fb63cae9ac71bdbed9 Mon Sep 17 00:00:00 2001 From: Hadet Date: Sat, 30 May 2026 16:51:33 -0500 Subject: Smooth OTS entry transition and instant exit matching mouselook --- indra/newview/llagentcamera.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index 80dfeac2d2..6f9f8bfa2a 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -2297,6 +2297,14 @@ void LLAgentCamera::changeCameraToOTS() { gAgentAvatarp->updateAttachmentVisibility(CAMERA_MODE_THIRD_PERSON); } + + // Start the camera animation LAST, after mCameraMode is OTS and after + // changeCameraToMouselook(false) has cleared mCameraAnimating via its + // animate=false branch. The rendered camera is still at the old + // (third-person) position this frame, so startCameraAnimation snapshots + // that as the start point and updateCamera lerps to the OTS shoulder + // target over ZoomTime seconds — matching the mouselook transition feel. + startCameraAnimation(); } } @@ -2406,7 +2414,7 @@ void LLAgentCamera::changeCameraToThirdPerson(bool animate) } mCameraLag.clearVec(); - if (mCameraMode == CAMERA_MODE_MOUSELOOK) + if (mCameraMode == CAMERA_MODE_MOUSELOOK || mCameraMode == CAMERA_MODE_OTS) { mCurrentCameraDistance = MIN_CAMERA_DISTANCE; mTargetCameraDistance = MIN_CAMERA_DISTANCE; -- cgit v1.3