summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llvoavatar.cpp25
-rw-r--r--indra/newview/llvoavatar.h2
-rw-r--r--indra/newview/llvoavatarself.cpp5
3 files changed, 19 insertions, 13 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 4976846790..1d65d85f50 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -2582,6 +2582,7 @@ void LLVOAvatar::idleUpdate(LLAgent &agent, const F64 &time)
if ((LLFrameTimer::getFrameCount() + mID.mData[0]) % compl_upd_freq == 0)
{
+ LL_RECORD_BLOCK_TIME(FTM_AVATAR_UPDATE_COMPLEXITY);
idleUpdateRenderComplexity();
}
idleUpdateDebugInfo();
@@ -2895,7 +2896,10 @@ F32 LLVOAvatar::calcMorphAmount()
void LLVOAvatar::idleUpdateLipSync(bool voice_enabled)
{
// Use the Lipsync_Ooh and Lipsync_Aah morphs for lip sync
- if ( voice_enabled && (LLVoiceClient::getInstance()->lipSyncEnabled()) && LLVoiceClient::getInstance()->getIsSpeaking( mID ) )
+ if ( voice_enabled
+ && mLastRezzedStatus > 0 // no point updating lip-sync for clouds
+ && (LLVoiceClient::getInstance()->lipSyncEnabled())
+ && LLVoiceClient::getInstance()->getIsSpeaking( mID ) )
{
F32 ooh_morph_amount = 0.0f;
F32 aah_morph_amount = 0.0f;
@@ -3893,15 +3897,16 @@ void LLVOAvatar::updateFootstepSounds()
}
//------------------------------------------------------------------------
-// computeUpdatePeriod()
+// computeUpdatePeriodAndVisibility()
// Factored out from updateCharacter()
// Set new value for mUpdatePeriod based on distance and various other factors.
+// Returs true if character needs an update
//------------------------------------------------------------------------
-void LLVOAvatar::computeUpdatePeriod()
+BOOL LLVOAvatar::computeUpdatePeriodAndVisibility()
{
bool visually_muted = isVisuallyMuted();
- if (mDrawable.notNull()
- && isVisible()
+ BOOL is_visible = isVisible(); // includes drawable check
+ if ( is_visible
&& (!isSelf() || visually_muted)
&& !isUIAvatar()
&& sUseImpostors
@@ -3929,6 +3934,11 @@ void LLVOAvatar::computeUpdatePeriod()
{ //background avatars are REALLY slow updating impostors
mUpdatePeriod = 16;
}
+ else if (mLastRezzedStatus <= 0)
+ {
+ // Don't update cloud avatars too often
+ mUpdatePeriod = 8;
+ }
else if ( shouldImpostor(3) )
{ //back 25% of max visible avatars are slow updating impostors
mUpdatePeriod = 8;
@@ -3942,10 +3952,12 @@ void LLVOAvatar::computeUpdatePeriod()
//nearby avatars, update the impostors more frequently.
mUpdatePeriod = 4;
}
+ return (LLDrawable::getCurrentFrame() + mID.mData[0]) % mUpdatePeriod == 0 ? TRUE : FALSE;
}
else
{
mUpdatePeriod = 1;
+ return is_visible;
}
}
@@ -4314,8 +4326,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent)
// The rest should only be done occasionally for far away avatars.
// Set mUpdatePeriod and visible based on distance and other criteria.
//--------------------------------------------------------------------
- computeUpdatePeriod();
- visible = (LLDrawable::getCurrentFrame()+mID.mData[0])%mUpdatePeriod == 0 ? TRUE : FALSE;
+ visible = computeUpdatePeriodAndVisibility();
//--------------------------------------------------------------------
// Early out if not visible and not self
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index aac7a1fae1..cd9cf00488 100644
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -264,7 +264,7 @@ public:
virtual void updateDebugText();
virtual BOOL updateCharacter(LLAgent &agent);
void updateFootstepSounds();
- void computeUpdatePeriod();
+ BOOL computeUpdatePeriodAndVisibility();
void updateOrientation(LLAgent &agent, F32 speed, F32 delta_time);
void updateTimeStep();
void updateRootPositionAndRotation(LLAgent &agent, F32 speed, bool was_sit_ground_constrained);
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp
index 63ace4fe52..11cfcf784a 100644
--- a/indra/newview/llvoavatarself.cpp
+++ b/indra/newview/llvoavatarself.cpp
@@ -2667,11 +2667,6 @@ void LLVOAvatarSelf::onCustomizeStart(bool disable_camera_switch)
{
gAgentCamera.changeCameraToCustomizeAvatar();
}
-
-#if 0
- gAgentAvatarp->clearVisualParamWeights();
- gAgentAvatarp->idleUpdateAppearanceAnimation();
-#endif
gAgentAvatarp->invalidateAll(); // mark all bakes as dirty, request updates
gAgentAvatarp->updateMeshTextures(); // make sure correct textures are applied to the avatar mesh.