mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 08:04:01 +02:00
Merge (but don't clear redundant nodes) after reading subdivisions.
This commit is contained in:
parent
60e8c12d4b
commit
9d55100087
1 changed files with 5 additions and 1 deletions
|
@ -767,7 +767,7 @@ void MetavoxelNode::mergeChildren(const AttributePointer& attribute, bool postRe
|
|||
childValues[i] = _children[i]->_attributeValue;
|
||||
allLeaves &= _children[i]->isLeaf();
|
||||
}
|
||||
if (attribute->merge(_attributeValue, childValues, postRead) && allLeaves) {
|
||||
if (attribute->merge(_attributeValue, childValues, postRead) && allLeaves && !postRead) {
|
||||
clearChildren(attribute);
|
||||
}
|
||||
}
|
||||
|
@ -917,6 +917,7 @@ bool MetavoxelNode::readSubdivision(MetavoxelStreamState& state) {
|
|||
_children[i] = new MetavoxelNode(state.attribute);
|
||||
_children[i]->read(nextState);
|
||||
}
|
||||
mergeChildren(state.attribute, true);
|
||||
return true;
|
||||
|
||||
} else {
|
||||
|
@ -932,6 +933,9 @@ bool MetavoxelNode::readSubdivision(MetavoxelStreamState& state) {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (changed) {
|
||||
mergeChildren(state.attribute, true);
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue