Random stab at object updates. Tell me if it breaks anything.

This commit is contained in:
Siana Gearz
2013-02-26 00:00:45 +01:00
parent e2659b801a
commit a4b49e3fc2

View File

@@ -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();
}