summaryrefslogtreecommitdiff
path: root/indra/llcharacter
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2016-09-02 16:44:57 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2016-09-02 16:44:57 -0400
commit34ced1aa2cc286db26e2866cfc7a53ef72d828a4 (patch)
tree7ae48b379e7e1916d9d22d390ad9466f7b255402 /indra/llcharacter
parenta2875ba53ec02235a0db5734264108c0f0898269 (diff)
SL-395 - partial support for joint scale locking via flag in skin info
Diffstat (limited to 'indra/llcharacter')
-rw-r--r--indra/llcharacter/lljoint.cpp26
-rw-r--r--indra/llcharacter/lljoint.h4
2 files changed, 8 insertions, 22 deletions
diff --git a/indra/llcharacter/lljoint.cpp b/indra/llcharacter/lljoint.cpp
index d2a5c59023..8d101ff1fc 100644
--- a/indra/llcharacter/lljoint.cpp
+++ b/indra/llcharacter/lljoint.cpp
@@ -404,16 +404,16 @@ void showJointScaleOverrides( const LLJoint& joint, const std::string& note, con
LL_DEBUGS("Avatar") << av_info << " joint " << joint.getName() << " " << note << " " << os.str() << LL_ENDL;
}
-bool above_joint_pos_threshold(const LLVector3& diff)
+bool LLJoint::aboveJointPosThreshold(const LLVector3& pos) const
{
- //return !diff.isNull();
+ LLVector3 diff = pos - getDefaultPosition();
const F32 max_joint_pos_offset = 0.0001f; // 0.1 mm
return diff.lengthSquared() > max_joint_pos_offset * max_joint_pos_offset;
}
-bool above_joint_scale_threshold(const LLVector3& diff)
+bool LLJoint::aboveJointScaleThreshold(const LLVector3& scale) const
{
- //return !diff.isNull();
+ LLVector3 diff = scale - getDefaultScale();
const F32 max_joint_scale_offset = 0.0001f; // 0.1 mm
return diff.lengthSquared() > max_joint_scale_offset * max_joint_scale_offset;
}
@@ -434,15 +434,6 @@ void LLJoint::addAttachmentPosOverride( const LLVector3& pos, const LLUUID& mesh
//{
// return;
//}
- if (!above_joint_pos_threshold(pos-getDefaultPosition()))
- {
- if (do_debug_joint(getName()))
- {
- LL_DEBUGS("Avatar") << "Attachment pos override ignored for " << getName()
- << ", pos " << pos << " is same as default pos" << LL_ENDL;
- }
- return;
- }
LLVector3 before_pos;
LLUUID before_mesh_id;
@@ -627,15 +618,6 @@ void LLJoint::addAttachmentScaleOverride( const LLVector3& scale, const LLUUID&
{
return;
}
- if (!above_joint_scale_threshold(scale-getDefaultScale()))
- {
- if (do_debug_joint(getName()))
- {
- LL_DEBUGS("Avatar") << "Attachment scale override ignored for " << getName()
- << ", scale " << scale << " is same as default scale" << LL_ENDL;
- }
- return;
- }
if (!m_attachmentScaleOverrides.count())
{
if (do_debug_joint(getName()))
diff --git a/indra/llcharacter/lljoint.h b/indra/llcharacter/lljoint.h
index 509523ae4b..42c2c6f1ad 100644
--- a/indra/llcharacter/lljoint.h
+++ b/indra/llcharacter/lljoint.h
@@ -278,6 +278,10 @@ public:
void clearAttachmentScaleOverrides();
void showAttachmentScaleOverrides(const std::string& av_info) const;
+ // These are used in checks of whether a pos/scale override is considered significant.
+ bool aboveJointPosThreshold(const LLVector3& pos) const;
+ bool aboveJointScaleThreshold(const LLVector3& scale) const;
+
//Accessor for the joint id
LLUUID getId( void ) { return mId; }
//Setter for the joints id