Changeset 163


Ignore:
Timestamp:
Nov 24, 2010, 8:58:47 PM (14 years ago)
Author:
Torben Dannhauer
Message:
 
Location:
experimental/TerrainTest
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • experimental/TerrainTest/myTerrainTechnique.cpp

    r162 r163  
    22#include <osgTerrain/TerrainTile>
    33
     4using namespace osgTerrain;
     5
    46myTerrainTechnique::myTerrainTechnique(void)
    57{
     8        OSG_ALWAYS<<className()<<"Constructed by Constructor"<<std::endl;
     9}
     10
     11myTerrainTechnique::myTerrainTechnique(const TerrainTechnique& TerrainTechnique,const osg::CopyOp& copyop):
     12        osgTerrain::TerrainTechnique(TerrainTechnique,copyop)
     13{
     14        OSG_ALWAYS<<className()<<"Constructed by Copy-Constructor"<<std::endl;
    615}
    716
  • experimental/TerrainTest/myTerrainTechnique.h

    r162 r163  
    22
    33#include <osgTerrain/TerrainTechnique>
     4
     5namespace osgTerrain {
    46
    57class myTerrainTechnique : public osgTerrain::TerrainTechnique
     
    79public:
    810        myTerrainTechnique(void);
     11
     12        /** Copy constructor using CopyOp to manage deep vs shallow copy.*/
     13    myTerrainTechnique(const TerrainTechnique&,const osg::CopyOp& copyop=osg::CopyOp::DEEP_COPY_ALL);
     14
     15        META_Object(osgTerrain, myTerrainTechnique);
     16
    917        ~myTerrainTechnique(void);
    1018
    1119        virtual void update(osgUtil::UpdateVisitor* nv);
    1220};
     21
     22}
  • experimental/TerrainTest/osgterrain.cpp

    r162 r163  
    213213    terrain->setVerticalScale(verticalScale);
    214214    terrain->setBlendingPolicy(blendingPolicy);
    215         osg::ref_ptr<myTerrainTechnique> myT = new myTerrainTechnique();
    216         //terrain->setTerrainTechniquePrototype( myT );
    217 
    218         osgTerrain::TerrainTile* tile = findTopMostNodeOfType<osgTerrain::TerrainTile>(rootnode);
     215        osg::ref_ptr<osgTerrain::TerrainTechnique> myT = new osgTerrain::myTerrainTechnique();
     216        terrain->setTerrainTechniquePrototype( myT );
     217
     218        // Manually set the terrain technque for a tile ( his example, the first found tile) works, but then the whole database has to be processed
     219        /*osgTerrain::TerrainTile* tile = findTopMostNodeOfType<osgTerrain::TerrainTile>(rootnode);
    219220        if(tile)
    220221        {
    221222                tile->setTerrainTechnique( myT );
    222         }
     223        }*/
    223224
    224225    // register our custom handler for adjust Terrain settings
Note: See TracChangeset for help on using the changeset viewer.