Changeset 9555

Show
Ignore:
Timestamp:
01/27/09 15:11:37 (5 years ago)
Author:
robert
Message:

Converted viewer camera references to use observer_ptr<> rather than ref_ptr<> or C pointers to avoid issues with circular references/dangling pointers.

Location:
OpenSceneGraph/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/include/osgShadow/DebugShadowMap

    r9540 r9555  
    104104 
    105105            osg::Matrixd                   _viewProjection; 
    106             osg::Camera *                  _viewCamera; 
     106            osg::observer_ptr<osg::Camera> _viewCamera; 
    107107 
    108108            // Debug hud variables 
  • OpenSceneGraph/trunk/include/osgShadow/MinimalDrawBoundsShadowMap

    r9376 r9555  
    5454            osg::ref_ptr< osg::Texture2D >       _boundAnalysisTexture; 
    5555            osg::ref_ptr< osg::Camera >          _boundAnalysisCamera; 
    56             osg::ref_ptr< osg::Camera >          _mainCamera; 
     56            osg::observer_ptr< osg::Camera >     _mainCamera; 
    5757 
    5858            void setShadowCameraProjectionMatrixPtr( osg::RefMatrix * projection ) 
  • OpenSceneGraph/trunk/src/osgShadow/DebugShadowMap.cpp

    r9540 r9555  
    279279            { viewCam->getViewMatrix() *  
    280280                // use near far clamped projection ( precomputed in cullDebugGeometry ) 
    281                 ( viewCam == _viewCamera ? _viewProjection : viewCam->getProjectionMatrix() ), 
     281                ( _viewCamera==viewCam ? _viewProjection : viewCam->getProjectionMatrix() ), 
    282282              shadowCam->getViewMatrix() * shadowCam->getProjectionMatrix() },  
    283283        inverse[ num ] =  
     
    363363    } 
    364364     
    365     updateDebugGeometry( _viewCamera, _camera.get() ); 
     365    updateDebugGeometry( _viewCamera.get(), _camera.get() ); 
    366366     
    367367#if 1 // Add geometries of polytopes to main cam Render Stage