diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-02-08 12:27:33 +0000 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-02-08 12:27:33 +0000 |
commit | 7660c19ce8fed013eea06450fe6deb4ae92f3ead (patch) | |
tree | a6b454d6b93a1b8befc1467a4f3570f5fa89a1af /indra/newview/llviewermediafocus.cpp | |
parent | 62f0f426532808755f6d97f34fd2d8c9e5d2fa6a (diff) | |
parent | 4e28c10971dc4f9a52a7b3f109143dbce3528d21 (diff) |
Merge from viewer2 trunk.
Diffstat (limited to 'indra/newview/llviewermediafocus.cpp')
-rw-r--r-- | indra/newview/llviewermediafocus.cpp | 12 |
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 { |