Merge pull request #930 from LionTurtle/master

Fix for copy/cut/paste single voxel leaves.
This commit is contained in:
ZappoMan 2013-09-13 09:18:46 -07:00
commit 3441199f0b

View file

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