diff options
| author | Roxie Linden <roxie@lindenlab.com> | 2010-02-26 19:18:15 -0800 |
|---|---|---|
| committer | Roxie Linden <roxie@lindenlab.com> | 2010-02-26 19:18:15 -0800 |
| commit | a2efe4bb4154b7ecb9c7cb279f7a28d7d401a93a (patch) | |
| tree | 4cafd0e64a9c45b444664d12f022cd3e675bfebd /indra/newview/llviewermediafocus.cpp | |
| parent | 5352954eb65076d877cc74d4328620e910b93d1c (diff) | |
| parent | 1ae70e112a466a6ed5baf4e05c1771218c78b2f5 (diff) | |
automated merge
Diffstat (limited to 'indra/newview/llviewermediafocus.cpp')
| -rw-r--r-- | indra/newview/llviewermediafocus.cpp | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/indra/newview/llviewermediafocus.cpp b/indra/newview/llviewermediafocus.cpp index a0ac9c2091..88e7cfec86 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 { @@ -551,6 +559,19 @@ void LLViewerMediaFocus::focusZoomOnMedia(LLUUID media_id) } } +void LLViewerMediaFocus::unZoom() +{ + if(mMediaControls.get()) + { + mMediaControls.get()->resetZoomLevel(); + } +} + +bool LLViewerMediaFocus::isZoomed() const +{ + return (mMediaControls.get() && mMediaControls.get()->getZoomLevel() != LLPanelPrimMediaControls::ZOOM_NONE); +} + LLUUID LLViewerMediaFocus::getControlsMediaID() { if(getFocusedMediaImpl()) |
