mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
Blend when setting.
This commit is contained in:
parent
d706e23012
commit
dfaa98cc34
2 changed files with 7 additions and 9 deletions
|
@ -803,7 +803,7 @@ void Voxelizer::voxelize(const glm::vec3& center) {
|
|||
qDebug() << "Finished voxelizing " << center.x << center.y << center.z;
|
||||
|
||||
MetavoxelEditMessage edit = { QVariant::fromValue(SetDataEdit(
|
||||
center - glm::vec3(_size, _size, _size) * 0.5f, data, false)) };
|
||||
center - glm::vec3(_size, _size, _size) * 0.5f, data, true)) };
|
||||
QMetaObject::invokeMethod(Application::getInstance()->getMetavoxels(), "applyEdit",
|
||||
Q_ARG(const MetavoxelEditMessage&, edit), Q_ARG(bool, true));
|
||||
}
|
||||
|
|
|
@ -355,14 +355,12 @@ static void setNode(const AttributeValue& value, MetavoxelNode*& node, Metavoxel
|
|||
}
|
||||
OwnedAttributeValue oldValue = node->getAttributeValue(value.getAttribute());
|
||||
node->blendAttributeValues(other->getAttributeValue(value.getAttribute()), oldValue);
|
||||
if (other->isLeaf()) {
|
||||
node->clearChildren(value.getAttribute());
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < MetavoxelNode::CHILD_COUNT; i++) {
|
||||
MetavoxelNode* child = node->getChild(i);
|
||||
setNode(oldValue, child, other->getChild(i), true);
|
||||
node->setChild(i, child);
|
||||
if (!other->isLeaf()) {
|
||||
for (int i = 0; i < MetavoxelNode::CHILD_COUNT; i++) {
|
||||
MetavoxelNode* child = node->getChild(i);
|
||||
setNode(oldValue, child, other->getChild(i), true);
|
||||
node->setChild(i, child);
|
||||
}
|
||||
}
|
||||
node->mergeChildren(value.getAttribute());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue