summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermediafocus.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2020-09-28 22:24:12 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2020-09-28 22:24:12 +0300
commit32cb17e3bb86e1d3e7b945f49aa39df7868059ce (patch)
tree04c2823be5069e50ccb3363a28c4df2e48ec8cea /indra/newview/llviewermediafocus.cpp
parent7f2388194136fc45d204f09fe63a6bd32d7e99ff (diff)
parentbac6652cdcd2d8333df04c3ebd3a6a7b752328b3 (diff)
Merge branch 'master' into DRTVWR-513-maint
# Conflicts: # indra/newview/llgroupmgr.cpp
Diffstat (limited to 'indra/newview/llviewermediafocus.cpp')
-rw-r--r--indra/newview/llviewermediafocus.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/indra/newview/llviewermediafocus.cpp b/indra/newview/llviewermediafocus.cpp
index 71ae7bfbc3..10099eda5b 100644
--- a/indra/newview/llviewermediafocus.cpp
+++ b/indra/newview/llviewermediafocus.cpp
@@ -205,8 +205,9 @@ bool LLViewerMediaFocus::getFocus()
}
// This function selects an ideal viewing distance based on the focused object, pick normal, and padding value
-void LLViewerMediaFocus::setCameraZoom(LLViewerObject* object, LLVector3 normal, F32 padding_factor, bool zoom_in_only)
+LLVector3d LLViewerMediaFocus::setCameraZoom(LLViewerObject* object, LLVector3 normal, F32 padding_factor, bool zoom_in_only)
{
+ LLVector3d camera_pos;
if (object)
{
gAgentCamera.setFocusOnAvatar(FALSE, ANIMATE);
@@ -254,7 +255,7 @@ void LLViewerMediaFocus::setCameraZoom(LLViewerObject* object, LLVector3 normal,
distance += depth * 0.5;
// Finally animate the camera to this new position and focal point
- LLVector3d camera_pos, target_pos;
+ LLVector3d target_pos;
// The target lookat position is the center of the selection (in global coords)
target_pos = center;
// Target look-from (camera) position is "distance" away from the target along the normal
@@ -287,7 +288,7 @@ void LLViewerMediaFocus::setCameraZoom(LLViewerObject* object, LLVector3 normal,
if (zoom_in_only &&
(dist_vec_squared(gAgentCamera.getCameraPositionGlobal(), target_pos) < dist_vec_squared(camera_pos, target_pos)))
{
- return;
+ return camera_pos;
}
gAgentCamera.setCameraPosAndFocusGlobal(camera_pos, target_pos, object->getID() );
@@ -298,6 +299,7 @@ void LLViewerMediaFocus::setCameraZoom(LLViewerObject* object, LLVector3 normal,
// If we have no object, focus back on the avatar.
gAgentCamera.setFocusOnAvatar(TRUE, ANIMATE);
}
+ return camera_pos;
}
void LLViewerMediaFocus::onFocusReceived()
{