diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2024-10-13 08:45:37 +0300 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2024-10-13 08:45:37 +0300 |
commit | 1da6053cdef9828bcb4f75e21cd655edc15e3c4e (patch) | |
tree | 4a65471a738bb6fa51fb7e99e5e0c6ba77701f1b /indra/newview/llagentcamera.cpp | |
parent | eceab67f0ea4edac07d0faf87d28a725a9d69084 (diff) | |
parent | f32a6d40aa47c887d0c98a937a37dfa4d6893768 (diff) |
Merge commit 'f32a6d40aa' into marchcat/c-develop
# Conflicts:
# indra/llmath/v2math.cpp
# indra/llmath/v2math.h
# indra/llmath/v3math.h
# indra/llmath/v4math.h
# indra/newview/llagent.cpp
# indra/newview/llagentcamera.h
# indra/newview/llfloaternamedesc.cpp
# indra/newview/llfloaternamedesc.h
# indra/newview/llinventorybridge.cpp
# indra/newview/llmaterialeditor.cpp
# indra/newview/llreflectionmap.cpp
# indra/newview/llviewerassetupload.cpp
# indra/newview/llviewercamera.cpp
# indra/newview/llviewercamera.h
# indra/newview/llviewermenufile.cpp
# indra/newview/llviewerobject.h
# indra/newview/llvovolume.h
Diffstat (limited to 'indra/newview/llagentcamera.cpp')
-rw-r--r-- | indra/newview/llagentcamera.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index d4767e18af..339656089c 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -1462,13 +1462,12 @@ void LLAgentCamera::updateCamera() // LL_INFOS() << "Current FOV Zoom: " << mCameraCurrentFOVZoomFactor << " Target FOV Zoom: " << mCameraFOVZoomFactor << " Object penetration: " << mFocusObjectDist << LL_ENDL; LLVector3 focus_agent = gAgent.getPosAgentFromGlobal(mFocusGlobal); + LLVector3 position_agent = gAgent.getPosAgentFromGlobal(camera_pos_global); - mCameraPositionAgent = gAgent.getPosAgentFromGlobal(camera_pos_global); + // Try to move the camera - // Move the camera - - LLViewerCamera::getInstance()->updateCameraLocation(mCameraPositionAgent, mCameraUpVector, focus_agent); - //LLViewerCamera::getInstance()->updateCameraLocation(mCameraPositionAgent, camera_skyward, focus_agent); + if (!LLViewerCamera::getInstance()->updateCameraLocation(position_agent, mCameraUpVector, focus_agent)) + return; // Change FOV LLViewerCamera::getInstance()->setView(LLViewerCamera::getInstance()->getDefaultFOV() / (1.f + mCameraCurrentFOVZoomFactor)); @@ -1476,7 +1475,7 @@ void LLAgentCamera::updateCamera() // follow camera when in customize mode if (cameraCustomizeAvatar()) { - setLookAt(LOOKAT_TARGET_FOCUS, NULL, mCameraPositionAgent); + setLookAt(LOOKAT_TARGET_FOCUS, NULL, position_agent); } // update the travel distance stat @@ -1495,8 +1494,8 @@ void LLAgentCamera::updateCamera() LLVector3 head_pos = gAgentAvatarp->mHeadp->getWorldPosition() + LLVector3(0.08f, 0.f, 0.05f) * gAgentAvatarp->mHeadp->getWorldRotation() + LLVector3(0.1f, 0.f, 0.f) * gAgentAvatarp->mPelvisp->getWorldRotation(); - LLVector3 diff = mCameraPositionAgent - head_pos; - diff = diff * ~gAgentAvatarp->mRoot->getWorldRotation(); + LLVector3 diff = position_agent - head_pos; + diff *= ~gAgentAvatarp->mRoot->getWorldRotation(); LLJoint* torso_joint = gAgentAvatarp->mTorsop; LLJoint* chest_joint = gAgentAvatarp->mChestp; @@ -2256,7 +2255,8 @@ void LLAgentCamera::changeCameraToFollow(bool animate) mCameraMode = CAMERA_MODE_FOLLOW; // bang-in the current focus, position, and up vector of the follow cam - mFollowCam.reset(mCameraPositionAgent, LLViewerCamera::getInstance()->getPointOfInterest(), LLVector3::z_axis); + const LLViewerCamera& camera = LLViewerCamera::instance(); + mFollowCam.reset(camera.getOrigin(), camera.getPointOfInterest(), LLVector3::z_axis); if (gBasicToolset) { |