Merge branch 'master' of github.com:worklist/hifi

This commit is contained in:
Stephen Birarda 2013-03-29 09:17:46 -07:00
commit 0388218a5d
3 changed files with 7 additions and 3 deletions

View file

@ -97,6 +97,7 @@ bool VoxelNode::collapseIdenticalLeaves() {
if (allChildrenMatch) {
printf("allChildrenMatch: pruning tree\n");
for (int i = 0; i < 8; i++) {
delete children[i]; // delete all the child nodes
children[i]=NULL; // set it to NULL

View file

@ -394,7 +394,7 @@ void VoxelTree::reaverageVoxelColors(VoxelNode *startNode) {
}
if (hasChildren) {
bool childrenCollapsed = startNode->collapseIdenticalLeaves();
bool childrenCollapsed = false;//startNode->collapseIdenticalLeaves();
if (!childrenCollapsed) {
startNode->setColorFromAverageOfChildren();
}
@ -528,7 +528,7 @@ void VoxelTree::createSphere(float r,float xc, float yc, float zc, float s, bool
// only use our actual desired color on the outer edge, otherwise
// use our "average" color
if (ri+(s*2.0)>=r) {
printf("painting candy shell radius: ri=%f r=%f\n",ri,r);
//printf("painting candy shell radius: ri=%f r=%f\n",ri,r);
red = wantColorRandomizer ? randomColorValue(165) : r1+((r2-r1)*gradient);
green = wantColorRandomizer ? randomColorValue(165) : g1+((g2-g1)*gradient);
blue = wantColorRandomizer ? randomColorValue(165) : b1+((b2-b1)*gradient);
@ -536,9 +536,12 @@ void VoxelTree::createSphere(float r,float xc, float yc, float zc, float s, bool
unsigned char* voxelData = pointToVoxel(x,y,z,s,red,green,blue);
this->readCodeColorBufferToTree(voxelData);
printf("voxel data for x:%f y:%f z:%f s:%f\n",x,y,z,s);
printVoxelCode(voxelData);
delete voxelData;
}
}
}
this->reaverageVoxelColors(this->rootNode);
this->printTreeForDebugging(this->rootNode);
}

View file

@ -52,7 +52,7 @@ void addSphere(VoxelTree * tree,bool random, bool wantColorRandomizer) {
float xc = random ? randFloatInRange(r,(1-r)) : 0.5;
float yc = random ? randFloatInRange(r,(1-r)) : 0.5;
float zc = random ? randFloatInRange(r,(1-r)) : 0.5;
float s = (1.0/32); // size of voxels to make up surface of sphere
float s = (1.0/16); // size of voxels to make up surface of sphere
bool solid = true;
printf("adding sphere:");