summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermediafocus.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2010-02-08 09:50:04 -0500
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2010-02-08 09:50:04 -0500
commit5dda2516ad599d3c295930fb3fc0c6cdbe8c2ce5 (patch)
tree06d761559a50b8df3db4dffa32c6ad28ce398c11 /indra/newview/llviewermediafocus.cpp
parentf5b82a377256d5806ec101e8a9d90533ea1a3bf9 (diff)
parentbb977a194f42cafdcf3f1245adf3b7f49857e552 (diff)
merge
Diffstat (limited to 'indra/newview/llviewermediafocus.cpp')
-rw-r--r--indra/newview/llviewermediafocus.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/indra/newview/llviewermediafocus.cpp b/indra/newview/llviewermediafocus.cpp
index a0ac9c2091..f508a3462a 100644
--- a/indra/newview/llviewermediafocus.cpp
+++ b/indra/newview/llviewermediafocus.cpp
@@ -157,7 +157,6 @@ void LLViewerMediaFocus::setFocusFace(LLPointer<LLViewerObject> objectp, S32 fac
mFocusedObjectFace = 0;
}
}
-
}
void LLViewerMediaFocus::clearFocus()
@@ -198,7 +197,7 @@ 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)
+void LLViewerMediaFocus::setCameraZoom(LLViewerObject* object, LLVector3 normal, F32 padding_factor, bool zoom_in_only)
{
if (object)
{
@@ -269,7 +268,16 @@ void LLViewerMediaFocus::setCameraZoom(LLViewerObject* object, LLVector3 normal,
camera_pos += 0.01 * len * delta;
}
+ // If we are not allowing zooming out and the old camera position is closer to
+ // the center then the new intended camera position, don't move camera and return
+ if (zoom_in_only &&
+ (dist_vec_squared(gAgent.getCameraPositionGlobal(), target_pos) < dist_vec_squared(camera_pos, target_pos)))
+ {
+ return;
+ }
+
gAgent.setCameraPosAndFocusGlobal(camera_pos, target_pos, object->getID() );
+
}
else
{