diff options
author | Leyla Farazha <leyla@lindenlab.com> | 2010-02-09 15:55:33 -0800 |
---|---|---|
committer | Leyla Farazha <leyla@lindenlab.com> | 2010-02-09 15:55:33 -0800 |
commit | f040942f190cfdf10ee577a9b4f6a5c83e752e00 (patch) | |
tree | e500ffe44696621292f37f2ace41c54a0331f9ee /indra/newview/llviewermenu.cpp | |
parent | 91b2ff00ae874f938919373c0db3de0721c7bf25 (diff) |
EXT-4449 [BSI] Zoom In does not function properly on large or linked prim sets
reviewed by Richard CC#99
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
-rw-r--r-- | indra/newview/llviewermenu.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index a83baf7f9a..6bf9c993e0 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -5332,7 +5332,7 @@ class LLWorldCreateLandmark : public view_listener_t void handle_look_at_selection(const LLSD& param) { - const F32 PADDING_FACTOR = 2.f; + const F32 PADDING_FACTOR = 1.75f; BOOL zoom = (param.asString() == "zoom"); if (!LLSelectMgr::getInstance()->getSelection()->isEmpty()) { @@ -5352,14 +5352,19 @@ void handle_look_at_selection(const LLSD& param) } if (zoom) { + // Make sure we are not increasing the distance between the camera and object + LLVector3d orig_distance = gAgent.getCameraPositionGlobal() - LLSelectMgr::getInstance()->getSelectionCenterGlobal(); + distance = llmin(distance, (F32) orig_distance.length()); + gAgent.setCameraPosAndFocusGlobal(LLSelectMgr::getInstance()->getSelectionCenterGlobal() + LLVector3d(obj_to_cam * distance), - LLSelectMgr::getInstance()->getSelectionCenterGlobal(), - object_id ); + LLSelectMgr::getInstance()->getSelectionCenterGlobal(), + object_id ); + } else { gAgent.setFocusGlobal( LLSelectMgr::getInstance()->getSelectionCenterGlobal(), object_id ); - } + } } } |