size-cull parent entities by their queryAABox rather than their dimensions to avoid having the entity-server send a child but not the parent

This commit is contained in:
Seth Alves 2016-02-10 16:41:35 -08:00
parent 8e16bda7bb
commit 1ae47b17f0

View file

@ -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.