Converted osg::LOD from used n+1 successive ranges to n min/max ranges,
one min/max pair per child. Converted the rest of the OSG to use the new osg::LOD node.
This commit is contained in:
@@ -53,11 +53,7 @@ bool Switch::addChild( Node *child )
|
||||
bool Switch::removeChild( Node *child )
|
||||
{
|
||||
// find the child's position.
|
||||
unsigned int pos=0;
|
||||
for (;pos<_children.size();++pos)
|
||||
{
|
||||
if (_children[pos]==child) break;
|
||||
}
|
||||
unsigned int pos=findChildNo(child);
|
||||
if (pos==_children.size()) return false;
|
||||
|
||||
_values.erase(_values.begin()+pos);
|
||||
@@ -74,11 +70,7 @@ void Switch::setValue(unsigned int pos,bool value)
|
||||
void Switch::setValue(const Node* child,bool value)
|
||||
{
|
||||
// find the child's position.
|
||||
unsigned int pos=0;
|
||||
for (;pos<_children.size();++pos)
|
||||
{
|
||||
if (_children[pos]==child) break;
|
||||
}
|
||||
unsigned int pos=findChildNo(child);
|
||||
if (pos==_children.size()) return;
|
||||
|
||||
_values[pos]=value;
|
||||
@@ -93,11 +85,7 @@ bool Switch::getValue(unsigned int pos) const
|
||||
bool Switch::getValue(const Node* child) const
|
||||
{
|
||||
// find the child's position.
|
||||
unsigned int pos=0;
|
||||
for (;pos<_children.size();++pos)
|
||||
{
|
||||
if (_children[pos]==child) break;
|
||||
}
|
||||
unsigned int pos=findChildNo(child);
|
||||
if (pos==_children.size()) return false;
|
||||
|
||||
return _values[pos];
|
||||
|
||||
Reference in New Issue
Block a user