Changeset 168 for experimental


Ignore:
Timestamp:
Nov 26, 2010, 11:55:13 PM (14 years ago)
Author:
Torben Dannhauer
Message:
 
Location:
experimental/TerrainTest
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • experimental/TerrainTest/myTerrainTechnique.cpp

    r167 r168  
    44using namespace osgTerrain;
    55
    6 myTerrainTechnique::myTerrainTechnique(void)
     6myTerrainTechnique::myTerrainTechnique(void) : osgTerrain::GeometryTechnique()
    77{
    8         //OSG_ALWAYS<<className()<<"Constructed by Constructor"<<std::endl;
     8        OSG_ALWAYS<<className()<<"Constructed by Constructor"<<std::endl;
     9
    910}
    1011
     
    2122void myTerrainTechnique::update(osgUtil::UpdateVisitor* uv)
    2223{
    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);
    2527
    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);
    3529}
  • experimental/TerrainTest/myTileLoadedCallback.cpp

    r167 r168  
    88myTileLoadedCallback::myTileLoadedCallback(osgTerrain::Terrain* terrain) : _terrain(terrain)
    99{
    10  OSG_ALWAYS << "test";
    1110}
    1211
     
    2423{
    2524        //OSG_ALWAYS << "Executing myTileLoadedCallback!" << std::endl;
     25        tile->setTerrain( _terrain );
    2626        tile->setTerrainTechnique( new osgTerrain::myTerrainTechnique() );
    27         //_terrain->updateTerrainTileOnNextFrame(tile);
     27        _terrain->updateTerrainTileOnNextFrame(tile);
    2828}
    2929   
  • experimental/TerrainTest/osgterrain.cpp

    r165 r168  
    214214    terrain->setVerticalScale(verticalScale);
    215215    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 );
    218218
    219219        //// 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.