mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 04:44:11 +02:00
Merge pull request #930 from LionTurtle/master
Fix for copy/cut/paste single voxel leaves.
This commit is contained in:
commit
3441199f0b
1 changed files with 8 additions and 7 deletions
|
@ -1772,6 +1772,14 @@ void VoxelTree::copySubTreeIntoNewTree(VoxelNode* startNode, VoxelTree* destinat
|
|||
ReadBitstreamToTreeParams args(WANT_COLOR, NO_EXISTS_BITS);
|
||||
destinationTree->readBitstreamToTree(&outputBuffer[0], bytesWritten, args);
|
||||
}
|
||||
|
||||
VoxelNode* destinationStartNode;
|
||||
if (rebaseToRoot) {
|
||||
destinationStartNode = destinationTree->rootNode;
|
||||
} else {
|
||||
destinationStartNode = nodeForOctalCode(destinationTree->rootNode, startNode->getOctalCode(), NULL);
|
||||
}
|
||||
destinationStartNode->setColor(startNode->getColor());
|
||||
}
|
||||
|
||||
void VoxelTree::copyFromTreeIntoSubTree(VoxelTree* sourceTree, VoxelNode* destinationNode) {
|
||||
|
@ -2041,13 +2049,6 @@ void VoxelTree::nudgeSubTree(VoxelNode* nodeToNudge, const glm::vec3& nudgeAmoun
|
|||
return;
|
||||
}
|
||||
|
||||
// get octal code of this node
|
||||
unsigned char* octalCode = nodeToNudge->getOctalCode();
|
||||
|
||||
// get voxel position/size
|
||||
VoxelPositionSize ancestorDetails;
|
||||
voxelDetailsForCode(octalCode, ancestorDetails);
|
||||
|
||||
NodeChunkArgs args;
|
||||
args.thisVoxelTree = this;
|
||||
args.nudgeVec = nudgeAmount;
|
||||
|
|
Loading…
Reference in a new issue