summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermenu.cpp
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2024-06-19 15:06:46 +0800
committerErik Kundiman <erik@megapahit.org>2024-06-19 15:06:46 +0800
commit16299d3a3631e4c42367cf40410ad6995e585384 (patch)
tree46a0bf946843d00d724a12fa4adcd2b59904944b /indra/newview/llviewermenu.cpp
parent26f40db209589d9cdff32887e027f13cf77a8d17 (diff)
"Teleport to" option in nearby tab of people window
https://megapahit.com/show_bug.cgi?id=32
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
-rw-r--r--indra/newview/llviewermenu.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 4dcfb18b30..2ca27e0e1a 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -6454,6 +6454,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)