mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 21:48:46 +02:00
remove debugging on voxel deletion
This commit is contained in:
parent
53108b01ef
commit
e7e7bd290a
1 changed files with 1 additions and 15 deletions
|
@ -192,37 +192,23 @@ void VoxelTree::deleteVoxelCodeFromTree(unsigned char *codeBuffer) {
|
||||||
VoxelNode* parentNode = NULL;
|
VoxelNode* parentNode = NULL;
|
||||||
VoxelNode* nodeToDelete = nodeForOctalCode(rootNode, codeBuffer, &parentNode);
|
VoxelNode* nodeToDelete = nodeForOctalCode(rootNode, codeBuffer, &parentNode);
|
||||||
|
|
||||||
printf("deleteVoxelCodeFromTree() looking [codeBuffer] for:\n");
|
|
||||||
printOctalCode(codeBuffer);
|
|
||||||
|
|
||||||
printf("deleteVoxelCodeFromTree() found [nodeToDelete->octalCode] for:\n");
|
|
||||||
printOctalCode(nodeToDelete->octalCode);
|
|
||||||
|
|
||||||
// If the node exists...
|
// If the node exists...
|
||||||
int lengthInBytes = bytesRequiredForCodeLength(*codeBuffer); // includes octet count, not color!
|
int lengthInBytes = bytesRequiredForCodeLength(*codeBuffer); // includes octet count, not color!
|
||||||
printf("compare octal codes of length %d\n",lengthInBytes);
|
|
||||||
|
|
||||||
if (0==memcmp(nodeToDelete->octalCode,codeBuffer,lengthInBytes)) {
|
if (0 == memcmp(nodeToDelete->octalCode,codeBuffer,lengthInBytes)) {
|
||||||
printf("found node to delete...\n");
|
|
||||||
|
|
||||||
float* vertices = firstVertexForCode(nodeToDelete->octalCode);
|
float* vertices = firstVertexForCode(nodeToDelete->octalCode);
|
||||||
printf("deleting voxel at: %f,%f,%f\n",vertices[0],vertices[1],vertices[2]);
|
|
||||||
delete []vertices;
|
delete []vertices;
|
||||||
|
|
||||||
if (parentNode) {
|
if (parentNode) {
|
||||||
float* vertices = firstVertexForCode(parentNode->octalCode);
|
float* vertices = firstVertexForCode(parentNode->octalCode);
|
||||||
printf("parent of deleting voxel at: %f,%f,%f\n",vertices[0],vertices[1],vertices[2]);
|
|
||||||
delete []vertices;
|
delete []vertices;
|
||||||
|
|
||||||
int childNDX = branchIndexWithDescendant(parentNode->octalCode, codeBuffer);
|
int childNDX = branchIndexWithDescendant(parentNode->octalCode, codeBuffer);
|
||||||
printf("child INDEX=%d\n",childNDX);
|
|
||||||
|
|
||||||
printf("deleting Node at parentNode->children[%d]\n",childNDX);
|
|
||||||
delete parentNode->children[childNDX]; // delete the child nodes
|
delete parentNode->children[childNDX]; // delete the child nodes
|
||||||
printf("setting parentNode->children[%d] to NULL\n",childNDX);
|
|
||||||
parentNode->children[childNDX]=NULL; // set it to NULL
|
parentNode->children[childNDX]=NULL; // set it to NULL
|
||||||
|
|
||||||
printf("reaverageVoxelColors()\n");
|
|
||||||
reaverageVoxelColors(rootNode); // Fix our colors!! Need to call it on rootNode
|
reaverageVoxelColors(rootNode); // Fix our colors!! Need to call it on rootNode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue