mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 04:24:47 +02:00
removed level param from recursion
This commit is contained in:
parent
62c933140d
commit
1831cc0de3
7 changed files with 49 additions and 52 deletions
|
@ -1298,7 +1298,7 @@ struct SendVoxelsOperationArgs {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
bool Application::sendVoxelsOperation(VoxelNode* node, int level, void* extraData) {
|
bool Application::sendVoxelsOperation(VoxelNode* node, void* extraData) {
|
||||||
SendVoxelsOperationArgs* args = (SendVoxelsOperationArgs*)extraData;
|
SendVoxelsOperationArgs* args = (SendVoxelsOperationArgs*)extraData;
|
||||||
if (node->isColored()) {
|
if (node->isColored()) {
|
||||||
unsigned char* nodeOctalCode = node->getOctalCode();
|
unsigned char* nodeOctalCode = node->getOctalCode();
|
||||||
|
|
|
@ -170,7 +170,7 @@ private:
|
||||||
const char* nodeTypes, int numNodeTypes);
|
const char* nodeTypes, int numNodeTypes);
|
||||||
|
|
||||||
static void sendVoxelServerAddScene();
|
static void sendVoxelServerAddScene();
|
||||||
static bool sendVoxelsOperation(VoxelNode* node, int level, void* extraData);
|
static bool sendVoxelsOperation(VoxelNode* node, void* extraData);
|
||||||
static void sendVoxelEditMessage(PACKET_HEADER header, VoxelDetail& detail);
|
static void sendVoxelEditMessage(PACKET_HEADER header, VoxelDetail& detail);
|
||||||
static void sendAvatarVoxelURLMessage(const QUrl& url);
|
static void sendAvatarVoxelURLMessage(const QUrl& url);
|
||||||
static void processAvatarVoxelURLMessage(unsigned char *packetData, size_t dataBytes);
|
static void processAvatarVoxelURLMessage(unsigned char *packetData, size_t dataBytes);
|
||||||
|
|
|
@ -701,7 +701,7 @@ void VoxelSystem::killLocalVoxels() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool VoxelSystem::randomColorOperation(VoxelNode* node, int level, void* extraData) {
|
bool VoxelSystem::randomColorOperation(VoxelNode* node, void* extraData) {
|
||||||
_nodeCount++;
|
_nodeCount++;
|
||||||
if (node->isColored()) {
|
if (node->isColored()) {
|
||||||
nodeColor newColor = { 255, randomColorValue(150), randomColorValue(150), 1 };
|
nodeColor newColor = { 255, randomColorValue(150), randomColorValue(150), 1 };
|
||||||
|
@ -717,7 +717,7 @@ void VoxelSystem::randomizeVoxelColors() {
|
||||||
setupNewVoxelsForDrawing();
|
setupNewVoxelsForDrawing();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VoxelSystem::falseColorizeRandomOperation(VoxelNode* node, int level, void* extraData) {
|
bool VoxelSystem::falseColorizeRandomOperation(VoxelNode* node, void* extraData) {
|
||||||
_nodeCount++;
|
_nodeCount++;
|
||||||
// always false colorize
|
// always false colorize
|
||||||
node->setFalseColor(255, randomColorValue(150), randomColorValue(150));
|
node->setFalseColor(255, randomColorValue(150), randomColorValue(150));
|
||||||
|
@ -731,7 +731,7 @@ void VoxelSystem::falseColorizeRandom() {
|
||||||
setupNewVoxelsForDrawing();
|
setupNewVoxelsForDrawing();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VoxelSystem::trueColorizeOperation(VoxelNode* node, int level, void* extraData) {
|
bool VoxelSystem::trueColorizeOperation(VoxelNode* node, void* extraData) {
|
||||||
_nodeCount++;
|
_nodeCount++;
|
||||||
node->setFalseColored(false);
|
node->setFalseColored(false);
|
||||||
return true;
|
return true;
|
||||||
|
@ -746,7 +746,7 @@ void VoxelSystem::trueColorize() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Will false colorize voxels that are not in view
|
// Will false colorize voxels that are not in view
|
||||||
bool VoxelSystem::falseColorizeInViewOperation(VoxelNode* node, int level, void* extraData) {
|
bool VoxelSystem::falseColorizeInViewOperation(VoxelNode* node, void* extraData) {
|
||||||
const ViewFrustum* viewFrustum = (const ViewFrustum*) extraData;
|
const ViewFrustum* viewFrustum = (const ViewFrustum*) extraData;
|
||||||
_nodeCount++;
|
_nodeCount++;
|
||||||
if (node->isColored()) {
|
if (node->isColored()) {
|
||||||
|
@ -766,7 +766,7 @@ void VoxelSystem::falseColorizeInView(ViewFrustum* viewFrustum) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Will false colorize voxels based on distance from view
|
// Will false colorize voxels based on distance from view
|
||||||
bool VoxelSystem::falseColorizeDistanceFromViewOperation(VoxelNode* node, int level, void* extraData) {
|
bool VoxelSystem::falseColorizeDistanceFromViewOperation(VoxelNode* node, void* extraData) {
|
||||||
ViewFrustum* viewFrustum = (ViewFrustum*) extraData;
|
ViewFrustum* viewFrustum = (ViewFrustum*) extraData;
|
||||||
if (node->isColored()) {
|
if (node->isColored()) {
|
||||||
float distance = node->distanceToCamera(*viewFrustum);
|
float distance = node->distanceToCamera(*viewFrustum);
|
||||||
|
@ -789,7 +789,7 @@ float VoxelSystem::_minDistance = FLT_MAX;
|
||||||
// Helper function will get the distance from view range, would be nice if you could just keep track
|
// Helper function will get the distance from view range, would be nice if you could just keep track
|
||||||
// of this as voxels are created and/or colored... seems like some transform math could do that so
|
// of this as voxels are created and/or colored... seems like some transform math could do that so
|
||||||
// we wouldn't need to do two passes of the tree
|
// we wouldn't need to do two passes of the tree
|
||||||
bool VoxelSystem::getDistanceFromViewRangeOperation(VoxelNode* node, int level, void* extraData) {
|
bool VoxelSystem::getDistanceFromViewRangeOperation(VoxelNode* node, void* extraData) {
|
||||||
ViewFrustum* viewFrustum = (ViewFrustum*) extraData;
|
ViewFrustum* viewFrustum = (ViewFrustum*) extraData;
|
||||||
// only do this for truly colored voxels...
|
// only do this for truly colored voxels...
|
||||||
if (node->isColored()) {
|
if (node->isColored()) {
|
||||||
|
@ -842,7 +842,7 @@ public:
|
||||||
|
|
||||||
// "Remove" voxels from the tree that are not in view. We don't actually delete them,
|
// "Remove" voxels from the tree that are not in view. We don't actually delete them,
|
||||||
// we remove them from the tree and place them into a holding area for later deletion
|
// we remove them from the tree and place them into a holding area for later deletion
|
||||||
bool VoxelSystem::removeOutOfViewOperation(VoxelNode* node, int level, void* extraData) {
|
bool VoxelSystem::removeOutOfViewOperation(VoxelNode* node, void* extraData) {
|
||||||
removeOutOfViewArgs* args = (removeOutOfViewArgs*)extraData;
|
removeOutOfViewArgs* args = (removeOutOfViewArgs*)extraData;
|
||||||
|
|
||||||
// If our node was previously added to the don't recurse bag, then return false to
|
// If our node was previously added to the don't recurse bag, then return false to
|
||||||
|
@ -977,7 +977,7 @@ public:
|
||||||
bool colorThis;
|
bool colorThis;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool VoxelSystem::falseColorizeRandomEveryOtherOperation(VoxelNode* node, int level, void* extraData) {
|
bool VoxelSystem::falseColorizeRandomEveryOtherOperation(VoxelNode* node, void* extraData) {
|
||||||
falseColorizeRandomEveryOtherArgs* args = (falseColorizeRandomEveryOtherArgs*)extraData;
|
falseColorizeRandomEveryOtherArgs* args = (falseColorizeRandomEveryOtherArgs*)extraData;
|
||||||
args->totalNodes++;
|
args->totalNodes++;
|
||||||
if (node->isColored()) {
|
if (node->isColored()) {
|
||||||
|
@ -1030,7 +1030,7 @@ public:
|
||||||
bool hasIndexFound[MAX_VOXELS_PER_SYSTEM];
|
bool hasIndexFound[MAX_VOXELS_PER_SYSTEM];
|
||||||
};
|
};
|
||||||
|
|
||||||
bool VoxelSystem::collectStatsForTreesAndVBOsOperation(VoxelNode* node, int level, void* extraData) {
|
bool VoxelSystem::collectStatsForTreesAndVBOsOperation(VoxelNode* node, void* extraData) {
|
||||||
collectStatsForTreesAndVBOsArgs* args = (collectStatsForTreesAndVBOsArgs*)extraData;
|
collectStatsForTreesAndVBOsArgs* args = (collectStatsForTreesAndVBOsArgs*)extraData;
|
||||||
args->totalNodes++;
|
args->totalNodes++;
|
||||||
|
|
||||||
|
@ -1182,7 +1182,7 @@ struct FalseColorizeSubTreeOperationArgs {
|
||||||
long voxelsTouched;
|
long voxelsTouched;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool VoxelSystem::falseColorizeSubTreeOperation(VoxelNode* node, int level, void* extraData) {
|
bool VoxelSystem::falseColorizeSubTreeOperation(VoxelNode* node, void* extraData) {
|
||||||
if (node->getShouldRender()) {
|
if (node->getShouldRender()) {
|
||||||
FalseColorizeSubTreeOperationArgs* args = (FalseColorizeSubTreeOperationArgs*) extraData;
|
FalseColorizeSubTreeOperationArgs* args = (FalseColorizeSubTreeOperationArgs*) extraData;
|
||||||
node->setFalseColor(args->color[0], args->color[1], args->color[2]);
|
node->setFalseColor(args->color[0], args->color[1], args->color[2]);
|
||||||
|
@ -1191,7 +1191,7 @@ bool VoxelSystem::falseColorizeSubTreeOperation(VoxelNode* node, int level, void
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VoxelSystem::falseColorizeOccludedOperation(VoxelNode* node, int level, void* extraData) {
|
bool VoxelSystem::falseColorizeOccludedOperation(VoxelNode* node, void* extraData) {
|
||||||
|
|
||||||
FalseColorizeOccludedArgs* args = (FalseColorizeOccludedArgs*) extraData;
|
FalseColorizeOccludedArgs* args = (FalseColorizeOccludedArgs*) extraData;
|
||||||
args->totalVoxels++;
|
args->totalVoxels++;
|
||||||
|
@ -1228,7 +1228,7 @@ bool VoxelSystem::falseColorizeOccludedOperation(VoxelNode* node, int level, voi
|
||||||
subArgs.color[2] = 0;
|
subArgs.color[2] = 0;
|
||||||
subArgs.voxelsTouched = 0;
|
subArgs.voxelsTouched = 0;
|
||||||
|
|
||||||
args->tree->recurseNodeWithOperation(node, level, falseColorizeSubTreeOperation, &subArgs );
|
args->tree->recurseNodeWithOperation(node, falseColorizeSubTreeOperation, &subArgs );
|
||||||
|
|
||||||
args->subtreeVoxelsSkipped += (subArgs.voxelsTouched - 1);
|
args->subtreeVoxelsSkipped += (subArgs.voxelsTouched - 1);
|
||||||
args->totalVoxels += (subArgs.voxelsTouched - 1);
|
args->totalVoxels += (subArgs.voxelsTouched - 1);
|
||||||
|
@ -1312,7 +1312,7 @@ void VoxelSystem::falseColorizeOccluded() {
|
||||||
setupNewVoxelsForDrawing();
|
setupNewVoxelsForDrawing();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VoxelSystem::falseColorizeOccludedV2Operation(VoxelNode* node, int level, void* extraData) {
|
bool VoxelSystem::falseColorizeOccludedV2Operation(VoxelNode* node, void* extraData) {
|
||||||
|
|
||||||
FalseColorizeOccludedArgs* args = (FalseColorizeOccludedArgs*) extraData;
|
FalseColorizeOccludedArgs* args = (FalseColorizeOccludedArgs*) extraData;
|
||||||
args->totalVoxels++;
|
args->totalVoxels++;
|
||||||
|
@ -1349,7 +1349,7 @@ bool VoxelSystem::falseColorizeOccludedV2Operation(VoxelNode* node, int level, v
|
||||||
subArgs.color[2] = 0;
|
subArgs.color[2] = 0;
|
||||||
subArgs.voxelsTouched = 0;
|
subArgs.voxelsTouched = 0;
|
||||||
|
|
||||||
args->tree->recurseNodeWithOperation(node, level, falseColorizeSubTreeOperation, &subArgs );
|
args->tree->recurseNodeWithOperation(node, falseColorizeSubTreeOperation, &subArgs );
|
||||||
|
|
||||||
args->subtreeVoxelsSkipped += (subArgs.voxelsTouched - 1);
|
args->subtreeVoxelsSkipped += (subArgs.voxelsTouched - 1);
|
||||||
args->totalVoxels += (subArgs.voxelsTouched - 1);
|
args->totalVoxels += (subArgs.voxelsTouched - 1);
|
||||||
|
|
|
@ -120,18 +120,18 @@ private:
|
||||||
bool _renderWarningsOn;
|
bool _renderWarningsOn;
|
||||||
// Operation functions for tree recursion methods
|
// Operation functions for tree recursion methods
|
||||||
static int _nodeCount;
|
static int _nodeCount;
|
||||||
static bool randomColorOperation(VoxelNode* node, int level, void* extraData);
|
static bool randomColorOperation(VoxelNode* node, void* extraData);
|
||||||
static bool falseColorizeRandomOperation(VoxelNode* node, int level, void* extraData);
|
static bool falseColorizeRandomOperation(VoxelNode* node, void* extraData);
|
||||||
static bool trueColorizeOperation(VoxelNode* node, int level, void* extraData);
|
static bool trueColorizeOperation(VoxelNode* node, void* extraData);
|
||||||
static bool falseColorizeInViewOperation(VoxelNode* node, int level, void* extraData);
|
static bool falseColorizeInViewOperation(VoxelNode* node, void* extraData);
|
||||||
static bool falseColorizeDistanceFromViewOperation(VoxelNode* node, int level, void* extraData);
|
static bool falseColorizeDistanceFromViewOperation(VoxelNode* node, void* extraData);
|
||||||
static bool getDistanceFromViewRangeOperation(VoxelNode* node, int level, void* extraData);
|
static bool getDistanceFromViewRangeOperation(VoxelNode* node, void* extraData);
|
||||||
static bool removeOutOfViewOperation(VoxelNode* node, int level, void* extraData);
|
static bool removeOutOfViewOperation(VoxelNode* node, void* extraData);
|
||||||
static bool falseColorizeRandomEveryOtherOperation(VoxelNode* node, int level, void* extraData);
|
static bool falseColorizeRandomEveryOtherOperation(VoxelNode* node, void* extraData);
|
||||||
static bool collectStatsForTreesAndVBOsOperation(VoxelNode* node, int level, void* extraData);
|
static bool collectStatsForTreesAndVBOsOperation(VoxelNode* node, void* extraData);
|
||||||
static bool falseColorizeOccludedOperation(VoxelNode* node, int level, void* extraData);
|
static bool falseColorizeOccludedOperation(VoxelNode* node, void* extraData);
|
||||||
static bool falseColorizeSubTreeOperation(VoxelNode* node, int level, void* extraData);
|
static bool falseColorizeSubTreeOperation(VoxelNode* node, void* extraData);
|
||||||
static bool falseColorizeOccludedV2Operation(VoxelNode* node, int level, void* extraData);
|
static bool falseColorizeOccludedV2Operation(VoxelNode* node, void* extraData);
|
||||||
|
|
||||||
|
|
||||||
int updateNodeInArraysAsFullVBO(VoxelNode* node);
|
int updateNodeInArraysAsFullVBO(VoxelNode* node);
|
||||||
|
|
|
@ -64,7 +64,6 @@ void VoxelTree::recurseTreeWithOperationDistanceSortedTimed(PointerStack* stackO
|
||||||
RecurseVoxelTreeOperation operation,
|
RecurseVoxelTreeOperation operation,
|
||||||
const glm::vec3& point, void* extraData) {
|
const glm::vec3& point, void* extraData) {
|
||||||
|
|
||||||
int ignored = 0;
|
|
||||||
long long start = usecTimestampNow();
|
long long start = usecTimestampNow();
|
||||||
|
|
||||||
// start case, stack empty, so start with root...
|
// start case, stack empty, so start with root...
|
||||||
|
@ -75,7 +74,7 @@ void VoxelTree::recurseTreeWithOperationDistanceSortedTimed(PointerStack* stackO
|
||||||
VoxelNode* node = (VoxelNode*)stackOfNodes->top();
|
VoxelNode* node = (VoxelNode*)stackOfNodes->top();
|
||||||
stackOfNodes->pop();
|
stackOfNodes->pop();
|
||||||
|
|
||||||
if (operation(node, ignored, extraData)) {
|
if (operation(node, extraData)) {
|
||||||
|
|
||||||
//sortChildren... CLOSEST to FURTHEST
|
//sortChildren... CLOSEST to FURTHEST
|
||||||
// determine the distance sorted order of our children
|
// determine the distance sorted order of our children
|
||||||
|
@ -120,18 +119,16 @@ void VoxelTree::recurseTreeWithOperationDistanceSortedTimed(PointerStack* stackO
|
||||||
// stops recursion if operation function returns false.
|
// stops recursion if operation function returns false.
|
||||||
void VoxelTree::recurseTreeWithOperation(RecurseVoxelTreeOperation operation, void* extraData) {
|
void VoxelTree::recurseTreeWithOperation(RecurseVoxelTreeOperation operation, void* extraData) {
|
||||||
int level = 0;
|
int level = 0;
|
||||||
recurseNodeWithOperation(rootNode, level, operation, extraData);
|
recurseNodeWithOperation(rootNode, operation, extraData);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Recurses voxel node with an operation function
|
// Recurses voxel node with an operation function
|
||||||
void VoxelTree::recurseNodeWithOperation(VoxelNode* node, int& level, RecurseVoxelTreeOperation operation, void* extraData) {
|
void VoxelTree::recurseNodeWithOperation(VoxelNode* node, RecurseVoxelTreeOperation operation, void* extraData) {
|
||||||
if (operation(node, level, extraData)) {
|
if (operation(node, extraData)) {
|
||||||
for (int i = 0; i < NUMBER_OF_CHILDREN; i++) {
|
for (int i = 0; i < NUMBER_OF_CHILDREN; i++) {
|
||||||
VoxelNode* child = node->getChildAtIndex(i);
|
VoxelNode* child = node->getChildAtIndex(i);
|
||||||
if (child) {
|
if (child) {
|
||||||
level++;
|
recurseNodeWithOperation(child, operation, extraData);
|
||||||
recurseNodeWithOperation(child, level, operation, extraData);
|
|
||||||
level--;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -142,14 +139,13 @@ void VoxelTree::recurseNodeWithOperation(VoxelNode* node, int& level, RecurseVox
|
||||||
void VoxelTree::recurseTreeWithOperationDistanceSorted(RecurseVoxelTreeOperation operation,
|
void VoxelTree::recurseTreeWithOperationDistanceSorted(RecurseVoxelTreeOperation operation,
|
||||||
const glm::vec3& point, void* extraData) {
|
const glm::vec3& point, void* extraData) {
|
||||||
|
|
||||||
int level = 0;
|
recurseNodeWithOperationDistanceSorted(rootNode, operation, point, extraData);
|
||||||
recurseNodeWithOperationDistanceSorted(rootNode, level, operation, point, extraData);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Recurses voxel node with an operation function
|
// Recurses voxel node with an operation function
|
||||||
void VoxelTree::recurseNodeWithOperationDistanceSorted(VoxelNode* node, int& level, RecurseVoxelTreeOperation operation,
|
void VoxelTree::recurseNodeWithOperationDistanceSorted(VoxelNode* node, RecurseVoxelTreeOperation operation,
|
||||||
const glm::vec3& point, void* extraData) {
|
const glm::vec3& point, void* extraData) {
|
||||||
if (operation(node, level, extraData)) {
|
if (operation(node, extraData)) {
|
||||||
// determine the distance sorted order of our children
|
// determine the distance sorted order of our children
|
||||||
VoxelNode* sortedChildren[NUMBER_OF_CHILDREN];
|
VoxelNode* sortedChildren[NUMBER_OF_CHILDREN];
|
||||||
float distancesToChildren[NUMBER_OF_CHILDREN];
|
float distancesToChildren[NUMBER_OF_CHILDREN];
|
||||||
|
@ -174,9 +170,7 @@ void VoxelTree::recurseNodeWithOperationDistanceSorted(VoxelNode* node, int& lev
|
||||||
if (childNode) {
|
if (childNode) {
|
||||||
//printLog("recurseNodeWithOperationDistanceSorted() PROCESSING child[%d] distance=%f...\n", i, distancesToChildren[i]);
|
//printLog("recurseNodeWithOperationDistanceSorted() PROCESSING child[%d] distance=%f...\n", i, distancesToChildren[i]);
|
||||||
//childNode->printDebugDetails("");
|
//childNode->printDebugDetails("");
|
||||||
level++;
|
recurseNodeWithOperationDistanceSorted(childNode, operation, point, extraData);
|
||||||
recurseNodeWithOperationDistanceSorted(childNode, level, operation, point, extraData);
|
|
||||||
level--;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -921,7 +915,7 @@ public:
|
||||||
bool found;
|
bool found;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool findRayIntersectionOp(VoxelNode* node, int level, void* extraData) {
|
bool findRayIntersectionOp(VoxelNode* node, void* extraData) {
|
||||||
RayArgs* args = static_cast<RayArgs*>(extraData);
|
RayArgs* args = static_cast<RayArgs*>(extraData);
|
||||||
AABox box = node->getAABox();
|
AABox box = node->getAABox();
|
||||||
float distance;
|
float distance;
|
||||||
|
@ -957,7 +951,7 @@ public:
|
||||||
bool found;
|
bool found;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool findSpherePenetrationOp(VoxelNode* node, int level, void* extraData) {
|
bool findSpherePenetrationOp(VoxelNode* node, void* extraData) {
|
||||||
SphereArgs* args = static_cast<SphereArgs*>(extraData);
|
SphereArgs* args = static_cast<SphereArgs*>(extraData);
|
||||||
|
|
||||||
// coarse check against bounds
|
// coarse check against bounds
|
||||||
|
@ -994,7 +988,7 @@ public:
|
||||||
bool found;
|
bool found;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool findCapsulePenetrationOp(VoxelNode* node, int level, void* extraData) {
|
bool findCapsulePenetrationOp(VoxelNode* node, void* extraData) {
|
||||||
CapsuleArgs* args = static_cast<CapsuleArgs*>(extraData);
|
CapsuleArgs* args = static_cast<CapsuleArgs*>(extraData);
|
||||||
|
|
||||||
// coarse check against bounds
|
// coarse check against bounds
|
||||||
|
@ -1672,7 +1666,7 @@ unsigned long VoxelTree::getVoxelCount() {
|
||||||
return nodeCount;
|
return nodeCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VoxelTree::countVoxelsOperation(VoxelNode* node, int level, void* extraData) {
|
bool VoxelTree::countVoxelsOperation(VoxelNode* node, void* extraData) {
|
||||||
(*(unsigned long*)extraData)++;
|
(*(unsigned long*)extraData)++;
|
||||||
return true; // keep going
|
return true; // keep going
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
#include "PointerStack.h"
|
#include "PointerStack.h"
|
||||||
|
|
||||||
// Callback function, for recuseTreeWithOperation
|
// Callback function, for recuseTreeWithOperation
|
||||||
typedef bool (*RecurseVoxelTreeOperation)(VoxelNode* node, int level, void* extraData);
|
typedef bool (*RecurseVoxelTreeOperation)(VoxelNode* node, void* extraData);
|
||||||
typedef enum {GRADIENT, RANDOM, NATURAL} creationMode;
|
typedef enum {GRADIENT, RANDOM, NATURAL} creationMode;
|
||||||
|
|
||||||
#define NO_EXISTS_BITS false
|
#define NO_EXISTS_BITS false
|
||||||
|
@ -147,8 +147,8 @@ public:
|
||||||
|
|
||||||
bool getShouldReaverage() const { return _shouldReaverage; }
|
bool getShouldReaverage() const { return _shouldReaverage; }
|
||||||
|
|
||||||
void recurseNodeWithOperation(VoxelNode* node, int& level, RecurseVoxelTreeOperation operation, void* extraData);
|
void recurseNodeWithOperation(VoxelNode* node, RecurseVoxelTreeOperation operation, void* extraData);
|
||||||
void recurseNodeWithOperationDistanceSorted(VoxelNode* node, int& level, RecurseVoxelTreeOperation operation,
|
void recurseNodeWithOperationDistanceSorted(VoxelNode* node, RecurseVoxelTreeOperation operation,
|
||||||
const glm::vec3& point, void* extraData);
|
const glm::vec3& point, void* extraData);
|
||||||
|
|
||||||
|
|
||||||
|
@ -167,7 +167,7 @@ private:
|
||||||
VoxelNode* node, const ViewFrustum& viewFrustum, VoxelNodeBag& bag,
|
VoxelNode* node, const ViewFrustum& viewFrustum, VoxelNodeBag& bag,
|
||||||
bool deltaViewFrustum, const ViewFrustum* lastViewFrustum);
|
bool deltaViewFrustum, const ViewFrustum* lastViewFrustum);
|
||||||
|
|
||||||
static bool countVoxelsOperation(VoxelNode* node, int level, void* extraData);
|
static bool countVoxelsOperation(VoxelNode* node, void* extraData);
|
||||||
|
|
||||||
VoxelNode* nodeForOctalCode(VoxelNode* ancestorNode, unsigned char* needleCode, VoxelNode** parentOfFoundNode) const;
|
VoxelNode* nodeForOctalCode(VoxelNode* ancestorNode, unsigned char* needleCode, VoxelNode** parentOfFoundNode) const;
|
||||||
VoxelNode* createMissingNode(VoxelNode* lastParentNode, unsigned char* deepestCodeToCreate);
|
VoxelNode* createMissingNode(VoxelNode* lastParentNode, unsigned char* deepestCodeToCreate);
|
||||||
|
|
|
@ -415,6 +415,9 @@ void deepestLevelVoxelDistributor(NodeList* nodeList,
|
||||||
if (nodeData->nodeBag.isEmpty()) {
|
if (nodeData->nodeBag.isEmpty()) {
|
||||||
nodeData->updateLastKnownViewFrustum();
|
nodeData->updateLastKnownViewFrustum();
|
||||||
nodeData->setViewSent(true);
|
nodeData->setViewSent(true);
|
||||||
|
if (::debugVoxelSending) {
|
||||||
|
nodeData->map.printStats();
|
||||||
|
}
|
||||||
nodeData->map.erase(); // It would be nice if we could save this, and only reset it when the view frustum changes
|
nodeData->map.erase(); // It would be nice if we could save this, and only reset it when the view frustum changes
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -808,7 +811,7 @@ struct CountSubTreeOperationArgs {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
bool scanTreeWithOcclusionOperation(VoxelNode* node, int level, void* extraData) {
|
bool scanTreeWithOcclusionOperation(VoxelNode* node, void* extraData) {
|
||||||
|
|
||||||
ScanTreeArgs* args = (ScanTreeArgs*) extraData;
|
ScanTreeArgs* args = (ScanTreeArgs*) extraData;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue