From Ryan Kawicki, "There is an issue where the model insets of a terrex terrain are being removed during the loading process. The issue is described below.

- the issue here is that the plugin is removing group nodes if
      that group node only has one child.  becuase transforms are also
      group nodes, there were cases when the transform would have only
      one child under it and would cause it to remove the translation
      portion.  this would cause all the vertex data to be loaded around
      the last matrix operation, which in our case was the origin (0,0,0).

We work off of OSG 2.8.1 but see that this has not been addressed on latest yet.  I’ve tested this against 2.8.1 and have cleanly applied it to my local repository off of latest."



git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14407 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield
2014-08-08 16:42:32 +00:00
parent af5685bf28
commit f0125da6fd

View File

@@ -870,7 +870,9 @@ osg::Node* ReaderWriterTXP::getTileContent(const TXPArchive::TileInfo &info, int
osg::Group* tileGroup = archive->getTileContent(x,y,lod,realMinRange,realMaxRange,usedMaxRange,tileCenter, childrenLoc);
// if group has only one child, then simply use its child.
while (tileGroup->getNumChildren()==1 && tileGroup->getChild(0)->asGroup())
// if the node is a transform, then stop processing so as to not loose the transformation
while (tileGroup && !tileGroup->asTransform() &&
tileGroup->getNumChildren()==1 && tileGroup->getChild(0)->asGroup())
{
tileGroup = tileGroup->getChild(0)->asGroup();
}
@@ -882,7 +884,7 @@ osg::Node* ReaderWriterTXP::getTileContent(const TXPArchive::TileInfo &info, int
doSeam = (lod < (archive->getNumLODs() - 1));
// Handle seams
if (doSeam)
if (tileGroup && doSeam)
{
SeamFinder sfv(x,y,lod,info,archive);
tileGroup->accept(sfv);
@@ -906,13 +908,15 @@ osg::Node* ReaderWriterTXP::getTileContent(const TXPArchive::TileInfo &info, con
osg::Group* tileGroup = archive->getTileContent(loc,realMinRange,realMaxRange,usedMaxRange,tileCenter, childrenLoc);
// if group has only one child, then simply use its child.
while (tileGroup->getNumChildren()==1 && tileGroup->getChild(0)->asGroup())
// if the node is a transform, then stop processing so as to not loose the transformation
while (tileGroup && !tileGroup->asTransform() &&
tileGroup->getNumChildren()==1 && tileGroup->getChild(0)->asGroup())
{
tileGroup = tileGroup->getChild(0)->asGroup();
}
// Handle seams
if (childrenLoc.size() > 0)
if (tileGroup && childrenLoc.size() > 0)
{
SeamFinder sfv(loc.x, loc.y, loc.lod, info, archive);
tileGroup->accept(sfv);