summaryrefslogtreecommitdiff
path: root/indra/llcharacter
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2016-04-22 14:51:57 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2016-04-22 14:51:57 -0400
commit70156605e283326e9476908141c44c197f9c6d18 (patch)
tree3755acf0b62e6bbaa5189d3765fa7cc233d3a001 /indra/llcharacter
parentcad96c6d86445f8a0996bc786db6fe225bf3a175 (diff)
SL-374 - don't allow sliders to modify joint positions if there's already a mesh-imposed override in place.
Diffstat (limited to 'indra/llcharacter')
-rwxr-xr-xindra/llcharacter/lljoint.cpp16
-rwxr-xr-xindra/llcharacter/lljoint.h2
2 files changed, 16 insertions, 2 deletions
diff --git a/indra/llcharacter/lljoint.cpp b/indra/llcharacter/lljoint.cpp
index 3ad919072d..8365ab8eb1 100755
--- a/indra/llcharacter/lljoint.cpp
+++ b/indra/llcharacter/lljoint.cpp
@@ -336,8 +336,22 @@ bool do_debug_joint(const std::string& name)
//--------------------------------------------------------------------
// setPosition()
//--------------------------------------------------------------------
-void LLJoint::setPosition( const LLVector3& pos )
+void LLJoint::setPosition( const LLVector3& requested_pos, bool apply_attachment_overrides )
{
+ LLVector3 pos(requested_pos);
+
+ LLVector3 active_override;
+ LLUUID mesh_id;
+ if (apply_attachment_overrides && m_attachmentOverrides.findActiveOverride(mesh_id,active_override))
+ {
+ if (pos != active_override && do_debug_joint(getName()))
+ {
+ LLScopedContextString str("setPosition");
+ LL_DEBUGS("Avatar") << " joint " << getName() << " requested_pos " << requested_pos
+ << " overriden by attachment " << active_override << LL_ENDL;
+ }
+ pos = active_override;
+ }
if ((pos != getPosition()) && do_debug_joint(getName()))
{
LLScopedContextString str("setPosition");
diff --git a/indra/llcharacter/lljoint.h b/indra/llcharacter/lljoint.h
index c967770cff..d2c573864b 100755
--- a/indra/llcharacter/lljoint.h
+++ b/indra/llcharacter/lljoint.h
@@ -209,7 +209,7 @@ public:
// get/set local position
const LLVector3& getPosition();
- void setPosition( const LLVector3& pos );
+ void setPosition( const LLVector3& pos, bool apply_attachment_overrides = false );
// Tracks the default position defined by the skeleton
void setDefaultPosition( const LLVector3& pos );