Matching movement rebuild code with V3 again

This commit is contained in:
Siana Gearz
2013-05-27 08:35:07 +02:00
parent 772f5e0e5d
commit 8b085bd03d

View File

@@ -546,16 +546,31 @@ F32 LLDrawable::updateXform(BOOL undamped)
}
}
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
LLVector3 vec = mCurrentScale-target_scale;
if (vec*vec > MIN_INTERPOLATE_DISTANCE_SQUARED)
{ //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();