diff options
author | AndreyL ProductEngine <alihatskiy@productengine.com> | 2019-09-10 23:31:51 +0300 |
---|---|---|
committer | AndreyL ProductEngine <alihatskiy@productengine.com> | 2019-09-10 23:31:51 +0300 |
commit | 1b66e4673d9779a1c67cfb074bb15c597d1c5779 (patch) | |
tree | 1aa96c63f62c9dddec111eee5bb021ced19ea93d /indra/newview/llcontrolavatar.cpp | |
parent | 7d9b7e93ed0a157320ccc86d65f16e7fdfc8fbf1 (diff) | |
parent | e241670694959833feaa0e667222b337095eb683 (diff) |
MergeMerged in lindenlab/viewer-release
Diffstat (limited to 'indra/newview/llcontrolavatar.cpp')
-rw-r--r-- | indra/newview/llcontrolavatar.cpp | 44 |
1 files changed, 33 insertions, 11 deletions
diff --git a/indra/newview/llcontrolavatar.cpp b/indra/newview/llcontrolavatar.cpp index 0f02c23cb0..d24dac385f 100644 --- a/indra/newview/llcontrolavatar.cpp +++ b/indra/newview/llcontrolavatar.cpp @@ -566,27 +566,49 @@ LLViewerObject* LLControlAvatar::lineSegmentIntersectRiggedAttachments(const LLV LLVector4a* normal, LLVector4a* tangent) { - LLViewerObject* hit = NULL; + if (!mRootVolp) + { + return NULL; + } - if (lineSegmentBoundingBox(start, end)) - { - LLVector4a local_end = end; - LLVector4a local_intersection; + LLViewerObject* hit = NULL; - if (mRootVolp && - mRootVolp->lineSegmentIntersect(start, local_end, face, pick_transparent, pick_rigged, face_hit, &local_intersection, tex_coord, normal, tangent)) + if (lineSegmentBoundingBox(start, end)) + { + LLVector4a local_end = end; + LLVector4a local_intersection; + if (mRootVolp->lineSegmentIntersect(start, local_end, face, pick_transparent, pick_rigged, face_hit, &local_intersection, tex_coord, normal, tangent)) { local_end = local_intersection; if (intersection) { *intersection = local_intersection; } - hit = mRootVolp; } - } - - return hit; + else + { + std::vector<LLVOVolume*> volumes; + getAnimatedVolumes(volumes); + + for (std::vector<LLVOVolume*>::iterator vol_it = volumes.begin(); vol_it != volumes.end(); ++vol_it) + { + LLVOVolume *volp = *vol_it; + if (mRootVolp != volp && volp->lineSegmentIntersect(start, local_end, face, pick_transparent, pick_rigged, face_hit, &local_intersection, tex_coord, normal, tangent)) + { + local_end = local_intersection; + if (intersection) + { + *intersection = local_intersection; + } + hit = volp; + break; + } + } + } + } + + return hit; } // virtual |