mirror of
https://github.com/overte-org/overte.git
synced 2025-04-22 17:53:32 +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
|
@ -148,15 +148,20 @@ OctreeElement::AppendState ModelTreeElement::appendElementData(OctreePacketData*
|
|||
delete elementExtraEncodeData;
|
||||
}
|
||||
}
|
||||
|
||||
// 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
|
||||
bool successUpdateModelCount = true;
|
||||
if (numberOfModels != actualNumberOfModels) {
|
||||
if (!noModelsFit && numberOfModels != actualNumberOfModels) {
|
||||
successUpdateModelCount = packetData->updatePriorBytes(numberOfModelsOffset,
|
||||
(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);
|
||||
appendElementState = OctreeElement::NONE;
|
||||
} else {
|
||||
|
|
|
@ -1598,7 +1598,6 @@ int Octree::encodeTreeBitstreamRecursion(OctreeElement* element,
|
|||
// and assume that the appendElementData() has stored any required state data
|
||||
// in the params extraEncodeData
|
||||
if (elementAppendState == OctreeElement::PARTIAL) {
|
||||
qDebug() << "elementAppendState == OctreeElement::PARTIAL... bag.insert(element).....";
|
||||
bag.insert(element);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue