diff options
author | Erik Kundiman <erik@megapahit.org> | 2024-06-19 15:06:46 +0800 |
---|---|---|
committer | Erik Kundiman <erik@megapahit.org> | 2024-06-19 15:06:46 +0800 |
commit | 16299d3a3631e4c42367cf40410ad6995e585384 (patch) | |
tree | 46a0bf946843d00d724a12fa4adcd2b59904944b /indra/newview/llviewermenu.cpp | |
parent | 26f40db209589d9cdff32887e027f13cf77a8d17 (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.cpp | 20 |
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) |