Show
Ignore:
Timestamp:
01/05/10 12:15:03 (5 years ago)
Author:
robert
Message:

Added support for call root Camera CullCallbacks?

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgUtil/SceneView.cpp

    r10895 r10915  
    888888 
    889889        // traverse the scene graph to search for occluder in there new positions. 
    890         for(unsigned int i=0; i< _camera->getNumChildren(); ++i) 
    891         { 
    892             _camera->getChild(i)->accept(*_collectOccludersVisitor); 
    893         } 
     890        _collectOccludersVisitor->traverse(*_camera); 
    894891 
    895892        _collectOccludersVisitor->popModelViewMatrix(); 
     
    970967    cullVisitor->pushProjectionMatrix(proj.get()); 
    971968    cullVisitor->pushModelViewMatrix(mv.get(),osg::Transform::ABSOLUTE_RF); 
    972      
    973  
    974     // traverse the scene graph to generate the rendergraph. 
    975     for(unsigned int childNo=0; 
    976         childNo<_camera->getNumChildren(); 
    977         ++childNo) 
    978     { 
    979         _camera->getChild(childNo)->accept(*cullVisitor); 
    980     } 
     969 
     970    // traverse the scene graph to generate the rendergraph.     
     971    // If the camera has a cullCallback execute the callback which has the   
     972    // requirement that it must traverse the camera's children. 
     973    { 
     974       osg::NodeCallback* callback = _camera->getCullCallback(); 
     975       if (callback) (*callback)(_camera.get(), cullVisitor); 
     976       else _cullVisitor->traverse(*_camera); 
     977    } 
     978 
    981979 
    982980    cullVisitor->popModelViewMatrix();