mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 18:44:00 +02:00
add a method to VoxelTree to reaverage the voxel colors
This commit is contained in:
parent
a7f74a9f40
commit
f85abe53ef
2 changed files with 16 additions and 0 deletions
|
@ -384,6 +384,21 @@ void VoxelTree::printTreeForDebugging(VoxelNode *startNode) {
|
|||
}
|
||||
}
|
||||
|
||||
void VoxelTree::reaverageVoxelColors(VoxelNode *startNode) {
|
||||
bool hasChildren;
|
||||
|
||||
for (int i = 0; i < 8; i++) {
|
||||
if (startNode->children[i] != NULL) {
|
||||
reaverageVoxelColors(startNode->children[i]);
|
||||
hasChildren = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (hasChildren) {
|
||||
startNode->setColorFromAverageOfChildren();
|
||||
}
|
||||
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Method: VoxelTree::loadVoxelsFile()
|
||||
// Description: Loads HiFidelity encoded Voxels from a binary file. The current file
|
||||
|
|
|
@ -30,6 +30,7 @@ public:
|
|||
void readBitstreamToTree(unsigned char * bitstream, int bufferSizeBytes);
|
||||
void readCodeColorBufferToTree(unsigned char *codeColorBuffer);
|
||||
void printTreeForDebugging(VoxelNode *startNode);
|
||||
void reaverageVoxelColors(VoxelNode *startNode);
|
||||
unsigned char * loadBitstreamBuffer(unsigned char *& bitstreamBuffer,
|
||||
VoxelNode *currentVoxelNode,
|
||||
MarkerNode *currentMarkerNode,
|
||||
|
|
Loading…
Reference in a new issue