Fixed bug in osg::LOD::addChild() which was forcing all ranges to be identical

values.
This commit is contained in:
Robert Osfield
2002-10-08 16:02:09 +00:00
parent c59fc9a2b7
commit f210e13944

View File

@@ -42,9 +42,16 @@ void LOD::traverse(NodeVisitor& nv)
bool LOD::addChild( Node *child )
{
float maxRange = 0.0f;
if (!_rangeList.empty()) maxRange=_rangeList.back().second;
return addChild(child,maxRange,maxRange);
if (Group::addChild(child))
{
float maxRange = 0.0f;
if (!_rangeList.empty()) maxRange=_rangeList.back().second;
if (_children.size()>_rangeList.size()) _rangeList.resize(_children.size(),MinMaxPair(maxRange,maxRange));
return true;
}
return false;
}
bool LOD::addChild(Node *child, float min, float max)