Changeset 168
- Timestamp:
- Nov 26, 2010, 11:55:13 PM (14 years ago)
- Location:
- experimental/TerrainTest
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
experimental/TerrainTest/myTerrainTechnique.cpp
r167 r168 4 4 using namespace osgTerrain; 5 5 6 myTerrainTechnique::myTerrainTechnique(void) 6 myTerrainTechnique::myTerrainTechnique(void) : osgTerrain::GeometryTechnique() 7 7 { 8 //OSG_ALWAYS<<className()<<"Constructed by Constructor"<<std::endl; 8 OSG_ALWAYS<<className()<<"Constructed by Constructor"<<std::endl; 9 9 10 } 10 11 … … 21 22 void myTerrainTechnique::update(osgUtil::UpdateVisitor* uv) 22 23 { 23 //HeightFieldLayer* hfl = dynamic_cast<HeightFieldLayer*>( getTerrainTile()->getElevationLayer() ); 24 //osg::HeightField* h = hfl->getHeightField(); 24 HeightFieldLayer* hfl = dynamic_cast<HeightFieldLayer*>( getTerrainTile()->getElevationLayer() ); 25 osg::HeightField* h = hfl->getHeightField(); 26 h->setHeight( 0,0, 1000); 25 27 26 //float height = h->getHeight( 0,0 ); 27 ////OSG_ALWAYS<<"retrieved height: " << height << std::endl; 28 //height +=50000; 29 //h->setHeight( 0,0, height); 30 //OSG_ALWAYS<<"modified height: " << height << std::endl; 31 ////getTerrainTile()->setDirty( true ); // Neccessary 32 33 34 GeometryTechnique::update( uv); 28 GeometryTechnique::update( uv); 35 29 } -
experimental/TerrainTest/myTileLoadedCallback.cpp
r167 r168 8 8 myTileLoadedCallback::myTileLoadedCallback(osgTerrain::Terrain* terrain) : _terrain(terrain) 9 9 { 10 OSG_ALWAYS << "test";11 10 } 12 11 … … 24 23 { 25 24 //OSG_ALWAYS << "Executing myTileLoadedCallback!" << std::endl; 25 tile->setTerrain( _terrain ); 26 26 tile->setTerrainTechnique( new osgTerrain::myTerrainTechnique() ); 27 //_terrain->updateTerrainTileOnNextFrame(tile);27 _terrain->updateTerrainTileOnNextFrame(tile); 28 28 } 29 29 -
experimental/TerrainTest/osgterrain.cpp
r165 r168 214 214 terrain->setVerticalScale(verticalScale); 215 215 terrain->setBlendingPolicy(blendingPolicy); 216 osg::ref_ptr<osgTerrain::TerrainTechnique> myT = new osgTerrain::myTerrainTechnique();217 terrain->setTerrainTechniquePrototype( myT );216 //osg::ref_ptr<osgTerrain::TerrainTechnique> myT = new osgTerrain::myTerrainTechnique(); 217 //terrain->setTerrainTechniquePrototype( myT ); 218 218 219 219 //// Manually set the terrain technque for a tile ( his example, the first found tile) works, but then the whole database has to be processed
Note: See TracChangeset
for help on using the changeset viewer.