Changeset 290


Ignore:
Timestamp:
May 30, 2011, 8:03:34 AM (14 years ago)
Author:
Torben Dannhauer
Message:
 
Location:
experimental/TerrainTest
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • experimental/TerrainTest/ModificationVisitor.cpp

    r289 r290  
    2525
    2626        // Set ROI to flatten and estimated height after correction
    27         _technique->setModifiedHeight(300);     // 450
     27        _technique->setModifiedHeight(450);     // 450
    2828
    2929        ModificationManager::getInstance()->addTerrainToManage( new osgTerrain::Terrain() );
  • experimental/TerrainTest/rampedEllipsoidTechnique.cpp

    r289 r290  
    3030void rampedEllipsoidTechnique::modifyHeightfield(region& modificationROI, osg::HeightField* h, region tileExtends)
    3131{
    32         OSG_NOTIFY( osg::ALWAYS ) << "rampedEllipsoidTechnique::modifyHeightfield()" << std::endl;
     32        //OSG_NOTIFY( osg::ALWAYS ) << "rampedEllipsoidTechnique::modifyHeightfield()" << std::endl;
    3333        //OSG_NOTIFY( osg::ALWAYS ) << "LAT: " << tileExtends._lat_min << " | " << tileExtends._lat_max << std::endl;
    3434        //OSG_NOTIFY( osg::ALWAYS ) << "LON: " << tileExtends._lon_min << " | " << tileExtends._lon_max << std::endl;
     
    5757        clampValue(Y_endCore, Y_start, Y_end);
    5858        clampValue(Y_endRamp, Y_start, Y_end);
    59         OSG_NOTIFY( osg::ALWAYS ) << "Y_startRamp:" << Y_startRamp << " Y_startCore:" << Y_startCore << " Y_endCore:" << Y_endCore << " Y_endRamp:" << Y_endRamp << std::endl;
     59        //OSG_NOTIFY( osg::ALWAYS ) << "Y_startRamp:" << Y_startRamp << " Y_startCore:" << Y_startCore << " Y_endCore:" << Y_endCore << " Y_endRamp:" << Y_endRamp << std::endl;
    6060
    6161        // Lon
     
    6969        clampValue(X_endCore, X_start, X_end);
    7070        clampValue(X_endRamp, X_start, X_end);
    71         OSG_NOTIFY( osg::ALWAYS ) << "X_startRamp:" << X_startRamp << " X_startCore:" << X_startCore << " X_endCore:" << X_endCore << " X_endRamp:" << X_endRamp << std::endl;
     71        //OSG_NOTIFY( osg::ALWAYS ) << "X_startRamp:" << X_startRamp << " X_startCore:" << X_startCore << " X_endCore:" << X_endCore << " X_endRamp:" << X_endRamp << std::endl;
    7272
    7373        // Modify height value of affected vertices in the core ROI
     
    8484                        // preset offset value to max and let every ramp function try to lower it...
    8585                        double current_vertex_delta = std::numeric_limits<double>::max();
    86                         double destination_height = _height;
    8786
    8887                        // Calculate vertex height according to the region it is in.
    89                         //if( Y_startCore<=y && y<=Y_endCore && X_startCore<=x && x<=X_endCore )        // If vertex is inside core: Apply final height
    90                         //{
    91                         //      destination_height = _height;
    92                         //}
    93                         // Startramp
    94                         if(Y_startRamp<=y && y<=Y_startCore) // Vertex is inside Y start ramp
     88                        //// Estimated height in the core ROI
     89                        double destination_height = _height;
     90                        //// Startramp
     91                        if(Y_startRamp<=y && y<=Y_startCore && Y_startRamp != Y_startCore) // Vertex is inside Y start ramp
    9592                        {
    9693                                double delta_s = abs(modificationROI._lat_min-vertex_lat);
     
    104101                                }
    105102                        }
    106                         if(X_startRamp<=x && x<=X_startCore)    // Vertex is inside X start ramp
     103                        if(X_startRamp<=x && x<=X_startCore && X_startRamp != X_startCore)      // Vertex is inside X start ramp
    107104                        {
    108105                                double delta_s = abs(modificationROI._lon_min-vertex_lon);
     
    116113                                }
    117114                        }
    118                         // End ramp
    119                         if(Y_endCore<=y && y<=Y_endRamp)  // Vertex is inside Y end ramp
     115                        //// End ramp
     116                        if(Y_endCore<=y && y<=Y_endRamp && Y_endCore != Y_endRamp)  // Vertex is inside Y end ramp
    120117                        {
    121118                                double delta_s = abs(modificationROI._lat_max-vertex_lat);
     
    129126                                }
    130127                        }
    131                         if (X_endCore<=x && x<=X_endRamp) // Vertex is inside X end ramp
     128                        if (X_endCore<=x && x<=X_endRamp && X_endCore != X_endRamp) // Vertex is inside X end ramp
    132129                        {
    133130                                double delta_s = abs(modificationROI._lon_max-vertex_lon);
     
    143140                       
    144141                        // Set height to calculated value
    145                         OSG_NOTIFY( osg::ALWAYS ) << "rampedEllipsoidTechnique: X,Y:"<<x<<","<<y<<" destination_height=" << destination_height << std::endl;
     142                        //OSG_NOTIFY( osg::ALWAYS ) << "rampedEllipsoidTechnique: X,Y:"<<x<<","<<y<<" destination_height=" << destination_height << std::endl;
    146143                        h->setHeight( x, y, destination_height);
    147144                }
Note: See TracChangeset for help on using the changeset viewer.