summaryrefslogtreecommitdiff
path: root/indra/newview/llvoavatar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llvoavatar.cpp')
-rw-r--r--indra/newview/llvoavatar.cpp27
1 files changed, 18 insertions, 9 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index b04bb99b97..797f2d27ce 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -1554,7 +1554,8 @@ void LLVOAvatar::calculateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax)
size.setSub(newMax,newMin);
size.mul(0.5f);
- mPixelArea = LLPipeline::calcPixelArea(center, size, *LLViewerCamera::getInstance());
+ F32 pixel_area = LLPipeline::calcPixelArea(center, size, *LLViewerCamera::getInstance());
+ setCorrectedPixelArea(pixel_area);
}
void render_sphere_and_line(const LLVector3& begin_pos, const LLVector3& end_pos, F32 sphere_scale, const LLVector3& occ_color, const LLVector3& visible_color)
@@ -5049,6 +5050,8 @@ void LLVOAvatar::updateVisibility()
LL_DEBUGS("AvatarRender") << "visible was " << mVisible << " now " << visible << LL_ENDL;
}
mVisible = visible;
+
+ mVisibilityPreference = visible ? getPixelArea() : 0;
}
// private
@@ -7110,6 +7113,18 @@ void LLVOAvatar::updateVisualParams()
dirtyMesh();
updateHeadOffset();
}
+
+void LLVOAvatar::setCorrectedPixelArea(F32 area)
+{
+ // We always want to look good to ourselves
+ if (isSelf())
+ {
+ area = llmax(area, F32(getTexImageSize() / 16));
+ }
+
+ setPixelArea(area);
+}
+
//-----------------------------------------------------------------------------
// isActive()
//-----------------------------------------------------------------------------
@@ -7137,7 +7152,7 @@ void LLVOAvatar::setPixelAreaAndAngle(LLAgent &agent)
size.mul(0.5f);
mImpostorPixelArea = LLPipeline::calcPixelArea(center, size, *LLViewerCamera::getInstance());
- mPixelArea = mImpostorPixelArea;
+ setCorrectedPixelArea(mImpostorPixelArea);
F32 range = mDrawable->mDistanceWRTCamera;
@@ -7150,12 +7165,6 @@ void LLVOAvatar::setPixelAreaAndAngle(LLAgent &agent)
F32 radius = size.getLength3().getF32();
mAppAngle = (F32) atan2( radius, range) * RAD_TO_DEG;
}
-
- // We always want to look good to ourselves
- if( isSelf() )
- {
- mPixelArea = llmax( mPixelArea, F32(getTexImageSize() / 16) );
- }
}
//-----------------------------------------------------------------------------
@@ -10455,7 +10464,7 @@ void LLVOAvatar::cullAvatarsByPixelArea()
{
LLCharacter::sInstances.sort([](LLCharacter* lhs, LLCharacter* rhs)
{
- return lhs->getPixelArea() > rhs->getPixelArea();
+ return ((LLVOAvatar*)lhs)->mVisibilityPreference > ((LLVOAvatar*)rhs)->mVisibilityPreference;
});
// Update the avatars that have changed status