From 413009578e98dbd2f92cd3802aa77d4475cc1d5f Mon Sep 17 00:00:00 2001 From: leviathan Date: Thu, 3 Sep 2026 19:11:25 -0700 Subject: allow cursor mode on top of flycam --- indra/newview/llagent.cpp | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'indra/newview/llagent.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index cb521cc3db..d36df00031 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -5002,20 +5002,29 @@ static S32 g_deltaFrame { 0 }; void LLAgent::updateGameControlMode() { - // Auto-derive the active mode from avatar/camera state. Flycam takes - // precedence (it is toggled via a game-control binding), then Cursor - // mode (also an explicit toggle -- see mUsingMouseCursor/toggleMouseCursorMode()), - // then mouselook (the camera mode can be entered while sitting too, so it is + // Auto-derive the active mode from avatar/camera state. Cursor mode takes + // precedence over Flycam: toggling the mouse cursor on while Flycam is engaged + // reports CONTROL_MODE_CURSOR (so the left stick drives the on-screen cursor) + // while mUsingFlycam stays true underneath -- LLAgent::updateFlycam() keeps + // driving the camera every frame regardless of the reported mode (it is gated + // on mUsingFlycam directly, not on AgentControlMode), and + // LLGameControl::setFlycamEngaged() below tells the input-mapping lookup to + // let Flycam's own axis/button config (Pan/Tilt/Boom/...) keep driving + // whatever physical inputs Cursor mode's own mouse-cursor actions don't claim. + // This is how a single Cursor mode ends up with two flavors -- "other axes" + // control the avatar/camera depending on whether Flycam is concurrently + // engaged -- without needing a distinct mode of its own. + // Next: mouselook (the camera mode can be entered while sitting too, so it is // checked ahead of Captive), then sitting/controls-taken maps to Captive, // otherwise the normal Avatar mode. LLGameControl::AgentControlMode mode; - if (mUsingFlycam) + if (mUsingMouseCursor) { - mode = LLGameControl::CONTROL_MODE_FLYCAM; + mode = LLGameControl::CONTROL_MODE_CURSOR; } - else if (mUsingMouseCursor) + else if (mUsingFlycam) { - mode = LLGameControl::CONTROL_MODE_CURSOR; + mode = LLGameControl::CONTROL_MODE_FLYCAM; } else if (gAgentCamera.cameraMouselook()) { @@ -5029,6 +5038,7 @@ void LLAgent::updateGameControlMode() { mode = LLGameControl::CONTROL_MODE_AVATAR; } + LLGameControl::setFlycamEngaged(mUsingFlycam); LLGameControl::setAgentControlMode(mode); } -- cgit v1.3