This commit is contained in:
Shyotl
2012-07-18 00:54:52 -05:00
parent cc5ffafd7c
commit a56ad597d4
13 changed files with 208 additions and 96 deletions

View File

@@ -113,6 +113,7 @@ void LLDrawable::init()
mGeneration = -1;
mBinRadius = 1.f;
mBinIndex = -1;
mSpatialBridge = NULL;
}
@@ -963,6 +964,12 @@ void LLDrawable::updateUVMinMax()
{
}
LLSpatialGroup* LLDrawable::getSpatialGroup() const
{
llassert((mSpatialGroupp == NULL) ? getBinIndex() == -1 : getBinIndex() != -1);
return mSpatialGroupp;
}
void LLDrawable::setSpatialGroup(LLSpatialGroup *groupp)
{
/*if (mSpatialGroupp && (groupp != mSpatialGroupp))
@@ -985,6 +992,8 @@ void LLDrawable::setSpatialGroup(LLSpatialGroup *groupp)
}
mSpatialGroupp = groupp;
llassert((mSpatialGroupp == NULL) ? getBinIndex() == -1 : getBinIndex() != -1);
}
LLSpatialPartition* LLDrawable::getSpatialPartition()
@@ -1107,6 +1116,8 @@ LLSpatialBridge::LLSpatialBridge(LLDrawable* root, BOOL render_by_group, U32 dat
mDrawable = root;
root->setSpatialBridge(this);
mBinIndex = -1;
mRenderType = mDrawable->mRenderType;
mDrawableType = mDrawable->mRenderType;
@@ -1500,7 +1511,13 @@ void LLSpatialBridge::cleanupReferences()
LLDrawable::cleanupReferences();
if (mDrawable)
{
mDrawable->setSpatialGroup(NULL);
LLSpatialGroup* group = mDrawable->getSpatialGroup();
if (group)
{
group->mOctreeNode->remove(mDrawable);
mDrawable->setSpatialGroup(NULL);
}
if (mDrawable->getVObj())
{
LLViewerObject::const_child_list_t& child_list = mDrawable->getVObj()->getChildren();
@@ -1511,7 +1528,12 @@ void LLSpatialBridge::cleanupReferences()
LLDrawable* drawable = child->mDrawable;
if (drawable)
{
drawable->setSpatialGroup(NULL);
LLSpatialGroup* group = drawable->getSpatialGroup();
if (group)
{
group->mOctreeNode->remove(drawable);
drawable->setSpatialGroup(NULL);
}
}
}
}