code cleanup

This commit is contained in:
ZappoMan 2013-05-01 18:37:14 -07:00
parent 62e7c0383b
commit 015fd05e62
2 changed files with 13 additions and 29 deletions

View file

@ -364,19 +364,12 @@ void VoxelSystem::render() {
glPopMatrix();
}
void VoxelSystem::simulate(float deltaTime) {
}
int VoxelSystem::_nodeCount = 0;
bool VoxelSystem::randomColorOperation(VoxelNode* node, void* extraData) {
_nodeCount++;
if (node->isColored()) {
nodeColor newColor = { 0,0,0,1 };
newColor[0] = randomColorValue(150);
newColor[1] = randomColorValue(150);
newColor[1] = randomColorValue(150);
nodeColor newColor = { randomColorValue(150), randomColorValue(150), randomColorValue(150), 1 };
node->setColor(newColor);
}
return true;
@ -392,10 +385,7 @@ void VoxelSystem::randomizeVoxelColors() {
bool VoxelSystem::falseColorizeRandomOperation(VoxelNode* node, void* extraData) {
_nodeCount++;
// always false colorize
unsigned char newR = randomColorValue(150);
unsigned char newG = randomColorValue(150);
unsigned char newB = randomColorValue(150);
node->setFalseColor(newR,newG,newB);
node->setFalseColor(randomColorValue(150), randomColorValue(150), randomColorValue(150));
return true; // keep going!
}
@ -426,10 +416,7 @@ bool VoxelSystem::falseColorizeInViewOperation(VoxelNode* node, void* extraData)
if (node->isColored()) {
if (!node->isInView(*viewFrustum)) {
// Out of view voxels are colored RED
unsigned char newR = 255;
unsigned char newG = 0;
unsigned char newB = 0;
node->setFalseColor(newR,newG,newB);
node->setFalseColor(255, 0, 0);
}
}
return true; // keep going!
@ -455,10 +442,7 @@ bool VoxelSystem::falseColorizeDistanceFromViewOperation(VoxelNode* node, void*
const unsigned char colorBands = 16;
const unsigned char gradientOver = 128;
unsigned char colorBand = (colorBands * distanceRatio);
unsigned char newR = (colorBand*(gradientOver/colorBands))+(maxColor-gradientOver);
unsigned char newG = 0;
unsigned char newB = 0;
node->setFalseColor(newR,newG,newB);
node->setFalseColor((colorBand * (gradientOver / colorBands)) + (maxColor - gradientOver), 0, 0);
}
return true; // keep going!
}

View file

@ -33,7 +33,7 @@ public:
void setViewFrustum(ViewFrustum* viewFrustum) { _viewFrustum = viewFrustum; };
void init();
void simulate(float deltaTime);
void simulate(float deltaTime) { };
void render();
unsigned long getVoxelsUpdated() const {return _voxelsUpdated;};