Ignore:
Timestamp:
Dec 1, 2010, 8:23:26 PM (13 years ago)
Author:
Torben Dannhauer
Message:

Step1: modifying terrain with arbitrary values: done :)
Step2: modify with the corresponding values: todo :)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • experimental/TerrainTest/myTerrainTechnique.cpp

    r168 r169  
    2020}
    2121
    22 void myTerrainTechnique::update(osgUtil::UpdateVisitor* uv)
     22void myTerrainTechnique::init(int dirtyMask, bool assumeMultiThreaded)
    2323{
     24        /* The heightfield es extracted from the tile in the techniques init function. technique->init() calls  technique->generateGeometry() which creates the drawable according to the heightfield.
     25        To modify the height, the heightfield must be modified prior to the original techniques init() function.
     26
     27        To modiy the drawable shape (e.g. Cutting wholes in the area), the function technique->generateGeometry() must be modified.
     28        */
     29
    2430        HeightFieldLayer* hfl = dynamic_cast<HeightFieldLayer*>( getTerrainTile()->getElevationLayer() );
    2531        osg::HeightField* h = hfl->getHeightField();
    2632        h->setHeight( 0,0, 1000);
    2733
    28     GeometryTechnique::update( uv);
     34    GeometryTechnique::init(dirtyMask, assumeMultiThreaded);
    2935}
Note: See TracChangeset for help on using the changeset viewer.