summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerregion.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewerregion.cpp')
-rwxr-xr-xindra/newview/llviewerregion.cpp42
1 files changed, 25 insertions, 17 deletions
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index 64b25f4b0b..d27b37d029 100755
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -910,19 +910,19 @@ void LLViewerRegion::removeActiveCacheEntry(LLVOCacheEntry* entry, LLDrawable* d
return;
}
+ bool is_orphan = false;
+ LLVOCacheEntry* parent = NULL;
if(entry->getParentID() > 0) //is a child
{
- LLVOCacheEntry* parent = getCacheEntry(entry->getParentID());
- if(parent)
- {
- parent->addChild(entry);
- }
- else //parent is not in the cache, put into the orphan list.
+ parent = getCacheEntry(entry->getParentID());
+ if(!parent)
{
+ is_orphan = true;
mOrphanMap[entry->getParentID()].push_back(entry->getLocalID());
}
}
- else //insert to vo cache tree.
+
+ if(!is_orphan)//insert to vo cache tree.
{
//shift to the local regional space from agent space
const LLVector3 pos = drawablep->getVObj()->getPositionRegion();
@@ -931,6 +931,11 @@ void LLViewerRegion::removeActiveCacheEntry(LLVOCacheEntry* entry, LLDrawable* d
shift.setSub(vec, entry->getPositionGroup());
entry->shift(shift);
+ if(parent) //is a child
+ {
+ entry->shift(parent->getPositionGroup());
+ parent->addChild(entry);
+ }
addToVOCacheTree(entry);
}
@@ -965,10 +970,6 @@ void LLViewerRegion::addToVOCacheTree(LLVOCacheEntry* entry)
{
return;
}
- if(entry->getParentID() > 0)
- {
- return; //no child prim in cache octree.
- }
llassert(!entry->getEntry()->hasDrawable());
@@ -992,7 +993,7 @@ void LLViewerRegion::removeFromVOCacheTree(LLVOCacheEntry* entry)
//add the visible entries
void LLViewerRegion::addVisibleCacheEntry(LLVOCacheEntry* entry)
{
- if(mDead || !entry)
+ if(mDead || !entry || !entry->getEntry())
{
return;
}
@@ -1102,7 +1103,8 @@ F32 LLViewerRegion::updateVisibleEntries(F32 max_time)
if(vo_entry->getParentID() > 0) //is a child
{
- //child visibility depends on its parent.
+ //child visibility depends on its parent, force its parent to be visible
+ addVisibleCacheEntry(getCacheEntry(vo_entry->getParentID()));
continue;
}
@@ -1832,21 +1834,22 @@ void LLViewerRegion::decodeBoundingInfo(LLVOCacheEntry* entry)
//1, find the parent in cache
LLVOCacheEntry* parent = getCacheEntry(parent_id);
- //2, parent is not in the cache, put into the orphan list.
- if(!parent)
+ //2, parent is not in the cache or not probed, put into the orphan list.
+ if(!parent || !parent->getEntry())
{
//check if parent is non-cacheable and already created
- if(isNonCacheableObjectCreated(parent_id))
+ if(!parent && isNonCacheableObjectCreated(parent_id))
{
//parent is visible, so is the child.
addVisibleCacheEntry(entry);
}
else
{
+ entry->setBoundingInfo(pos, scale);
mOrphanMap[parent_id].push_back(entry->getLocalID());
}
}
- else //parent in cache
+ else //parent in cache octree or probed
{
if(!parent->isState(LLVOCacheEntry::INACTIVE))
{
@@ -1855,6 +1858,9 @@ void LLViewerRegion::decodeBoundingInfo(LLVOCacheEntry* entry)
}
else
{
+ entry->setBoundingInfo(pos, scale);
+ entry->shift(parent->getPositionGroup());
+ addToVOCacheTree(entry);
parent->addChild(entry);
}
}
@@ -1884,6 +1890,8 @@ void LLViewerRegion::decodeBoundingInfo(LLVOCacheEntry* entry)
LLVOCacheEntry* child = getCacheEntry((*orphans)[i]);
if(child)
{
+ child->shift(entry->getPositionGroup());
+ addToVOCacheTree(child);
entry->addChild(child);
}
}