summaryrefslogtreecommitdiff
path: root/indra/newview/llagentcamera.cpp
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2020-04-20 14:27:22 +0300
committerMnikolenko Productengine <mnikolenko@productengine.com>2020-04-20 14:27:22 +0300
commit74d6e6b65c9c3e85e8ec84939b35a1e584379e1f (patch)
tree594978c1282ff02e37525b6f94f310d4299a1583 /indra/newview/llagentcamera.cpp
parent70d340a1bff2707138ac41fdd1408a5b2e46fc71 (diff)
SL-12904 FIXED Camera Preset does not restore correctly when sitting
Diffstat (limited to 'indra/newview/llagentcamera.cpp')
-rw-r--r--indra/newview/llagentcamera.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp
index 5efd614b22..7a82cf2f66 100644
--- a/indra/newview/llagentcamera.cpp
+++ b/indra/newview/llagentcamera.cpp
@@ -1804,8 +1804,8 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit)
at_axis.mV[VZ] = 0.f;
at_axis.normalize();
gAgent.resetAxes(at_axis * ~parent_rot);
-
- local_camera_offset = local_camera_offset * parent_rot;
+
+ local_camera_offset = local_camera_offset * gAgent.getFrameAgent().getQuaternion() * parent_rot;
}
else
{
@@ -1998,7 +1998,10 @@ LLVector3d LLAgentCamera::getCurrentFocusOffset()
LLQuaternion LLAgentCamera::getCurrentAvatarRotation()
{
LLViewerObject* sit_object = (LLViewerObject*)gAgentAvatarp->getParent();
- return sit_object ? sit_object->getRenderRotation() : gAgent.getFrameAgent().getQuaternion();
+
+ LLQuaternion av_rot = gAgent.getFrameAgent().getQuaternion();
+ LLQuaternion obj_rot = sit_object ? sit_object->getRenderRotation() : LLQuaternion::DEFAULT;
+ return av_rot * obj_rot;
}
bool LLAgentCamera::isJoystickCameraUsed()
@@ -2828,6 +2831,12 @@ BOOL LLAgentCamera::setPointAt(EPointAtType target_type, LLViewerObject *object,
return mPointAt->setPointAt(target_type, object, position);
}
+void LLAgentCamera::rotateToInitSitRot()
+{
+ gAgent.rotate(~gAgent.getFrameAgent().getQuaternion());
+ gAgent.rotate(mInitSitRot);
+}
+
void LLAgentCamera::resetCameraZoomFraction()
{
mCameraZoomFraction = INITIAL_ZOOM_FRACTION;