summaryrefslogtreecommitdiff
path: root/indra/newview/llworld.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2011-05-02 07:24:15 -0400
committerOz Linden <oz@lindenlab.com>2011-05-02 07:24:15 -0400
commita32daa0c10b285354e94e0e8bf0cc6c5ffce09a5 (patch)
treec2ba5f181935b95d2f23406c41917401cd4be963 /indra/newview/llworld.cpp
parent929bde3ed08f9a1d2a8f4c9821b0d51c11d895e9 (diff)
parent89216a6c213c126b8ab6dacaeb21340fa8f7a001 (diff)
merge changes for vwr-25126
Diffstat (limited to 'indra/newview/llworld.cpp')
-rw-r--r--indra/newview/llworld.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp
index 6b2af1f8b7..8f50041474 100644
--- a/indra/newview/llworld.cpp
+++ b/indra/newview/llworld.cpp
@@ -1438,6 +1438,8 @@ static LLVector3d unpackLocalToGlobalPosition(U32 compact_local, const LLVector3
void LLWorld::getAvatars(uuid_vec_t* avatar_ids, std::vector<LLVector3d>* positions, const LLVector3d& relative_to, F32 radius) const
{
+ F32 radius_squared = radius * radius;
+
if(avatar_ids != NULL)
{
avatar_ids->clear();
@@ -1458,7 +1460,7 @@ void LLWorld::getAvatars(uuid_vec_t* avatar_ids, std::vector<LLVector3d>* positi
if(!uuid.isNull())
{
LLVector3d pos_global = pVOAvatar->getPositionGlobal();
- if(dist_vec(pos_global, relative_to) <= radius)
+ if(dist_vec_squared(pos_global, relative_to) <= radius_squared)
{
if(positions != NULL)
{
@@ -1482,7 +1484,7 @@ void LLWorld::getAvatars(uuid_vec_t* avatar_ids, std::vector<LLVector3d>* positi
for (S32 i = 0; i < count; i++)
{
LLVector3d pos_global = unpackLocalToGlobalPosition(regionp->mMapAvatars.get(i), origin_global);
- if(dist_vec(pos_global, relative_to) <= radius)
+ if(dist_vec_squared(pos_global, relative_to) <= radius_squared)
{
LLUUID uuid = regionp->mMapAvatarIDs.get(i);
// if this avatar doesn't already exist in the list, add it