diff options
author | Adam Moss <moss@lindenlab.com> | 2009-05-22 09:58:47 +0000 |
---|---|---|
committer | Adam Moss <moss@lindenlab.com> | 2009-05-22 09:58:47 +0000 |
commit | 9dfe0ca9a0228c4fa75c8a3e51840696cc6b4960 (patch) | |
tree | 3136e0a32cdcb1d55a4c3a5a67791ca128d947a5 /indra/newview/llvotree.cpp | |
parent | 93cf3d89e51835dd2f61c32b16191ab724528055 (diff) |
svn merge -r121194:121210
svn+ssh://svn.lindenlab.com/svn/linden/branches/viewer/viewer-1.23.onetwo-merge-1
QAR-1531 viewer 1.23rc1+1.23rc2 merge to trunk
Diffstat (limited to 'indra/newview/llvotree.cpp')
-rw-r--r-- | indra/newview/llvotree.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/indra/newview/llvotree.cpp b/indra/newview/llvotree.cpp index 3b76127eb2..3fd5054fd1 100644 --- a/indra/newview/llvotree.cpp +++ b/indra/newview/llvotree.cpp @@ -329,6 +329,9 @@ U32 LLVOTree::processUpdateMessage(LLMessageSystem *mesgsys, mBillboardRatio = sSpeciesTable[mSpecies]->mBillboardRatio; mTrunkAspect = sSpeciesTable[mSpecies]->mTrunkAspect; mBranchAspect = sSpeciesTable[mSpecies]->mBranchAspect; + + // position change not caused by us, etc. make sure to rebuild. + gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL); return retval; } @@ -397,6 +400,31 @@ BOOL LLVOTree::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) { gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, FALSE); } + else + { + // we're not animating but we may *still* need to + // regenerate the mesh if we moved, since position + // and rotation are baked into the mesh. + // *TODO: I don't know what's so special about trees + // that they don't get REBUILD_POSITION automatically + // at a higher level. + const LLVector3 &this_position = getPositionAgent(); + if (this_position != mLastPosition) + { + gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_POSITION); + mLastPosition = this_position; + } + else + { + const LLQuaternion &this_rotation = getRotation(); + + if (this_rotation != mLastRotation) + { + gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_POSITION); + mLastRotation = this_rotation; + } + } + } } mTrunkLOD = trunk_LOD; |