Changeset 271


Ignore:
Timestamp:
Mar 9, 2011, 8:14:32 AM (13 years ago)
Author:
Torben Dannhauer
Message:

now both available terrainModificationTechniques are refactored to use the region class.

Location:
experimental/TerrainTest
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • experimental/TerrainTest/ellipsoidTechnique.cpp

    r265 r271  
    1111}
    1212
    13 void ellipsoidTechnique::modifyHeightfield(osg::Vec4d& modificationROI, osg::HeightField* h, osg::Vec4d tileExtends)
     13void ellipsoidTechnique::modifyHeightfield(region& modificationROI, osg::HeightField* h, region tileExtends)
    1414{
    1515        //OSG_NOTIFY( osg::ALWAYS ) << "ellipsoidTechnique::modifyHeightfield()" << std::endl;
    16         //OSG_NOTIFY( osg::ALWAYS ) << "LAT: " << tileExtends[0] << " | " << tileExtends[1] << std::endl;
    17         //OSG_NOTIFY( osg::ALWAYS ) << "LON: " << tileExtends[2] << " | " << tileExtends[3] << std::endl;
     16        //OSG_NOTIFY( osg::ALWAYS ) << "LAT: " << tileExtends._lat_min << " | " << tileExtends._lat_max << std::endl;
     17        //OSG_NOTIFY( osg::ALWAYS ) << "LON: " << tileExtends._lon_min << " | " << tileExtends._lon_max << std::endl;
    1818
    1919        // calculate colum start/end and row start/end of affected vertices
     
    2222       
    2323        // Determine loop variables..
    24         if(tileExtends[0]<modificationROI[0])
    25                 startY = (modificationROI[0] - tileExtends[0]) / h->getYInterval();
    26         if(tileExtends[1]>modificationROI[1])
    27                 endY = (modificationROI[1] - tileExtends[0]) / h->getYInterval();
     24        if(tileExtends._lat_min<modificationROI._lat_min)
     25                startY = (modificationROI._lat_min - tileExtends._lat_min) / h->getYInterval();
     26        if(tileExtends._lat_max>modificationROI._lat_max)
     27                endY = (modificationROI._lat_max - tileExtends._lat_min) / h->getYInterval();
    2828
    29         if(tileExtends[2]<modificationROI[2])
    30                 startX = (modificationROI[2] - tileExtends[2]) / h->getXInterval();
    31         if(tileExtends[3]>modificationROI[3])
    32                 endX = (modificationROI[3] - tileExtends[2]) / h->getXInterval();
     29        if(tileExtends._lon_min<modificationROI._lon_min)
     30                startX = (modificationROI._lon_min - tileExtends._lon_min) / h->getXInterval();
     31        if(tileExtends._lon_max>modificationROI._lon_max)
     32                endX = (modificationROI._lon_max - tileExtends._lon_min) / h->getXInterval();
    3333
    3434
  • experimental/TerrainTest/ellipsoidTechnique.h

    r264 r271  
    99        ~ellipsoidTechnique();
    1010
    11         void modifyHeightfield(osg::Vec4d& modificationROI, osg::HeightField* h, osg::Vec4d tileExtends);
     11        void modifyHeightfield(region& modificationROI, osg::HeightField* h, region tileExtends);
    1212        void setModifiedHeight(double height) {_height=height;}
    1313
Note: See TracChangeset for help on using the changeset viewer.