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.
This commit is contained in:
Robert Osfield
2006-06-26 09:18:49 +00:00
parent a80ba8b3d8
commit a9f2e345c9

View File

@@ -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();
}