mirror of
https://github.com/overte-org/overte.git
synced 2025-07-23 14:04:23 +02:00
handle some models don't fit better
This commit is contained in:
parent
6389fea320
commit
12d30e9d62
2 changed files with 7 additions and 3 deletions
|
@ -149,14 +149,19 @@ OctreeElement::AppendState ModelTreeElement::appendElementData(OctreePacketData*
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Determine if no models at all were able to fit
|
||||||
|
bool noModelsFit = (numberOfModels > 0 && actualNumberOfModels == 0);
|
||||||
|
|
||||||
// If we wrote fewer models than we expected, update the number of models in our packet
|
// If we wrote fewer models than we expected, update the number of models in our packet
|
||||||
bool successUpdateModelCount = true;
|
bool successUpdateModelCount = true;
|
||||||
if (numberOfModels != actualNumberOfModels) {
|
if (!noModelsFit && numberOfModels != actualNumberOfModels) {
|
||||||
successUpdateModelCount = packetData->updatePriorBytes(numberOfModelsOffset,
|
successUpdateModelCount = packetData->updatePriorBytes(numberOfModelsOffset,
|
||||||
(const unsigned char*)&actualNumberOfModels, sizeof(actualNumberOfModels));
|
(const unsigned char*)&actualNumberOfModels, sizeof(actualNumberOfModels));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!successUpdateModelCount) {
|
// If we weren't able to update our model count, or we couldn't fit any models, then
|
||||||
|
// we should discard our element and return a result of NONE
|
||||||
|
if (!successUpdateModelCount || noModelsFit) {
|
||||||
packetData->discardLevel(elementLevel);
|
packetData->discardLevel(elementLevel);
|
||||||
appendElementState = OctreeElement::NONE;
|
appendElementState = OctreeElement::NONE;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1598,7 +1598,6 @@ int Octree::encodeTreeBitstreamRecursion(OctreeElement* element,
|
||||||
// and assume that the appendElementData() has stored any required state data
|
// and assume that the appendElementData() has stored any required state data
|
||||||
// in the params extraEncodeData
|
// in the params extraEncodeData
|
||||||
if (elementAppendState == OctreeElement::PARTIAL) {
|
if (elementAppendState == OctreeElement::PARTIAL) {
|
||||||
qDebug() << "elementAppendState == OctreeElement::PARTIAL... bag.insert(element).....";
|
|
||||||
bag.insert(element);
|
bag.insert(element);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue