aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llviewermenu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llviewermenu.cpp')
-rw-r--r--linden/indra/newview/llviewermenu.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp
index c7207ba..c2a8055 100644
--- a/linden/indra/newview/llviewermenu.cpp
+++ b/linden/indra/newview/llviewermenu.cpp
@@ -4903,13 +4903,20 @@ class LLToolsLookAtSelection : public view_listener_t
4903 LLVector3 obj_to_cam = LLViewerCamera::getInstance()->getOrigin() - selection_bbox.getCenterAgent(); 4903 LLVector3 obj_to_cam = LLViewerCamera::getInstance()->getOrigin() - selection_bbox.getCenterAgent();
4904 obj_to_cam.normVec(); 4904 obj_to_cam.normVec();
4905 4905
4906 LLUUID object_id;
4907 if (LLSelectMgr::getInstance()->getSelection()->getPrimaryObject())
4908 {
4909 object_id = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()->mID;
4910 }
4906 if (zoom) 4911 if (zoom)
4907 { 4912 {
4908 gAgent.setCameraPosAndFocusGlobal(LLSelectMgr::getInstance()->getSelectionCenterGlobal() + LLVector3d(obj_to_cam * distance), LLSelectMgr::getInstance()->getSelectionCenterGlobal(), LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()->mID ); 4913 gAgent.setCameraPosAndFocusGlobal(LLSelectMgr::getInstance()->getSelectionCenterGlobal() + LLVector3d(obj_to_cam * distance),
4914 LLSelectMgr::getInstance()->getSelectionCenterGlobal(),
4915 object_id );
4909 } 4916 }
4910 else 4917 else
4911 { 4918 {
4912 gAgent.setFocusGlobal( LLSelectMgr::getInstance()->getSelectionCenterGlobal(), LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()->mID ); 4919 gAgent.setFocusGlobal( LLSelectMgr::getInstance()->getSelectionCenterGlobal(), object_id );
4913 } 4920 }
4914 } 4921 }
4915 return true; 4922 return true;