summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2014-11-14 15:41:03 -0500
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2014-11-14 15:41:03 -0500
commit9c4397b6ee6d1a2a2c43d5d886b178753a4833d8 (patch)
tree13187f9716710aa43127976e2c84b9df77888fa6 /indra
parent30c1d67d957ec7f895dd690ec34b5459fc9082de (diff)
MAINT-4537 WIP - joint position management during outfit changes
Diffstat (limited to 'indra')
-rwxr-xr-xindra/llcharacter/lljoint.cpp30
-rwxr-xr-xindra/newview/llagentwearables.cpp7
-rwxr-xr-xindra/newview/llvoavatarself.cpp18
-rwxr-xr-xindra/newview/llvoavatarself.h1
4 files changed, 44 insertions, 12 deletions
diff --git a/indra/llcharacter/lljoint.cpp b/indra/llcharacter/lljoint.cpp
index af5393ef03..cab3a7d619 100755
--- a/indra/llcharacter/lljoint.cpp
+++ b/indra/llcharacter/lljoint.cpp
@@ -283,12 +283,23 @@ const LLVector3& LLJoint::getPosition()
return mXform.getPosition();
}
+bool do_debug_joint(const std::string& name)
+{
+ return true;
+}
//--------------------------------------------------------------------
// setPosition()
//--------------------------------------------------------------------
void LLJoint::setPosition( const LLVector3& pos )
{
+ if (pos != getPosition())
+ {
+ if (do_debug_joint(getName()))
+ {
+ LL_DEBUGS("Avatar") << " joint " << getName() << " set pos " << pos << LL_ENDL;
+ }
+ }
mXform.setPosition(pos);
touch(MATRIX_DIRTY | POSITION_DIRTY);
}
@@ -312,11 +323,17 @@ void LLJoint::addAttachmentPosOverride( const LLVector3& pos, const LLUUID& mesh
}
if (!m_attachmentOverrides.count())
{
- LL_DEBUGS("Avatar") << "av " << av_info << " joint " << getName() << " saving m_posBeforeOverrides " << getPosition() << LL_ENDL;
+ if (do_debug_joint(getName()))
+ {
+ LL_DEBUGS("Avatar") << "av " << av_info << " joint " << getName() << " saving m_posBeforeOverrides " << getPosition() << LL_ENDL;
+ }
m_posBeforeOverrides = getPosition();
}
m_attachmentOverrides.add(mesh_id,pos);
- LL_DEBUGS("Avatar") << "av " << av_info << " joint " << getName() << " addAttachmentPosOverride for mesh " << mesh_id << " pos " << pos << LL_ENDL;
+ if (do_debug_joint(getName()))
+ {
+ LL_DEBUGS("Avatar") << "av " << av_info << " joint " << getName() << " addAttachmentPosOverride for mesh " << mesh_id << " pos " << pos << LL_ENDL;
+ }
updatePos(av_info);
}
@@ -331,9 +348,12 @@ void LLJoint::removeAttachmentPosOverride( const LLUUID& mesh_id, const std::str
}
if (m_attachmentOverrides.remove(mesh_id))
{
- LL_DEBUGS("Avatar") << "av " << av_info << " joint " << getName()
- << " removeAttachmentPosOverride for " << mesh_id << LL_ENDL;
- showJointPosOverrides(*this, "remove", av_info);
+ if (do_debug_joint(getName()))
+ {
+ LL_DEBUGS("Avatar") << "av " << av_info << " joint " << getName()
+ << " removeAttachmentPosOverride for " << mesh_id << LL_ENDL;
+ showJointPosOverrides(*this, "remove", av_info);
+ }
updatePos(av_info);
}
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp
index a7acdb0520..964c5110d1 100755
--- a/indra/newview/llagentwearables.cpp
+++ b/indra/newview/llagentwearables.cpp
@@ -1088,7 +1088,6 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it
if (isAgentAvatarValid())
{
gAgentAvatarp->setCompositeUpdatesEnabled(TRUE);
- gAgentAvatarp->updateVisualParams();
// If we have not yet declouded, we may want to use
// baked texture UUIDs sent from the first objectUpdate message
@@ -1106,6 +1105,12 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it
notifyLoadingFinished();
+ // Have to copy wearable params to avatar
+ gAgentAvatarp->writeWearablesToAvatar();
+
+ // ... before this will do anything.
+ gAgentAvatarp->updateVisualParams();
+
gAgentAvatarp->dumpAvatarTEs("setWearableOutfit");
LL_DEBUGS("Avatar") << "setWearableOutfit() end" << LL_ENDL;
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp
index 4335df66a1..0be8df349d 100755
--- a/indra/newview/llvoavatarself.cpp
+++ b/indra/newview/llvoavatarself.cpp
@@ -718,13 +718,8 @@ void LLVOAvatarSelf::updateVisualParams()
LLVOAvatar::updateVisualParams();
}
-/*virtual*/
-void LLVOAvatarSelf::idleUpdateAppearanceAnimation()
+void LLVOAvatarSelf::writeWearablesToAvatar()
{
- // Animate all top-level wearable visual parameters
- gAgentWearables.animateAllWearableParams(calcMorphAmount());
-
- // apply wearable visual params to avatar
for (U32 type = 0; type < LLWearableType::WT_COUNT; type++)
{
LLWearable *wearable = gAgentWearables.getTopWearable((LLWearableType::EType)type);
@@ -734,6 +729,17 @@ void LLVOAvatarSelf::idleUpdateAppearanceAnimation()
}
}
+}
+
+/*virtual*/
+void LLVOAvatarSelf::idleUpdateAppearanceAnimation()
+{
+ // Animate all top-level wearable visual parameters
+ gAgentWearables.animateAllWearableParams(calcMorphAmount());
+
+ // Apply wearable visual params to avatar
+ writeWearablesToAvatar();
+
//allow avatar to process updates
LLVOAvatar::idleUpdateAppearanceAnimation();
diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h
index a9c01933b7..13ffc057b0 100755
--- a/indra/newview/llvoavatarself.h
+++ b/indra/newview/llvoavatarself.h
@@ -90,6 +90,7 @@ public:
/*virtual*/ BOOL setVisualParamWeight(const char* param_name, F32 weight);
/*virtual*/ BOOL setVisualParamWeight(S32 index, F32 weight);
/*virtual*/ void updateVisualParams();
+ void writeWearablesToAvatar();
/*virtual*/ void idleUpdateAppearanceAnimation();
private: