summaryrefslogtreecommitdiff
path: root/indra/llcharacter
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/llcharacter
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/llcharacter')
-rw-r--r--indra/llcharacter/llbvhloader.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/indra/llcharacter/llbvhloader.cpp b/indra/llcharacter/llbvhloader.cpp
index 532a2c1b0d..a340bab6d3 100644
--- a/indra/llcharacter/llbvhloader.cpp
+++ b/indra/llcharacter/llbvhloader.cpp
@@ -1196,7 +1196,7 @@ void LLBVHLoader::optimize()
if (ki_prev == ki_last_good_pos)
{
joint->mNumPosKeys++;
- if (dist_vec(LLVector3(ki_prev->mPos), first_frame_pos) > POSITION_MOTION_THRESHOLD)
+ if (dist_vec_squared(LLVector3(ki_prev->mPos), first_frame_pos) > POSITION_MOTION_THRESHOLD * POSITION_MOTION_THRESHOLD)
{
pos_changed = TRUE;
}
@@ -1209,12 +1209,12 @@ void LLBVHLoader::optimize()
LLVector3 current_pos(ki->mPos);
LLVector3 interp_pos = lerp(current_pos, last_good_pos, 1.f / (F32)numPosFramesConsidered);
- if (dist_vec(current_pos, first_frame_pos) > POSITION_MOTION_THRESHOLD)
+ if (dist_vec_squared(current_pos, first_frame_pos) > POSITION_MOTION_THRESHOLD * POSITION_MOTION_THRESHOLD)
{
pos_changed = TRUE;
}
- if (dist_vec(interp_pos, test_pos) < POSITION_KEYFRAME_THRESHOLD)
+ if (dist_vec_squared(interp_pos, test_pos) < POSITION_KEYFRAME_THRESHOLD * POSITION_KEYFRAME_THRESHOLD)
{
ki_prev->mIgnorePos = TRUE;
numPosFramesConsidered++;