Skip to content
Snippets Groups Projects
Commit f8ef8300 authored by Brad Payne (Vir Linden)'s avatar Brad Payne (Vir Linden)
Browse files

MAINT-8554 - encroachment check fix

parent c65aa5f3
No related branches found
No related tags found
No related merge requests found
...@@ -95,7 +95,7 @@ void LLControlAvatar::matchVolumeTransform() ...@@ -95,7 +95,7 @@ void LLControlAvatar::matchVolumeTransform()
LLVector3 vol_pos = mRootVolp->getRenderPosition(); LLVector3 vol_pos = mRootVolp->getRenderPosition();
LLVector3 pos_box_offset; LLVector3 pos_box_offset;
pos_box_offset.clear(); LLVector3 box_offset;
// Fix up position if needed to prevent visual encroachment // Fix up position if needed to prevent visual encroachment
if (box_valid_and_non_zero(getLastAnimExtents())) // wait for state to settle down if (box_valid_and_non_zero(getLastAnimExtents())) // wait for state to settle down
...@@ -116,18 +116,21 @@ void LLControlAvatar::matchVolumeTransform() ...@@ -116,18 +116,21 @@ void LLControlAvatar::matchVolumeTransform()
if (offset_dist > MAX_LEGAL_OFFSET) if (offset_dist > MAX_LEGAL_OFFSET)
{ {
F32 target_dist = (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 obj_rot = mRootVolp->getRotation();
LLQuaternion result_rot = obj_rot; LLQuaternion result_rot = obj_rot;
setRotation(result_rot); setRotation(result_rot);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment