diff options
| author | prep <none@none> | 2012-05-01 10:54:00 -0400 |
|---|---|---|
| committer | prep <none@none> | 2012-05-01 10:54:00 -0400 |
| commit | 87cba5a2b2ff662cb1b4d847b1ca3030ad53c960 (patch) | |
| tree | 9147e40ef43bdf06d5f33c9f11f0a2ee2128a012 /indra/newview/pipeline.cpp | |
| parent | 4bb589bc2b49202f2140860f19d4de69efd14494 (diff) | |
Path-494: Added support for culling permanent objects from the pathfinding window.
Diffstat (limited to 'indra/newview/pipeline.cpp')
| -rw-r--r-- | indra/newview/pipeline.cpp | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 72e47f54a0..e7123e24d2 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -2624,6 +2624,7 @@ void LLPipeline::markVisible(LLDrawable *drawablep, LLCamera& camera) { const LLDrawable* root = ((LLSpatialBridge*) drawablep)->mDrawable; llassert(root); // trying to catch a bad assumption + if (root && // // this test may not be needed, see above root->getVObj()->isAttachment()) { @@ -2646,6 +2647,7 @@ void LLPipeline::markVisible(LLDrawable *drawablep, LLCamera& camera) } else { + sCull->pushDrawable(drawablep); } @@ -10103,3 +10105,75 @@ void LLPipeline::addDebugBlip(const LLVector3& position, const LLColor4& color) mDebugBlips.push_back(blip); } +void LLPipeline::hidePermanentObjects( std::vector<U32>& restoreList ) +{ + //This method is used to hide any vo's from the object list that may have + //the permanent flag set. + U32 objCnt = gObjectList.getNumObjects(); + for (U32 i = 0; i < objCnt; ++i) + { + LLViewerObject* pObject = gObjectList.getObject(i); + if ( pObject && pObject->flagObjectPermanent() ) + { + LLDrawable *pDrawable = pObject->mDrawable; + + if ( pDrawable ) + { + restoreList.push_back( i ); + pDrawable->setState( LLDrawable::FORCE_INVISIBLE ); + markRebuild( pDrawable, LLDrawable::REBUILD_ALL, TRUE ); + //hide children + LLViewerObject::const_child_list_t& child_list = pDrawable->getVObj()->getChildren(); + for ( LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); + iter != child_list.end(); iter++ ) + { + LLViewerObject* child = *iter; + LLDrawable* drawable = child->mDrawable; + if (drawable) + { + drawable->setState( LLDrawable::FORCE_INVISIBLE ); + markRebuild( drawable, LLDrawable::REBUILD_ALL, TRUE ); + } + } + } + } + } +} + +void LLPipeline::restorePermanentObjects( std::vector<U32>& restoreList ) +{ + //This method is used to restore(unhide) any vo's from the object list that may have + //been hidden because their permanency flag was set. + std::vector<U32>::iterator itCurrent = restoreList.begin(); + std::vector<U32>::iterator itEnd = restoreList.end(); + + while ( itCurrent != itEnd ) + { + U32 index = *itCurrent; + LLViewerObject* pObject = gObjectList.getObject( index ); + if ( pObject ) + { + LLDrawable *pDrawable = pObject->mDrawable; + if ( pDrawable ) + { + pDrawable->clearState( LLDrawable::FORCE_INVISIBLE ); + markRebuild( pDrawable, LLDrawable::REBUILD_ALL, TRUE ); + //restore children + LLViewerObject::const_child_list_t& child_list = pDrawable->getVObj()->getChildren(); + for ( LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); + iter != child_list.end(); iter++) + { + LLViewerObject* child = *iter; + LLDrawable* drawable = child->mDrawable; + if (drawable) + { + drawable->clearState( LLDrawable::FORCE_INVISIBLE ); + markRebuild( drawable, LLDrawable::REBUILD_ALL, TRUE ); + } + } + } + } + ++itCurrent; + } +} + |
