Added DataSet::s/getSkirtRatio() method to allow control of how deep to
make the skirts around tiles.
This commit is contained in:
@@ -853,6 +853,9 @@ class OSGTERRAIN_EXPORT DataSet : public osg::Referenced
|
||||
void setVerticalScale(float verticalScale) { _verticalScale = verticalScale; }
|
||||
float getVerticalScale() const { return _verticalScale; }
|
||||
|
||||
void setSkirtRatio(float skirtRatio) { _skirtRatio = skirtRatio; }
|
||||
float getSkirtRatio() const { return _skirtRatio; }
|
||||
|
||||
void setDefaultColor(const osg::Vec4& defaultColor) { _defaultColor = defaultColor; }
|
||||
const osg::Vec4& getDefaultColor() const { return _defaultColor; }
|
||||
|
||||
@@ -960,6 +963,7 @@ class OSGTERRAIN_EXPORT DataSet : public osg::Referenced
|
||||
float _maximumVisiableDistanceOfTopLevel;
|
||||
float _radiusToMaxVisibleDistanceRatio;
|
||||
float _verticalScale;
|
||||
float _skirtRatio;
|
||||
|
||||
osg::ref_ptr<osg::CoordinateSystemNode> _destinationCoordinateSystem;
|
||||
osg::ref_ptr<osg::CoordinateSystemNode> _intermediateCoordinateSystem;
|
||||
|
||||
@@ -2014,7 +2014,7 @@ osg::Node* DataSet::DestinationTile::createPolygonal()
|
||||
|
||||
osg::ref_ptr<osg::Vec3Array> n = new osg::Vec3Array(numVertices); // must use ref_ptr so the array isn't removed when smooothvisitor is used
|
||||
|
||||
float skirtRatio = 0.01f;
|
||||
float skirtRatio = _dataSet->getSkirtRatio();
|
||||
osg::Matrixd localToWorld;
|
||||
osg::Matrixd worldToLocal;
|
||||
osg::Vec3 skirtVector(0.0f,0.0f,0.0f);
|
||||
@@ -2338,6 +2338,14 @@ osg::Node* DataSet::DestinationTile::createPolygonal()
|
||||
geometry->setColorArray(colours);
|
||||
geometry->setColorBinding(osg::Geometry::BIND_OVERALL);
|
||||
}
|
||||
|
||||
|
||||
osg::Geode* geode = new osg::Geode;
|
||||
geode->addDrawable(geometry);
|
||||
|
||||
#if 1
|
||||
osgDB::writeNodeFile(*geode,"NodeBeforeSimplification.osg");
|
||||
#endif
|
||||
|
||||
unsigned int targetMaxNumVertices = 2048;
|
||||
float sample_ratio = (numVertices <= targetMaxNumVertices) ? 1.0f : (float)targetMaxNumVertices/(float)numVertices;
|
||||
@@ -2352,8 +2360,6 @@ osg::Node* DataSet::DestinationTile::createPolygonal()
|
||||
tsv.stripify(*geometry);
|
||||
|
||||
|
||||
osg::Geode* geode = new osg::Geode;
|
||||
geode->addDrawable(geometry);
|
||||
|
||||
if (useLocalToTileTransform)
|
||||
{
|
||||
@@ -2800,6 +2806,7 @@ DataSet::DataSet()
|
||||
|
||||
_radiusToMaxVisibleDistanceRatio = 7.0f;
|
||||
_verticalScale = 1.0f;
|
||||
_skirtRatio = 0.02f;
|
||||
|
||||
_convertFromGeographicToGeocentric = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user