diff options
author | Mark Palange <palange@lindenlab.com> | 2008-10-08 00:22:32 +0000 |
---|---|---|
committer | Mark Palange <palange@lindenlab.com> | 2008-10-08 00:22:32 +0000 |
commit | b807e3df990e6fad25cd0bca94d2959dac042b13 (patch) | |
tree | aa8b185cac406abe412d76d90a903b450191d84d /indra/newview/llviewermenu.cpp | |
parent | 4296542cd062af425d7744c88d6dd2bd00daf532 (diff) |
merge r97380-98701 branches/viewer/viewer_1-21 (Viewer RC5 and security fixes) merge to trunk (for real)
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
-rw-r--r-- | indra/newview/llviewermenu.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index d11598100e..7c78a26367 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -4934,13 +4934,20 @@ class LLToolsLookAtSelection : public view_listener_t LLVector3 obj_to_cam = LLViewerCamera::getInstance()->getOrigin() - selection_bbox.getCenterAgent(); obj_to_cam.normVec(); + LLUUID object_id; + if (LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()) + { + object_id = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()->mID; + } if (zoom) { - gAgent.setCameraPosAndFocusGlobal(LLSelectMgr::getInstance()->getSelectionCenterGlobal() + LLVector3d(obj_to_cam * distance), LLSelectMgr::getInstance()->getSelectionCenterGlobal(), LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()->mID ); + gAgent.setCameraPosAndFocusGlobal(LLSelectMgr::getInstance()->getSelectionCenterGlobal() + LLVector3d(obj_to_cam * distance), + LLSelectMgr::getInstance()->getSelectionCenterGlobal(), + object_id ); } else { - gAgent.setFocusGlobal( LLSelectMgr::getInstance()->getSelectionCenterGlobal(), LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()->mID ); + gAgent.setFocusGlobal( LLSelectMgr::getInstance()->getSelectionCenterGlobal(), object_id ); } } return true; |