Ignore:
Timestamp:
Feb 25, 2011, 11:01:49 PM (13 years ago)
Author:
Torben Dannhauer
Message:

introduced abstract "terrainModficationTechnique" base class. this class will be derived by every terrainTechnique, e.g. ellipsoidTechnique

File:
1 edited

Legend:

Unmodified
Added
Removed
  • experimental/TerrainTest/ModificationVisitor.cpp

    r260 r262  
    66{
    77        setTraversalMode( osg::NodeVisitor::TRAVERSE_ALL_CHILDREN );
    8         technique = new ellipsoidTechnique();
     8        _technique = new ellipsoidTechnique();
     9
     10        // Set ROI to flatten and estimated height after correction
     11        _technique->setModifiedHeight(450);
    912}
    1013
     
    4952
    5053        // ROI to flatten
    51         double roi_lat_min = 48.336808;
    52         double roi_lat_max = 48.370467;
    53         double roi_lon_min = 11.736750;
    54         double roi_lon_max = 11.835322;
     54        osg::Vec4d modificationROI = osg::Vec4d( 48.336808, 48.370467, 11.736750, 11.835322 );          // roi_lat_min, roi_lat_max, roi_lon_min, roi_lon_max
    5555
    5656        // Determine extend of the tile.
     
    6161
    6262        // Check if tile is fully or partially inside ROI:
    63         if(lat_max>roi_lat_min && lat_min<roi_lat_max                   // lat inside ROI
    64                 && lon_max>roi_lon_min && lon_min<roi_lon_max ) // lon inside ROI
     63        if(lat_max>modificationROI[0] && lat_min<modificationROI[1]                     // lat inside ROI?
     64                && lon_max>modificationROI[2] && lon_min<modificationROI[3] )   // lon inside ROI?
    6565        {
    66                 technique->modifyHeightfield(h, lat_min, lat_max, lon_min, lon_max);
     66                _technique->modifyHeightfield( modificationROI, h, osg::Vec4d(lat_min, lat_max, lon_min, lon_max) );
    6767        }
    6868}
Note: See TracChangeset for help on using the changeset viewer.