Show
Ignore:
Timestamp:
04/23/09 12:24:27 (4 years ago)
Author:
robert
Message:

Refactored the subsurface PolygonOffset? code so that it uses sensible values and also moves management of the PolygonOffset? and Depth attribute objects into the Document object rather than using static vars.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgPlugins/OpenFlight/Document.h

    r8563 r10084  
    2525#include <osg/Transform> 
    2626#include <osg/Geometry> 
     27#include <osg/PolygonOffset> 
     28#include <osg/Depth> 
    2729#include <osgDB/ReaderWriter> 
    2830 
     
    166168        ShaderPool* getOrCreateShaderPool(); 
    167169        bool getShaderPoolParent() const { return _shaderPoolParent; } 
     170 
     171        void setSubSurfacePolygonOffset(int level, osg::PolygonOffset* po); 
     172        osg::PolygonOffset* getSubSurfacePolygonOffset(int level); 
     173 
     174        void setSubSurfaceDepth(osg::Depth* depth) { _subsurfaceDepth = depth; } 
     175        osg::Depth* getSubSurfaceDepth() { return _subsurfaceDepth.get(); } 
    168176 
    169177 
     
    185193        void setDesiredUnits(CoordUnits units ) { _desiredUnits=units; } 
    186194        CoordUnits getDesiredUnits() const { return _desiredUnits; } 
    187          
     195 
    188196        void setKeepExternalReferences( bool flag) { _keepExternalReferences=flag; } 
    189197        bool getKeepExternalReferences() const { return _keepExternalReferences; } 
     
    226234        osg::ref_ptr<LightPointAnimationPool> _lightPointAnimationPool; 
    227235        osg::ref_ptr<ShaderPool> _shaderPool; 
     236 
     237        typedef std::map<int, osg::ref_ptr<osg::PolygonOffset> > SubSurfacePolygonOffsets; 
     238        SubSurfacePolygonOffsets _subsurfacePolygonOffsets; 
     239        osg::ref_ptr<osg::Depth> _subsurfaceDepth; 
     240 
    228241        bool _colorPoolParent; 
    229242        bool _texturePoolParent;