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.cpp

    r8563 r10084  
    4646    _shaderPoolParent(false) 
    4747{ 
     48    _subsurfaceDepth = new osg::Depth(osg::Depth::LESS, 0.0, 1.0,false); 
    4849} 
    4950 
     
    111112} 
    112113 
     114void Document::setSubSurfacePolygonOffset(int level, osg::PolygonOffset* po) 
     115{ 
     116    _subsurfacePolygonOffsets[level] = po; 
     117} 
     118 
     119osg::PolygonOffset* Document::getSubSurfacePolygonOffset(int level) 
     120{ 
     121    osg::notify(osg::DEBUG_INFO)<<"Document::getSubSurfacePolygonOffset("<<level<<")"<<std::endl; 
     122    osg::ref_ptr<osg::PolygonOffset>& po = _subsurfacePolygonOffsets[level]; 
     123    if (!po) 
     124    { 
     125        po = new osg::PolygonOffset(-1.0f*float(level), -1.0f); 
     126    } 
     127    return po.get(); 
     128} 
     129 
    113130double flt::unitsToMeters(CoordUnits unit) 
    114131{