From 8a3fe4d9e4dd5e3092bf55664c0435315690d1f0 Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Fri, 26 Mar 2010 17:47:12 -0700 Subject: Fix for EXT-6573 (Mouse-steering doesn't work in third person view) LLAgentCamera::cameraOrbitAround() (which had been created from LLAgent:: cameraOrbitAround() when LLAgentCamera was factored out) wasn't correctly processing yaw. Specifically, since gAgent.getFrameAgent() returns by value and not reference, gAgent.getFrameAgent().rotate() was discarding the result of the rotation. Changed LLAgentCamera::cameraOrbitAround() to use gAgent.yaw() instead, and changed LLAgent::getFrameAgent() to return a const reference instead of a value, which should make the compiler catch errors like this. Reviewed by Richard in http://codereview.lindenlab.com/1153001 --- indra/newview/llagent.h | 2 +- indra/newview/llagentcamera.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 891ce799d2..b59a49be13 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -217,7 +217,7 @@ public: // Coordinate System //-------------------------------------------------------------------- public: - LLCoordFrame getFrameAgent() const { return mFrameAgent; } + const LLCoordFrame& getFrameAgent() const { return mFrameAgent; } void initOriginGlobal(const LLVector3d &origin_global); // Only to be used in ONE place void resetAxes(); void resetAxes(const LLVector3 &look_at); // Makes reasonable left and up diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index e000d44ab8..8eee53363e 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -852,7 +852,7 @@ void LLAgentCamera::cameraOrbitAround(const F32 radians) } else if (mFocusOnAvatar && (mCameraMode == CAMERA_MODE_THIRD_PERSON || mCameraMode == CAMERA_MODE_FOLLOW)) { - gAgent.getFrameAgent().rotate(radians, gAgent.getReferenceUpVector()); + gAgent.yaw(radians); } else { -- cgit v1.2.3