summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermenu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
-rw-r--r--indra/newview/llviewermenu.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index e1664752e7..9c40216ad6 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -73,6 +73,7 @@
#include "llfloaterpay.h"
#include "llfloaterreporter.h"
#include "llfloatersearch.h"
+#include "fsfloatersearch.h"
#include "llfloaterscriptdebug.h"
#include "llfloatersnapshot.h"
#include "llfloatertools.h"
@@ -6646,6 +6647,26 @@ void handle_zoom_to_object(LLUUID object_id)
}
}
+void handle_teleport_to_object(LLUUID object_id)
+{
+ LLViewerObject* object = gObjectList.findObject(object_id);
+
+ if (object)
+ {
+ gAgentCamera.setFocusOnAvatar(FALSE, ANIMATE);
+
+ LLBBox bbox = object->getBoundingBoxAgent() ;
+
+ LLVector3 obj_to_cam = LLViewerCamera::getInstance()->getOrigin() - bbox.getCenterAgent();
+ obj_to_cam.normVec();
+
+
+ LLVector3d object_center_global = gAgent.getPosGlobalFromAgent(bbox.getCenterAgent());
+
+ gAgent.teleportViaLocation(object_center_global);
+ }
+}
+
class LLAvatarInviteToGroup : public view_listener_t
{
bool handleEvent(const LLSD& userdata)