diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2018-04-20 13:37:07 +0100 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2018-04-20 13:37:07 +0100 |
commit | f954abd9dfbf8f7147e1f5b352c8eadc6a074555 (patch) | |
tree | 76445938c8da821363627db8d75f88a60b0b91ec /indra/llcharacter | |
parent | 569ce0b7b88819995968fb5891c4da89233314eb (diff) |
MAINT-8549, MAINT-8554 - improvements to animesh ARC, restrict joint position overrides to +/-5m
Diffstat (limited to 'indra/llcharacter')
-rw-r--r-- | indra/llcharacter/lljoint.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/indra/llcharacter/lljoint.cpp b/indra/llcharacter/lljoint.cpp index 89335a20f5..abc5a95c8d 100644 --- a/indra/llcharacter/lljoint.cpp +++ b/indra/llcharacter/lljoint.cpp @@ -435,6 +435,15 @@ void LLJoint::addAttachmentPosOverride( const LLVector3& pos, const LLUUID& mesh // return; //} + LLVector3 constrained_pos = LLVector3(llclamp(pos[0],-LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET), + llclamp(pos[1],-LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET), + llclamp(pos[2],-LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET)); + if (constrained_pos != pos) + { + LL_DEBUGS("Avatar") << "attachment pos override constrained to " + << constrained_pos << " was " << pos << LL_ENDL; + } + LLVector3 before_pos; LLUUID before_mesh_id; bool has_active_override_before = hasAttachmentPosOverride( before_pos, before_mesh_id ); @@ -446,7 +455,7 @@ void LLJoint::addAttachmentPosOverride( const LLVector3& pos, const LLUUID& mesh } m_posBeforeOverrides = getPosition(); } - m_attachmentPosOverrides.add(mesh_id,pos); + m_attachmentPosOverrides.add(mesh_id,constrained_pos); LLVector3 after_pos; LLUUID after_mesh_id; hasAttachmentPosOverride(after_pos, after_mesh_id); @@ -455,7 +464,7 @@ void LLJoint::addAttachmentPosOverride( const LLVector3& pos, const LLUUID& mesh active_override_changed = true; if (do_debug_joint(getName())) { - LL_DEBUGS("Avatar") << "av " << av_info << " joint " << getName() << " addAttachmentPosOverride for mesh " << mesh_id << " pos " << pos << LL_ENDL; + LL_DEBUGS("Avatar") << "av " << av_info << " joint " << getName() << " addAttachmentPosOverride for mesh " << mesh_id << " pos " << constrained_pos << LL_ENDL; } updatePos(av_info); } |