From 1ae47b17f0181ab2a6137ab64fcf9bfd9605f02a Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Wed, 10 Feb 2016 16:41:35 -0800 Subject: [PATCH] size-cull parent entities by their queryAABox rather than their dimensions to avoid having the entity-server send a child but not the parent --- libraries/entities/src/EntityTreeElement.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libraries/entities/src/EntityTreeElement.cpp b/libraries/entities/src/EntityTreeElement.cpp index 1e798f2e0c..5ae3d562b6 100644 --- a/libraries/entities/src/EntityTreeElement.cpp +++ b/libraries/entities/src/EntityTreeElement.cpp @@ -313,7 +313,11 @@ OctreeElement::AppendState EntityTreeElement::appendElementData(OctreePacketData // 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. if (includeThisEntity) { - AABox entityBounds = entity->getAABox(success); + success = true; + // we can't cull a parent-entity by it's dimensions because the child may be larger. we need to + // avoid sending details about a child but not the parent. the parent's queryAACube should have + // been adjusted to encompase the queryAACube of the child. + AABox entityBounds = entity->hasChildren() ? AABox(entityCube) : entity->getAABox(success); if (!success) { // if this entity is a child of an avatar, the entity-server wont be able to determine its // AABox. If this happens, fall back to the queryAACube.