From a9f2e345c9b008c024e41f6628341eb7b92ba852 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 26 Jun 2006 09:18:49 +0000 Subject: [PATCH] From David Fries, Reset only the RenderLeaf objects used in the last frame as given by the _currentReuseRenderLeafIndex instead of resetting all leaves which can be very time consuming. --- src/osgUtil/CullVisitor.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/osgUtil/CullVisitor.cpp b/src/osgUtil/CullVisitor.cpp index 31ff43271..879a8ba13 100644 --- a/src/osgUtil/CullVisitor.cpp +++ b/src/osgUtil/CullVisitor.cpp @@ -129,18 +129,18 @@ void CullVisitor::reset() _bbCornerNear = (~_bbCornerFar)&7; - // reset the resuse lists. - _currentReuseMatrixIndex = 0; - _currentReuseRenderLeafIndex = 0; - - for(RenderLeafList::iterator itr=_reuseRenderLeafList.begin(); - itr!=_reuseRenderLeafList.end(); + // Only reset the RenderLeaf objects used last frame. + for(RenderLeafList::iterator itr=_reuseRenderLeafList.begin(), + iter_end=_reuseRenderLeafList.begin()+_currentReuseRenderLeafIndex; + itr!=iter_end; ++itr) { (*itr)->reset(); } - + // reset the resuse lists. + _currentReuseMatrixIndex = 0; + _currentReuseRenderLeafIndex = 0; _nearPlaneCandidateMap.clear(); }