From Andrew Sampson, "The terravista terrain generation tool can insert references to external model files into a terrapage tile. It unfortunately does not update the bounding sphere of that tile to include the extents of the external model. This means that if a large model (such as an airfield model) is attached to a tile, the model will disappear when the tile is off-screen (outside the view volume), even though the model is on-screen."
This commit is contained in:
@@ -100,3 +100,18 @@ void TXPPagedLOD::traverse(osg::NodeVisitor& nv)
|
||||
}
|
||||
}
|
||||
|
||||
osg::BoundingSphere TXPPagedLOD::computeBound() const
|
||||
{
|
||||
// Force calculation of entire bounding sphere; this will include any
|
||||
// externally-referenced models which are attached to the tile.
|
||||
// If this is not done, then externally referenced models will disappear
|
||||
// when the tile they are attached to leaves the view volume.
|
||||
osg::BoundingSphere result = osg::Group::computeBound();
|
||||
|
||||
if (_centerMode==USER_DEFINED_CENTER && _radius>=0.0f)
|
||||
{
|
||||
float tempRadius = std::max( _radius, result.radius() );
|
||||
result = osg::BoundingSphere(_userDefinedCenter,tempRadius);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -58,6 +58,7 @@ namespace txp
|
||||
|
||||
TileIdentifier _tileIdentifier;
|
||||
|
||||
virtual osg::BoundingSphere computeBound() const;
|
||||
|
||||
protected:
|
||||
virtual ~TXPPagedLOD();
|
||||
|
||||
Reference in New Issue
Block a user