From 73caee4208a4e05f66583de099502012fd8415ea Mon Sep 17 00:00:00 2001 From: Steven Bennetts Date: Fri, 14 Aug 2009 21:50:02 +0000 Subject: svn merge https://svn.aws.productengine.com/secondlife/export-from-ll/viewer-2-0@1331 https://svn.aws.productengine.com/secondlife/pe/stable-1@1340 -> viewer-2.0.0-3 EXT-269 EXT-274 EXT-276 EXT-277 EXT-282 EXT-296 EXT-342 EXT-370 EXT-379 EXT-394 EXT-398 EXT-405 EXT-407 EXT-410 EXT-413 EXT-414 EXT-450 EXT-456 EXT-477 EXT-482 EXT-496 --- indra/newview/llslurl.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'indra/newview/llslurl.cpp') diff --git a/indra/newview/llslurl.cpp b/indra/newview/llslurl.cpp index ffadeeddf2..f6c4710d60 100644 --- a/indra/newview/llslurl.cpp +++ b/indra/newview/llslurl.cpp @@ -112,6 +112,19 @@ std::string LLSLURL::buildUnescapedSLURL(const std::string& regionname, S32 x, S return unescapedslurl; } +// static +std::string LLSLURL::buildSLURLfromPosGlobal(const std::string& regionname, + const LLVector3d& global_pos) +{ + F32 region_x = (F32)fmod(global_pos.mdV[VX], (F64)REGION_WIDTH_METERS); + F32 region_y = (F32)fmod(global_pos.mdV[VY], (F64)REGION_WIDTH_METERS); + + return buildSLURL(regionname, + llround(region_x), + llround(region_y), + llround((F32)global_pos.mdV[VZ])); +} + // static bool LLSLURL::matchPrefix(const std::string& url, const std::string& prefix) { -- cgit v1.2.3