Added TerrainNode::init() and s/getTreatBoundariesToValidDataAsDefaultValue flag.

This commit is contained in:
Robert Osfield
2007-05-13 09:54:51 +00:00
parent 91ddcdf531
commit b97d8c0fe0
5 changed files with 35 additions and 4 deletions

View File

@@ -39,6 +39,8 @@ class OSGTERRAIN_EXPORT TerrainNode : public osg::Group
virtual void traverse(osg::NodeVisitor& nv);
/** Call init on any attached TerrainTechnique.*/
void init();
/** Set the TerrainTechnique*/
void setTerrainTechnique(osgTerrain::TerrainTechnique* TerrainTechnique);
@@ -105,13 +107,20 @@ class OSGTERRAIN_EXPORT TerrainNode : public osg::Group
unsigned int getNumColorLayers() const { return _colorLayers.size(); }
/** Set whether the TerrainTechnique should create per vertex normals for lighting purposes.*/
/** Set hint to whether the TerrainTechnique should create per vertex normals for lighting purposes.*/
void setRequiresNormals(bool flag) { _requiresNormals = flag; }
/** Get whether the TerrainTechnique should create per vertex normals for lighting purposes.*/
bool getRequiresNormals() const { return _requiresNormals; }
/** Set the hint to whether the TerrainTechnique should treat the invalid Layer entries that at are neigbours to valid entries with the default value.*/
void setTreatBoundariesToValidDataAsDefaultValue(bool flag) { _treatBoundariesToValidDataAsDefaultValue = flag; }
/** Get whether the TeatBoundariesToValidDataAsDefaultValue hint.*/
bool getTreatBoundariesToValidDataAsDefaultValue() const { return _treatBoundariesToValidDataAsDefaultValue; }
/** Compute the bounding volume of the terrain by computing the union of the bounding volumes of all layers.*/
virtual osg::BoundingSphere computeBound() const;
@@ -152,6 +161,7 @@ class OSGTERRAIN_EXPORT TerrainNode : public osg::Group
Layers _colorLayers;
bool _requiresNormals;
bool _treatBoundariesToValidDataAsDefaultValue;
};
}

View File

@@ -51,9 +51,12 @@ class OSGTERRAIN_EXPORT TerrainTechnique : public osg::Object
/** Traverse the terain subgraph.*/
virtual void traverse(osg::NodeVisitor& nv);
/** Dirty so that cached data structurese are updated.*/
/** Dirty so that cached data structurese will be updated on next use.*/
virtual void dirty();
/** Return true if cached data structurese need updating.*/
virtual bool isDirty() const { return _dirty; }
protected:
virtual ~TerrainTechnique();