summaryrefslogtreecommitdiff
path: root/indra/newview/llselectmgr.cpp
diff options
context:
space:
mode:
authorRicky Curtice <kf6kjg+hg@gmail.com>2011-03-10 22:07:06 -0800
committerRicky Curtice <kf6kjg+hg@gmail.com>2011-03-10 22:07:06 -0800
commitd4d292258e31eee6d639106147758f39deae63e3 (patch)
tree577571cc2d4cdef5aa24706520b790f56b875c1c /indra/newview/llselectmgr.cpp
parent1426765e82549ec9d17a0f90d902f25c0e785bbd (diff)
Squared all dist_vec() based comparisons and other dist_vec() operations where sensible.
Not all instances of dist_vec() were squared, only those where it wouldn't (hopefully) change the functionality.
Diffstat (limited to 'indra/newview/llselectmgr.cpp')
-rw-r--r--indra/newview/llselectmgr.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index 50bc0b4a98..39f3cd4196 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -6577,12 +6577,14 @@ bool LLSelectMgr::selectionMove(const LLVector3& displ,
{
obj_pos = (*it)->getObject()->getPositionEdit();
- F32 obj_dist = dist_vec(obj_pos, LLViewerCamera::getInstance()->getOrigin());
- if (obj_dist < min_dist)
+ F32 obj_dist_squared = dist_vec_squared(obj_pos, LLViewerCamera::getInstance()->getOrigin());
+ if (obj_dist_squared < min_dist)
{
- min_dist = obj_dist;
+ min_dist = obj_dist_squared;
}
}
+ // since the above uses squared values, take the square root.
+ min_dist = sqrt(min_dist);
// factor the distance inside the displacement vector. This will get us
// equally visible movements for both close and far away selections.