mirror of
https://github.com/overte-org/overte.git
synced 2025-07-23 12:24:26 +02:00
Hold onto octree child after creation
This commit is contained in:
parent
30fc9ef3f7
commit
ac30aed948
1 changed files with 4 additions and 4 deletions
|
@ -384,9 +384,10 @@ int Octree::readElementData(OctreeElementPointer destinationElement, const unsig
|
||||||
// check the exists mask to see if we have a child to traverse into
|
// check the exists mask to see if we have a child to traverse into
|
||||||
|
|
||||||
if (oneAtBit(childInBufferMask, childIndex)) {
|
if (oneAtBit(childInBufferMask, childIndex)) {
|
||||||
if (!destinationElement->getChildAtIndex(childIndex)) {
|
auto childAt = destinationElement->getChildAtIndex(childIndex);
|
||||||
|
if (!childAt) {
|
||||||
// add a child at that index, if it doesn't exist
|
// add a child at that index, if it doesn't exist
|
||||||
destinationElement->addChildAtIndex(childIndex);
|
childAt = destinationElement->addChildAtIndex(childIndex);
|
||||||
bool nodeIsDirty = destinationElement->isDirty();
|
bool nodeIsDirty = destinationElement->isDirty();
|
||||||
if (nodeIsDirty) {
|
if (nodeIsDirty) {
|
||||||
_isDirty = true;
|
_isDirty = true;
|
||||||
|
@ -394,8 +395,7 @@ int Octree::readElementData(OctreeElementPointer destinationElement, const unsig
|
||||||
}
|
}
|
||||||
|
|
||||||
// tell the child to read the subsequent data
|
// tell the child to read the subsequent data
|
||||||
int lowerLevelBytes = readElementData(destinationElement->getChildAtIndex(childIndex),
|
int lowerLevelBytes = readElementData(childAt, nodeData + bytesRead, bytesLeftToRead, args);
|
||||||
nodeData + bytesRead, bytesLeftToRead, args);
|
|
||||||
|
|
||||||
bytesRead += lowerLevelBytes;
|
bytesRead += lowerLevelBytes;
|
||||||
bytesLeftToRead -= lowerLevelBytes;
|
bytesLeftToRead -= lowerLevelBytes;
|
||||||
|
|
Loading…
Reference in a new issue