summaryrefslogtreecommitdiff
path: root/indra/newview/llvoavatar.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2017-06-09 21:13:54 +0100
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2017-06-09 21:13:54 +0100
commitc5dc0ee36e8d17fd0cf25f5a1fbdfb8609a64ee0 (patch)
tree8efb79ca33fda8b29fd46dbdfc44d9d8a6231d3e /indra/newview/llvoavatar.cpp
parentc9baf4c66157c601cc4d4e325c7843b3bf9a0cad (diff)
SL-704 - code cleanup
Diffstat (limited to 'indra/newview/llvoavatar.cpp')
-rw-r--r--indra/newview/llvoavatar.cpp54
1 files changed, 29 insertions, 25 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 7ba264f35a..1c9f79b200 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -1944,7 +1944,9 @@ void LLVOAvatar::resetSkeleton(bool reset_animations)
//-----------------------------------------------------------------------------
void LLVOAvatar::releaseMeshData()
{
- if (sInstances.size() < AVATAR_RELEASE_THRESHOLD)// || mIsDummy)
+ // AXON what should we be doing here for control avs? Why are
+ // dummies treated differently in the first place?
+ if (sInstances.size() < AVATAR_RELEASE_THRESHOLD || mIsDummy)
{
return;
}
@@ -2740,7 +2742,7 @@ void LLVOAvatar::idleUpdateLoadingEffect()
LLPartData::LL_PART_EMISSIVE_MASK | // LLPartData::LL_PART_FOLLOW_SRC_MASK |
LLPartData::LL_PART_TARGET_POS_MASK );
- // TRIF skip cloud effects for dummy avs as well
+ // AXON skip cloud effects for dummy avs as well
if (!mIsDummy && !isTooComplex()) // do not generate particles for overly-complex avatars
{
setParticleSource(particle_parameters, getID());
@@ -3533,7 +3535,9 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent)
}
// change animation time quanta based on avatar render load
- if (!isSelf())// && !mIsDummy)
+ // AXON how should control avs be handled here?
+ bool is_pure_dummy = mIsDummy && !isControlAvatar();
+ if (!isSelf() && !is_pure_dummy)
{
F32 time_quantum = clamp_rescale((F32)sInstances.size(), 10.f, 35.f, 0.f, 0.25f);
F32 pixel_area_scale = clamp_rescale(mPixelArea, 100, 5000, 1.f, 0.f);
@@ -3655,8 +3659,8 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent)
//--------------------------------------------------------------------
// Propagate viewer object rotation to root of avatar
//--------------------------------------------------------------------
- // FIXME TRIF - just skipping this for now for all dummy avs
- if (!mIsDummy && !isAnyAnimationSignaled(AGENT_NO_ROTATE_ANIMS, NUM_AGENT_NO_ROTATE_ANIMS))
+ // AXON - also skip for control avatars
+ if (!isControlAvatar() && !isAnyAnimationSignaled(AGENT_NO_ROTATE_ANIMS, NUM_AGENT_NO_ROTATE_ANIMS))
{
LLQuaternion iQ;
LLVector3 upDir( 0.0f, 0.0f, 1.0f );
@@ -4356,11 +4360,12 @@ U32 LLVOAvatar::renderSkinned()
}
BOOL first_pass = TRUE;
+ bool is_pure_dummy = mIsDummy && !isControlAvatar();
if (!LLDrawPoolAvatar::sSkipOpaque)
{
if (!isSelf() || gAgent.needsRenderHead() || LLPipeline::sShadowRender)
{
- if (isTextureVisible(TEX_HEAD_BAKED))// || mIsDummy)
+ if (isTextureVisible(TEX_HEAD_BAKED) || is_pure_dummy)
{
LLViewerJoint* head_mesh = getViewerJoint(MESH_ID_HEAD);
if (head_mesh)
@@ -4370,7 +4375,7 @@ U32 LLVOAvatar::renderSkinned()
first_pass = FALSE;
}
}
- if (isTextureVisible(TEX_UPPER_BAKED))// || mIsDummy)
+ if (isTextureVisible(TEX_UPPER_BAKED) || is_pure_dummy)
{
LLViewerJoint* upper_mesh = getViewerJoint(MESH_ID_UPPER_BODY);
if (upper_mesh)
@@ -4380,7 +4385,7 @@ U32 LLVOAvatar::renderSkinned()
first_pass = FALSE;
}
- if (isTextureVisible(TEX_LOWER_BAKED))// || mIsDummy)
+ if (isTextureVisible(TEX_LOWER_BAKED) || is_pure_dummy)
{
LLViewerJoint* lower_mesh = getViewerJoint(MESH_ID_LOWER_BODY);
if (lower_mesh)
@@ -4437,20 +4442,14 @@ U32 LLVOAvatar::renderTransparent(BOOL first_pass)
}
first_pass = FALSE;
}
- // Can't test for baked hair being defined, since that won't always be the case (not all viewers send baked hair)
- // TODO: 1.25 will be able to switch this logic back to calling isTextureVisible();
- if (!mIsDummy)
+ if (isTextureVisible(TEX_HAIR_BAKED))
{
- if ( (getImage(TEX_HAIR_BAKED, 0) && getImage(TEX_HAIR_BAKED, 0)->getID() != IMG_INVISIBLE)
- || LLDrawPoolAlpha::sShowDebugAlpha)
- {
- LLViewerJoint* hair_mesh = getViewerJoint(MESH_ID_HAIR);
- if (hair_mesh)
- {
- num_indices += hair_mesh->render(mAdjustedPixelArea, first_pass, mIsDummy);
- }
- first_pass = FALSE;
- }
+ LLViewerJoint* hair_mesh = getViewerJoint(MESH_ID_HAIR);
+ if (hair_mesh)
+ {
+ num_indices += hair_mesh->render(mAdjustedPixelArea, first_pass, mIsDummy);
+ }
+ first_pass = FALSE;
}
if (LLPipeline::sImpostorRender)
{
@@ -4491,7 +4490,9 @@ U32 LLVOAvatar::renderRigid()
gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.5f);
}
- if (isTextureVisible(TEX_EYES_BAKED) || mIsDummy)
+ bool is_pure_dummy = mIsDummy && !isControlAvatar();
+
+ if (isTextureVisible(TEX_EYES_BAKED) || is_pure_dummy)
{
LLViewerJoint* eyeball_left = getViewerJoint(MESH_ID_EYEBALL_LEFT);
LLViewerJoint* eyeball_right = getViewerJoint(MESH_ID_EYEBALL_RIGHT);
@@ -5529,7 +5530,7 @@ void LLVOAvatar::rebuildAttachmentOverrides()
void LLVOAvatar::addAttachmentOverridesForObject(LLViewerObject *vo)
{
bool non_attached_case = false;
- // FIXME TRIF - will this work if vo has child objects?
+ // FIXME AXON - will this work if vo has child objects?
if (vo->mControlAvatar)
{
non_attached_case = true;
@@ -5759,7 +5760,7 @@ void LLVOAvatar::showAttachmentOverrides(bool verbose) const
//-----------------------------------------------------------------------------
// resetJointsOnDetach
//-----------------------------------------------------------------------------
-// TRIF handle NPC case
+// AXON handle NPC case
void LLVOAvatar::resetJointsOnDetach(LLViewerObject *vo)
{
LLVOAvatar *av = vo->getAvatarAncestor();
@@ -5788,7 +5789,7 @@ void LLVOAvatar::resetJointsOnDetach(LLViewerObject *vo)
//-----------------------------------------------------------------------------
// resetJointsOnDetach
//-----------------------------------------------------------------------------
-// TRIF handle NPC case
+// AXON handle NPC case
void LLVOAvatar::resetJointsOnDetach(const LLUUID& mesh_id)
{
//Subsequent joints are relative to pelvis
@@ -5867,6 +5868,7 @@ void LLVOAvatar::getGround(const LLVector3 &in_pos_agent, LLVector3 &out_pos_age
LLVector3d z_vec(0.0f, 0.0f, 1.0f);
LLVector3d p0_global, p1_global;
+ // AXON update for control avs?
if (mIsDummy)
{
outNorm.setVec(z_vec);
@@ -5896,6 +5898,7 @@ F32 LLVOAvatar::getTimeDilation()
//-----------------------------------------------------------------------------
F32 LLVOAvatar::getPixelArea() const
{
+ // AXON update for control avatars
if (mIsDummy)
{
return 100000.f;
@@ -6827,6 +6830,7 @@ void LLVOAvatar::onGlobalColorChanged(const LLTexGlobalColor* global_color)
BOOL LLVOAvatar::isVisible() const
{
+ // AXON should we flag control avs as invisible?
return mDrawable.notNull()
&& (!mOrphaned || isSelf())
&& (mDrawable->isVisible() || mIsDummy);