mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 05:17:02 +02:00
Merge pull request #6879 from sethalves/fix-aa-cube-bug
fix query-cube vs lod bug
This commit is contained in:
commit
b41301d226
2 changed files with 26 additions and 20 deletions
|
@ -218,7 +218,13 @@ bool EntityTree::updateEntityWithElement(EntityItemPointer entity, const EntityI
|
||||||
QString collisionSoundURLBefore = entity->getCollisionSoundURL();
|
QString collisionSoundURLBefore = entity->getCollisionSoundURL();
|
||||||
uint32_t preFlags = entity->getDirtyFlags();
|
uint32_t preFlags = entity->getDirtyFlags();
|
||||||
|
|
||||||
UpdateEntityOperator theOperator(getThisPointer(), containingElement, entity, properties.getQueryAACube());
|
AACube newQueryAACube;
|
||||||
|
if (properties.queryAACubeChanged()) {
|
||||||
|
newQueryAACube = properties.getQueryAACube();
|
||||||
|
} else {
|
||||||
|
newQueryAACube = entity->getQueryAACube();
|
||||||
|
}
|
||||||
|
UpdateEntityOperator theOperator(getThisPointer(), containingElement, entity, newQueryAACube);
|
||||||
recurseTreeWithOperator(&theOperator);
|
recurseTreeWithOperator(&theOperator);
|
||||||
entity->setProperties(properties);
|
entity->setProperties(properties);
|
||||||
|
|
||||||
|
|
|
@ -309,29 +309,29 @@ OctreeElement::AppendState EntityTreeElement::appendElementData(OctreePacketData
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now check the size of the entity, it's possible that a "too small to see" entity is included in a
|
// Now check the size of the entity, it's possible that a "too small to see" entity is included in a
|
||||||
// larger octree cell because of it's position (for example if it crosses the boundary of a cell it
|
// larger octree cell because of its position (for example if it crosses the boundary of a cell it
|
||||||
// pops to the next higher cell. So we want to check to see that the entity is large enough to be seen
|
// pops to the next higher cell. So we want to check to see that the entity is large enough to be seen
|
||||||
// before we consider including it.
|
// before we consider including it.
|
||||||
if (includeThisEntity) {
|
if (includeThisEntity) {
|
||||||
AABox entityBounds = entity->getAABox(success);
|
AABox entityBounds = entity->getAABox(success);
|
||||||
if (success) {
|
if (!success) {
|
||||||
auto renderAccuracy = params.viewFrustum->calculateRenderAccuracy(entityBounds,
|
// if this entity is a child of an avatar, the entity-server wont be able to determine its
|
||||||
params.octreeElementSizeScale, params.boundaryLevelAdjust);
|
// AABox. If this happens, fall back to the queryAACube.
|
||||||
|
entityBounds = AABox(entityCube);
|
||||||
|
}
|
||||||
|
auto renderAccuracy = params.viewFrustum->calculateRenderAccuracy(entityBounds,
|
||||||
|
params.octreeElementSizeScale,
|
||||||
|
params.boundaryLevelAdjust);
|
||||||
|
if (renderAccuracy <= 0.0f) {
|
||||||
|
includeThisEntity = false; // too small, don't include it
|
||||||
|
|
||||||
if (renderAccuracy <= 0.0f) {
|
#ifdef WANT_LOD_DEBUGGING
|
||||||
includeThisEntity = false; // too small, don't include it
|
qDebug() << "skipping entity - TOO SMALL - \n"
|
||||||
|
<< "......id:" << entity->getID() << "\n"
|
||||||
#ifdef WANT_LOD_DEBUGGING
|
<< "....name:" << entity->getName() << "\n"
|
||||||
qDebug() << "skipping entity - TOO SMALL - \n"
|
<< "..bounds:" << entityBounds << "\n"
|
||||||
<< "......id:" << entity->getID() << "\n"
|
<< "....cell:" << getAACube();
|
||||||
<< "....name:" << entity->getName() << "\n"
|
#endif
|
||||||
<< "..bounds:" << entityBounds << "\n"
|
|
||||||
<< "....cell:" << getAACube();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
includeThisEntity = false; // couldn't get box, don't include it
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue