Lindie viewer-dev catchup regarding rendering pipeline.

This commit is contained in:
Shyotl
2012-06-30 20:05:31 -05:00
parent a8ebd6eebb
commit 67e1a3b004
87 changed files with 3880 additions and 2180 deletions

View File

@@ -390,7 +390,9 @@ void LLDrawable::makeActive()
pcode == LLViewerObject::LL_VO_SURFACE_PATCH ||
pcode == LLViewerObject::LL_VO_PART_GROUP ||
pcode == LLViewerObject::LL_VO_HUD_PART_GROUP ||
#if ENABLE_CLASSIC_CLOUDS
pcode == LLViewerObject::LL_VO_CLOUDS ||
#endif
pcode == LLViewerObject::LL_VO_GROUND ||
pcode == LLViewerObject::LL_VO_SKY)
{
@@ -454,7 +456,7 @@ void LLDrawable::makeStatic(BOOL warning_enabled)
{
if (isState(ACTIVE))
{
clearState(ACTIVE);
clearState(ACTIVE | ANIMATED_CHILD);
if (mParent.notNull() && mParent->isActive() && warning_enabled)
{
@@ -542,9 +544,9 @@ F32 LLDrawable::updateXform(BOOL undamped)
target_rot = new_rot;
target_scale = new_scale;
}
else
else if (mVObjp->getAngularVelocity().isExactlyZero())
{
// snap to final position
// snap to final position (only if no target omega is applied)
dist_squared = 0.0f;
if (getVOVolume() && !isRoot())
{ //child prim snapping to some position, needs a rebuild
@@ -553,15 +555,25 @@ 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 (!getVOVolume() && !isAvatar())
{
movePartition();
@@ -572,9 +584,7 @@ F32 LLDrawable::updateXform(BOOL undamped)
mXform.setRotation(target_rot);
mXform.setScale(LLVector3(1,1,1)); //no scale in drawable transforms (IT'S A RULE!)
mXform.updateMatrix();
mCurrentScale = target_scale;
if (mSpatialBridge)
{
gPipeline.markMoved(mSpatialBridge, FALSE);
@@ -600,7 +610,11 @@ void LLDrawable::moveUpdatePipeline(BOOL moved)
// Update the face centers.
for (S32 i = 0; i < getNumFaces(); i++)
{
getFace(i)->updateCenterAgent();
LLFace* face = getFace(i);
if (face)
{
face->updateCenterAgent();
}
}
}
@@ -731,7 +745,8 @@ void LLDrawable::updateDistance(LLCamera& camera, bool force_update)
for (S32 i = 0; i < getNumFaces(); i++)
{
LLFace* facep = getFace(i);
if (force_update || facep->getPoolType() == LLDrawPool::POOL_ALPHA)
if (facep &&
(force_update || facep->getPoolType() == LLDrawPool::POOL_ALPHA))
{
LLVector4a box;
box.setSub(facep->mExtents[1], facep->mExtents[0]);
@@ -830,13 +845,16 @@ void LLDrawable::shiftPos(const LLVector4a &shift_vector)
for (S32 i = 0; i < getNumFaces(); i++)
{
LLFace *facep = getFace(i);
facep->mCenterAgent += LLVector3(shift_vector.getF32ptr());
facep->mExtents[0].add(shift_vector);
facep->mExtents[1].add(shift_vector);
if (!volume && facep->hasGeometry())
if (facep)
{
facep->clearVertexBuffer();
facep->mCenterAgent += LLVector3(shift_vector.getF32ptr());
facep->mExtents[0].add(shift_vector);
facep->mExtents[1].add(shift_vector);
if (!volume && facep->hasGeometry())
{
facep->clearVertexBuffer();
}
}
}
@@ -958,7 +976,10 @@ void LLDrawable::setSpatialGroup(LLSpatialGroup *groupp)
for (S32 i = 0; i < getNumFaces(); ++i)
{
LLFace* facep = getFace(i);
facep->clearVertexBuffer();
if (facep)
{
facep->clearVertexBuffer();
}
}
}
@@ -1544,15 +1565,17 @@ BOOL LLDrawable::isAnimating() const
{
return TRUE;
}
#if ENABLE_CLASSIC_CLOUDS
if (mVObjp->getPCode() == LLViewerObject::LL_VO_CLOUDS)
{
return TRUE;
}
#endif
if (!isRoot() && !mVObjp->getAngularVelocity().isExactlyZero())
{
/*if (!isRoot() && !mVObjp->getAngularVelocity().isExactlyZero())
{ //target omega
return TRUE;
}
}*/
return FALSE;
}