summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2020-11-04 16:07:10 +0000
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2020-11-04 16:07:10 +0000
commitc79e648aac9bb32cc1d49d39973b5e96f25828f0 (patch)
treec715b4cf107cdf0e9d177857510a7a81010f0581
parent8b9ed94a35d7e1cc3ced562eb9e6d303ce016ec6 (diff)
SL-14015 - possible fix for phantom animesh attachments on mac
-rw-r--r--indra/newview/llcontrolavatar.cpp82
-rw-r--r--indra/newview/llcontrolavatar.h4
-rw-r--r--indra/newview/lldrawpoolavatar.cpp7
-rw-r--r--indra/newview/llvoavatar.cpp4
-rw-r--r--indra/newview/llvoavatar.h6
5 files changed, 64 insertions, 39 deletions
diff --git a/indra/newview/llcontrolavatar.cpp b/indra/newview/llcontrolavatar.cpp
index f732f369bd..fab249f988 100644
--- a/indra/newview/llcontrolavatar.cpp
+++ b/indra/newview/llcontrolavatar.cpp
@@ -78,6 +78,24 @@ void LLControlAvatar::initInstance()
mInitFlags |= 1<<4;
}
+const LLVOAvatar *LLControlAvatar::getAttachedAvatar() const
+{
+ if (mRootVolp && mRootVolp->isAttachment())
+ {
+ return mRootVolp->getAvatarAncestor();
+ }
+ return NULL;
+}
+
+LLVOAvatar *LLControlAvatar::getAttachedAvatar()
+{
+ if (mRootVolp && mRootVolp->isAttachment())
+ {
+ return mRootVolp->getAvatarAncestor();
+ }
+ return NULL;
+}
+
void LLControlAvatar::getNewConstraintFixups(LLVector3& new_pos_fixup, F32& new_scale_fixup) const
{
@@ -165,7 +183,7 @@ void LLControlAvatar::matchVolumeTransform()
if (mRootVolp->isAttachment())
{
- LLVOAvatar *attached_av = mRootVolp->getAvatarAncestor();
+ LLVOAvatar *attached_av = getAttachedAvatar();
if (attached_av)
{
LLViewerJointAttachment *attach = attached_av->getTargetAttachmentPoint(mRootVolp);
@@ -365,28 +383,24 @@ bool LLControlAvatar::computeNeedsUpdate()
computeUpdatePeriod();
// Animesh attachments are a special case. Should have the same update cadence as their attached parent avatar.
- bool is_attachment = mRootVolp && mRootVolp->isAttachment(); // For attached animated objects
- if (is_attachment)
+ LLVOAvatar *attached_av = getAttachedAvatar();
+ if (attached_av)
{
- LLVOAvatar *attached_av = mRootVolp->getAvatarAncestor();
- if (attached_av)
+ // Have to run computeNeedsUpdate() for attached av in
+ // case it hasn't run updateCharacter() already this
+ // frame. Note this means that the attached av will
+ // run computeNeedsUpdate() multiple times per frame
+ // if it has animesh attachments. Results will be
+ // consistent except for the corner case of exceeding
+ // MAX_IMPOSTOR_INTERVAL in one call but not another,
+ // which should be rare.
+ attached_av->computeNeedsUpdate();
+ mNeedsImpostorUpdate = attached_av->mNeedsImpostorUpdate;
+ if (mNeedsImpostorUpdate)
{
- // Have to run computeNeedsUpdate() for attached av in
- // case it hasn't run updateCharacter() already this
- // frame. Note this means that the attached av will
- // run computeNeedsUpdate() multiple times per frame
- // if it has animesh attachments. Results will be
- // consistent except for the corner case of exceeding
- // MAX_IMPOSTOR_INTERVAL in one call but not another,
- // which should be rare.
- attached_av->computeNeedsUpdate();
- mNeedsImpostorUpdate = attached_av->mNeedsImpostorUpdate;
- if (mNeedsImpostorUpdate)
- {
- mLastImpostorUpdateReason = 12;
- }
- return mNeedsImpostorUpdate;
+ mLastImpostorUpdateReason = 12;
}
+ return mNeedsImpostorUpdate;
}
return LLVOAvatar::computeNeedsUpdate();
}
@@ -665,29 +679,23 @@ std::string LLControlAvatar::getFullname() const
// virtual
bool LLControlAvatar::shouldRenderRigged() const
{
- if (mRootVolp && mRootVolp->isAttachment())
- {
- LLVOAvatar *attached_av = mRootVolp->getAvatarAncestor();
- if (attached_av)
- {
- return attached_av->shouldRenderRigged();
- }
- }
+ const LLVOAvatar *attached_av = getAttachedAvatar();
+ if (attached_av)
+ {
+ return attached_av->shouldRenderRigged();
+ }
return true;
}
// virtual
BOOL LLControlAvatar::isImpostor()
{
- if (mRootVolp && mRootVolp->isAttachment())
- {
- // Attached animated objects should match state of their attached av.
- LLVOAvatar *attached_av = mRootVolp->getAvatarAncestor();
- if (attached_av)
- {
- return attached_av->isImpostor();
- }
- }
+ // Attached animated objects should match state of their attached av.
+ LLVOAvatar *attached_av = getAttachedAvatar();
+ if (attached_av)
+ {
+ return attached_av->isImpostor();
+ }
return LLVOAvatar::isImpostor();
}
diff --git a/indra/newview/llcontrolavatar.h b/indra/newview/llcontrolavatar.h
index 2c68850140..8e87299f3e 100644
--- a/indra/newview/llcontrolavatar.h
+++ b/indra/newview/llcontrolavatar.h
@@ -40,6 +40,10 @@ public:
virtual void initInstance(); // Called after construction to initialize the class.
virtual ~LLControlAvatar();
+ // If this is an attachment, return the avatar it is attached to. Otherwise NULL.
+ virtual const LLVOAvatar *getAttachedAvatar() const;
+ virtual LLVOAvatar *getAttachedAvatar();
+
void getNewConstraintFixups(LLVector3& new_pos_constraint, F32& new_scale_constraint) const;
void matchVolumeTransform();
void updateVolumeGeom();
diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp
index ff036e1934..e2ca9e4097 100644
--- a/indra/newview/lldrawpoolavatar.cpp
+++ b/indra/newview/lldrawpoolavatar.cpp
@@ -1526,6 +1526,13 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass)
return;
}
+ LLVOAvatar *attached_av = avatarp->getAttachedAvatar();
+ if (attached_av && LLVOAvatar::AOA_NORMAL != attached_av->getOverallAppearance())
+ {
+ // Animesh attachment of a jellydolled or invisible parent - don't show
+ return;
+ }
+
if (pass == 0)
{
if (!LLPipeline::sReflectionRender)
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index c5bf6ab307..bf03389310 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -761,8 +761,8 @@ std::string LLVOAvatar::avString() const
}
else
{
- std::string viz_string = LLVOAvatar::rezStatusToString(getRezzedStatus());
- return " Avatar '" + getFullname() + "' " + viz_string + " ";
+ std::string viz_string = LLVOAvatar::rezStatusToString(getRezzedStatus());
+ return " Avatar '" + getFullname() + "' " + viz_string + " ";
}
}
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index b815b3b2cd..a30cbc73b7 100644
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -132,6 +132,7 @@ protected:
public:
/*virtual*/ void updateGL();
/*virtual*/ LLVOAvatar* asAvatar();
+
virtual U32 processUpdateMessage(LLMessageSystem *mesgsys,
void **user_data,
U32 block_num,
@@ -253,6 +254,11 @@ public:
virtual bool isControlAvatar() const { return mIsControlAvatar; } // True if this avatar is a control av (no associated user)
virtual bool isUIAvatar() const { return mIsUIAvatar; } // True if this avatar is a supplemental av used in some UI views (no associated user)
+ // If this is an attachment, return the avatar it is attached to. Otherwise NULL.
+ virtual const LLVOAvatar *getAttachedAvatar() const { return NULL; }
+ virtual LLVOAvatar *getAttachedAvatar() { return NULL; }
+
+
private: //aligned members
LL_ALIGN_16(LLVector4a mImpostorExtents[2]);