summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2018-06-15 18:36:59 +0100
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2018-06-15 18:36:59 +0100
commitf8ef8300ccdae12f1d6dc3911bec2e10cb1bb25c (patch)
treef13418b7e30e0814a695bf9e0d0a86d018223361
parentc65aa5f34d63d6ec0af33035f4d5de94688eccee (diff)
MAINT-8554 - encroachment check fix
-rw-r--r--indra/newview/llcontrolavatar.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/indra/newview/llcontrolavatar.cpp b/indra/newview/llcontrolavatar.cpp
index 7537e91477..6bd7de12f3 100644
--- a/indra/newview/llcontrolavatar.cpp
+++ b/indra/newview/llcontrolavatar.cpp
@@ -95,7 +95,7 @@ void LLControlAvatar::matchVolumeTransform()
LLVector3 vol_pos = mRootVolp->getRenderPosition();
LLVector3 pos_box_offset;
- pos_box_offset.clear();
+ LLVector3 box_offset;
// Fix up position if needed to prevent visual encroachment
if (box_valid_and_non_zero(getLastAnimExtents())) // wait for state to settle down
@@ -116,18 +116,21 @@ void LLControlAvatar::matchVolumeTransform()
if (offset_dist > MAX_LEGAL_OFFSET)
{
F32 target_dist = (offset_dist - MAX_LEGAL_OFFSET);
- pos_box_offset *= target_dist/offset_dist;
+ box_offset = (target_dist/offset_dist)*pos_box_offset;
}
- //LL_DEBUGS("FixBox") << getFullname() << " fixup needed for offset "
- // << pos_box_offset[0] << "," << pos_box_offset[1] << "," << pos_box_offset[2]
- // << " current fixup "
- // << mPositionConstraintFixup[0] << "," << mPositionConstraintFixup[1] << "," << mPositionConstraintFixup[2]
- // << " dist " << offset_dist << LL_ENDL;
}
- mPositionConstraintFixup = pos_box_offset;
+ mPositionConstraintFixup = box_offset;
+
+ // Currently if you're doing something like playing an
+ // animation that moves the pelvis (on an avatar or
+ // animated object), the name tag and debug text will be
+ // left behind. Ideally setPosition() would follow the
+ // skeleton around in a smarter way, so name tags,
+ // complexity info and such line up better. Should defer
+ // this until avatars also get fixed.
+ setPositionAgent(vol_pos);
- setPositionAgent(vol_pos + mPositionConstraintFixup);
LLQuaternion obj_rot = mRootVolp->getRotation();
LLQuaternion result_rot = obj_rot;
setRotation(result_rot);