summaryrefslogtreecommitdiff
path: root/indra/newview/llvovolume.cpp
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2011-01-19 21:17:38 -0700
committerXiaohong Bao <bao@lindenlab.com>2011-01-19 21:17:38 -0700
commit47e31543932815adf89712229c0ad71b17d8a0f1 (patch)
tree47b2df33ebcc30b6162afbf8325c85656bd5e3d6 /indra/newview/llvovolume.cpp
parentc46cbafb15ff48515fdff8f1fd78b99391ddd4d7 (diff)
fix for SH-730: sculpted prim attachment shapes on impostored avatars load very slowly
Diffstat (limited to 'indra/newview/llvovolume.cpp')
-rw-r--r--indra/newview/llvovolume.cpp32
1 files changed, 23 insertions, 9 deletions
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 858e0321e1..f67e3a9770 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -669,11 +669,32 @@ void LLVOVolume::updateTextures()
}
}
+BOOL LLVOVolume::isVisible() const
+{
+ if(mDrawable.notNull() && mDrawable->isVisible())
+ {
+ return TRUE ;
+ }
+
+ if(isAttachment())
+ {
+ LLViewerObject* objp = (LLViewerObject*)getParent() ;
+ while(objp && !objp->isAvatar())
+ {
+ objp = (LLViewerObject*)objp->getParent() ;
+ }
+
+ return objp && objp->mDrawable.notNull() && objp->mDrawable->isVisible() ;
+ }
+
+ return FALSE ;
+}
+
void LLVOVolume::updateTextureVirtualSize()
{
// Update the pixel area of all faces
- if(mDrawable.isNull() || !mDrawable->isVisible())
+ if(!isVisible())
{
return ;
}
@@ -2740,14 +2761,7 @@ void LLVOVolume::updateRadius()
BOOL LLVOVolume::isAttachment() const
{
- if (mState == 0)
- {
- return FALSE;
- }
- else
- {
- return TRUE;
- }
+ return mState != 0 ;
}
BOOL LLVOVolume::isHUDAttachment() const