From a4b49e3fc2eaef5d22428961fd4a80aba2276903 Mon Sep 17 00:00:00 2001 From: Siana Gearz Date: Tue, 26 Feb 2013 00:00:45 +0100 Subject: [PATCH] Random stab at object updates. Tell me if it breaks anything. --- indra/newview/lldrawable.cpp | 40 +++++++++--------------------------- 1 file changed, 10 insertions(+), 30 deletions(-) diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index 7d133fa72..451b9ae50 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -545,38 +545,18 @@ F32 LLDrawable::updateXform(BOOL undamped) } } } - else - { - dist_squared = dist_vec_squared(old_pos, target_pos); - dist_squared += (1.f - dot(old_rot, target_rot)) * 10.f; - dist_squared += dist_vec_squared(old_scale, target_scale); - } - LLVector3 vec = mCurrentScale-target_scale; - - if (vec*vec > MIN_INTERPOLATE_DISTANCE_SQUARED) - { //scale change requires immediate rebuild + + if ((mCurrentScale != target_scale) || + (!isRoot() && + (dist_squared >= MIN_INTERPOLATE_DISTANCE_SQUARED || + !mVObjp->getAngularVelocity().isExactlyZero() || + target_pos != mXform.getPosition() || + target_rot != mXform.getRotation()))) + { //child prim moving or scale change requires immediate rebuild mCurrentScale = target_scale; gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION, TRUE); } - else if (!isRoot() && - (!mVObjp->getAngularVelocity().isExactlyZero() || - dist_squared > 0.f)) - { //child prim moving relative to parent, tag as needing to be rendered atomically and rebuild - dist_squared = 1.f; //keep this object on the move list - if (!isState(LLDrawable::ANIMATED_CHILD)) - { - setState(LLDrawable::ANIMATED_CHILD); - gPipeline.markRebuild(this, LLDrawable::REBUILD_ALL, TRUE); - mVObjp->dirtySpatialGroup(); - } - } - else if (!isRoot() && ( - dist_vec_squared(old_pos, target_pos) > 0.f - || old_rot != target_rot )) - { //fix for BUG-860, MAINT-2275, MAINT-1742, MAINT-2247 - gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION, TRUE); - } else if (!getVOVolume() && !isAvatar()) { movePartition(); @@ -666,7 +646,7 @@ BOOL LLDrawable::updateMoveUndamped() if (!isState(LLDrawable::INVISIBLE)) { - BOOL moved = (dist_squared > 0.001f && dist_squared < 255.99f); + BOOL moved = (dist_squared > 0.001f); moveUpdatePipeline(moved); mVObjp->updateText(); } @@ -701,7 +681,7 @@ BOOL LLDrawable::updateMoveDamped() if (!isState(LLDrawable::INVISIBLE)) { - BOOL moved = (dist_squared > 0.001f && dist_squared < 128.0f); + BOOL moved = (dist_squared > 0.001f); moveUpdatePipeline(moved); mVObjp->updateText(); }