Changeset 290
- Timestamp:
- May 30, 2011, 8:03:34 AM (13 years ago)
- Location:
- experimental/TerrainTest
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
experimental/TerrainTest/ModificationVisitor.cpp
r289 r290 25 25 26 26 // Set ROI to flatten and estimated height after correction 27 _technique->setModifiedHeight( 300); // 45027 _technique->setModifiedHeight(450); // 450 28 28 29 29 ModificationManager::getInstance()->addTerrainToManage( new osgTerrain::Terrain() ); -
experimental/TerrainTest/rampedEllipsoidTechnique.cpp
r289 r290 30 30 void rampedEllipsoidTechnique::modifyHeightfield(region& modificationROI, osg::HeightField* h, region tileExtends) 31 31 { 32 OSG_NOTIFY( osg::ALWAYS ) << "rampedEllipsoidTechnique::modifyHeightfield()" << std::endl;32 //OSG_NOTIFY( osg::ALWAYS ) << "rampedEllipsoidTechnique::modifyHeightfield()" << std::endl; 33 33 //OSG_NOTIFY( osg::ALWAYS ) << "LAT: " << tileExtends._lat_min << " | " << tileExtends._lat_max << std::endl; 34 34 //OSG_NOTIFY( osg::ALWAYS ) << "LON: " << tileExtends._lon_min << " | " << tileExtends._lon_max << std::endl; … … 57 57 clampValue(Y_endCore, Y_start, Y_end); 58 58 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; 60 60 61 61 // Lon … … 69 69 clampValue(X_endCore, X_start, X_end); 70 70 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; 72 72 73 73 // Modify height value of affected vertices in the core ROI … … 84 84 // preset offset value to max and let every ramp function try to lower it... 85 85 double current_vertex_delta = std::numeric_limits<double>::max(); 86 double destination_height = _height;87 86 88 87 // 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 95 92 { 96 93 double delta_s = abs(modificationROI._lat_min-vertex_lat); … … 104 101 } 105 102 } 106 if(X_startRamp<=x && x<=X_startCore ) // Vertex is inside X start ramp103 if(X_startRamp<=x && x<=X_startCore && X_startRamp != X_startCore) // Vertex is inside X start ramp 107 104 { 108 105 double delta_s = abs(modificationROI._lon_min-vertex_lon); … … 116 113 } 117 114 } 118 // End ramp119 if(Y_endCore<=y && y<=Y_endRamp ) // Vertex is inside Y end ramp115 //// End ramp 116 if(Y_endCore<=y && y<=Y_endRamp && Y_endCore != Y_endRamp) // Vertex is inside Y end ramp 120 117 { 121 118 double delta_s = abs(modificationROI._lat_max-vertex_lat); … … 129 126 } 130 127 } 131 if (X_endCore<=x && x<=X_endRamp ) // Vertex is inside X end ramp128 if (X_endCore<=x && x<=X_endRamp && X_endCore != X_endRamp) // Vertex is inside X end ramp 132 129 { 133 130 double delta_s = abs(modificationROI._lon_max-vertex_lon); … … 143 140 144 141 // 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; 146 143 h->setHeight( x, y, destination_height); 147 144 }
Note: See TracChangeset
for help on using the changeset viewer.