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:
Robert Osfield
2002-10-06 20:33:13 +00:00
parent 84332f5b77
commit 70861ef70e
19 changed files with 240 additions and 195 deletions

View File

@@ -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];