Converted viewer camera references to use observer_ptr<> rather than ref_ptr<> or C pointers to avoid issues with circular references/dangling pointers.
This commit is contained in:
@@ -103,7 +103,7 @@ class OSGSHADOW_EXPORT DebugShadowMap : public ViewDependentShadowTechnique
|
||||
osg::ref_ptr< osg::Camera > _camera;
|
||||
|
||||
osg::Matrixd _viewProjection;
|
||||
osg::Camera * _viewCamera;
|
||||
osg::observer_ptr<osg::Camera> _viewCamera;
|
||||
|
||||
// Debug hud variables
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ class OSGSHADOW_EXPORT MinimalDrawBoundsShadowMap
|
||||
osg::ref_ptr< osg::Image > _boundAnalysisImage;
|
||||
osg::ref_ptr< osg::Texture2D > _boundAnalysisTexture;
|
||||
osg::ref_ptr< osg::Camera > _boundAnalysisCamera;
|
||||
osg::ref_ptr< osg::Camera > _mainCamera;
|
||||
osg::observer_ptr< osg::Camera > _mainCamera;
|
||||
|
||||
void setShadowCameraProjectionMatrixPtr( osg::RefMatrix * projection )
|
||||
{ _projection = projection; }
|
||||
|
||||
Reference in New Issue
Block a user