summaryrefslogtreecommitdiff
path: root/indra/newview/llcontrolavatar.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2018-10-03 10:29:11 +0100
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2018-10-03 10:29:11 +0100
commit0fd67838cf011e81f18822f699e8a140d4f761ad (patch)
treeb3497572426efa86f7ed2107d48a06cbd1954082 /indra/newview/llcontrolavatar.cpp
parent5bb0b393a9ee634db1fbbde2645a6374704e184c (diff)
SL-966 - tweaks to scale/pos constraint logic
Diffstat (limited to 'indra/newview/llcontrolavatar.cpp')
-rw-r--r--indra/newview/llcontrolavatar.cpp24
1 files changed, 5 insertions, 19 deletions
diff --git a/indra/newview/llcontrolavatar.cpp b/indra/newview/llcontrolavatar.cpp
index 18d6e6d6e7..64f8423a66 100644
--- a/indra/newview/llcontrolavatar.cpp
+++ b/indra/newview/llcontrolavatar.cpp
@@ -102,34 +102,20 @@ void LLControlAvatar::getNewConstraintFixups(LLVector3& new_pos_fixup, F32& new_
// correction to the control avatar position if
// needed.
const LLVector3 *extents = getLastAnimExtents();
+ LLVector unshift_extents;
+ unshift_extents[0] = extents[0] - mPositionConstraintFixup;
+ unshift_extents[1] = extents[1] - mPositionConstraintFixup;
LLVector3 box_dims = extents[1]-extents[0];
F32 max_size = llmax(box_dims[0],box_dims[1],box_dims[2]);
- LLVector3 pos_box_offset = point_to_box_offset(vol_pos, extents);
+ LLVector3 pos_box_offset = point_to_box_offset(vol_pos, unshift_extents);
F32 offset_dist = pos_box_offset.length();
if (offset_dist > max_legal_offset)
{
F32 target_dist = (offset_dist - max_legal_offset);
- new_pos_fixup = mPositionConstraintFixup + (target_dist/offset_dist)*pos_box_offset;
+ new_pos_fixup = (target_dist/offset_dist)*pos_box_offset;
LL_DEBUGS("ConstraintFix") << getFullname() << " pos fix, offset_dist " << offset_dist << " pos fixup "
<< new_pos_fixup << " was " << mPositionConstraintFixup << LL_ENDL;
}
- else if (offset_dist < max_legal_offset-1)
- {
- if (mPositionConstraintFixup.length()>0.01f)
- {
- new_pos_fixup = mPositionConstraintFixup * 0.9;
- }
- else
- {
- new_pos_fixup = LLVector3();
- }
- LL_DEBUGS("ConstraintFix") << getFullname() << " pos fixup reduced "
- << new_pos_fixup << " was " << mPositionConstraintFixup << LL_ENDL;
- }
- else
- {
- new_pos_fixup = mPositionConstraintFixup;
- }
if (max_size/mScaleConstraintFixup > max_legal_size)
{
new_scale_fixup = mScaleConstraintFixup*max_legal_size/max_size;