diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2016-04-18 19:31:29 -0400 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2016-04-18 19:31:29 -0400 |
commit | 223f0907092966e595890830be76ddf77776e123 (patch) | |
tree | 804245970427512f25ae133c45ce9b601ddbaf06 /indra/llcharacter/lljoint.cpp | |
parent | 5adc782341fd2de7a791f989c991c07d3060b862 (diff) |
SL-371 - more tracking on partial joint overrides
Diffstat (limited to 'indra/llcharacter/lljoint.cpp')
-rwxr-xr-x | indra/llcharacter/lljoint.cpp | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/indra/llcharacter/lljoint.cpp b/indra/llcharacter/lljoint.cpp index 4812c46077..3ad919072d 100755 --- a/indra/llcharacter/lljoint.cpp +++ b/indra/llcharacter/lljoint.cpp @@ -351,6 +351,15 @@ void LLJoint::setPosition( const LLVector3& pos ) touch(MATRIX_DIRTY | POSITION_DIRTY); } +void LLJoint::setDefaultPosition( const LLVector3& pos ) +{ + mDefaultPosition = pos; +} + +const LLVector3& LLJoint::getDefaultPosition() const +{ + return mDefaultPosition; +} void showJointPosOverrides( const LLJoint& joint, const std::string& note, const std::string& av_info ) { std::ostringstream os; @@ -427,6 +436,49 @@ void LLJoint::clearAttachmentPosOverrides() } //-------------------------------------------------------------------- +// showAttachmentPosOverrides() +//-------------------------------------------------------------------- +void LLJoint::showAttachmentPosOverrides(const std::string& av_info) const +{ + LLVector3 active_override; + bool has_active_override; + LLUUID mesh_id; + has_active_override = m_attachmentOverrides.findActiveOverride(mesh_id,active_override); + U32 count = m_attachmentOverrides.count(); + if (count==1) + { + LLPosOverrideMap::map_type::const_iterator it = m_attachmentOverrides.getMap().begin(); + std::string highlight = (has_active_override && (it->second == active_override)) ? "*" : ""; + LL_DEBUGS("Avatar") << "av " << av_info << " joint " << getName() + << " has single attachment pos override " << highlight << "" << it->second << " default " << mDefaultPosition << LL_ENDL; + } + else if (count>1) + { + LL_DEBUGS("Avatar") << "av " << av_info << " joint " << getName() << " has " << count << " attachment pos overrides" << LL_ENDL; + std::set<LLVector3> distinct_offsets; + LLPosOverrideMap::map_type::const_iterator it = m_attachmentOverrides.getMap().begin(); + for (; it != m_attachmentOverrides.getMap().end(); ++it) + { + distinct_offsets.insert(it->second); + } + if (distinct_offsets.size()>1) + { + LL_DEBUGS("Avatar") << "CONFLICTS, " << distinct_offsets.size() << " different values" << LL_ENDL; + } + else + { + LL_DEBUGS("Avatar") << "no conflicts" << LL_ENDL; + } + std::set<LLVector3>::iterator dit = distinct_offsets.begin(); + for ( ; dit != distinct_offsets.end(); ++dit) + { + std::string highlight = (has_active_override && *dit == active_override) ? "*" : ""; + LL_DEBUGS("Avatar") << " POS " << highlight << "" << (*dit) << " default " << mDefaultPosition << LL_ENDL; + } + } +} + +//-------------------------------------------------------------------- // updatePos() //-------------------------------------------------------------------- void LLJoint::updatePos(const std::string& av_info) |