mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 15:09:34 +02:00
added removeChildAtIndex() which removes a node, but doesn't delete it
This commit is contained in:
parent
17b137cc53
commit
e0d040a73b
2 changed files with 10 additions and 0 deletions
|
@ -89,6 +89,15 @@ void VoxelNode::deleteChildAtIndex(int childIndex) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// does not delete the node!
|
||||||
|
VoxelNode* VoxelNode::removeChildAtIndex(int childIndex) {
|
||||||
|
VoxelNode* returnedChild = _children[childIndex];
|
||||||
|
if (_children[childIndex]) {
|
||||||
|
_children[childIndex] = NULL;
|
||||||
|
}
|
||||||
|
return returnedChild;
|
||||||
|
}
|
||||||
|
|
||||||
void VoxelNode::addChildAtIndex(int childIndex) {
|
void VoxelNode::addChildAtIndex(int childIndex) {
|
||||||
if (!_children[childIndex]) {
|
if (!_children[childIndex]) {
|
||||||
_children[childIndex] = new VoxelNode(childOctalCode(_octalCode, childIndex));
|
_children[childIndex] = new VoxelNode(childOctalCode(_octalCode, childIndex));
|
||||||
|
|
|
@ -43,6 +43,7 @@ public:
|
||||||
unsigned char* getOctalCode() const { return _octalCode; };
|
unsigned char* getOctalCode() const { return _octalCode; };
|
||||||
VoxelNode* getChildAtIndex(int i) const { return _children[i]; };
|
VoxelNode* getChildAtIndex(int i) const { return _children[i]; };
|
||||||
void deleteChildAtIndex(int childIndex);
|
void deleteChildAtIndex(int childIndex);
|
||||||
|
VoxelNode* removeChildAtIndex(int childIndex);
|
||||||
void addChildAtIndex(int childIndex);
|
void addChildAtIndex(int childIndex);
|
||||||
void setColorFromAverageOfChildren();
|
void setColorFromAverageOfChildren();
|
||||||
void setRandomColor(int minimumBrightness);
|
void setRandomColor(int minimumBrightness);
|
||||||
|
|
Loading…
Reference in a new issue