summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterchat.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/llfloaterchat.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/llfloaterchat.cpp')
-rw-r--r--indra/newview/llfloaterchat.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/indra/newview/llfloaterchat.cpp b/indra/newview/llfloaterchat.cpp
index c2c2e7fe22..2679dbb78b 100644
--- a/indra/newview/llfloaterchat.cpp
+++ b/indra/newview/llfloaterchat.cpp
@@ -413,8 +413,9 @@ LLColor4 get_text_color(const LLChat& chat)
if (!chat.mPosAgent.isExactlyZero())
{
LLVector3 pos_agent = gAgent.getPositionAgent();
- F32 distance = dist_vec(pos_agent, chat.mPosAgent);
- if (distance > gAgent.getNearChatRadius())
+ F32 distance_squared = dist_vec_squared(pos_agent, chat.mPosAgent);
+ F32 dist_near_chat = gAgent.getNearChatRadius();
+ if (distance_squared > dist_near_chat * dist_near_chat)
{
// diminish far-off chat
text_color.mV[VALPHA] = 0.8f;