diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2018-06-14 20:06:32 +0100 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2018-06-14 20:06:32 +0100 |
commit | 1d6b24fcc219f504c13e771a220112a60c3a85e8 (patch) | |
tree | a7005f55e3215120efb5179bff79ec1589e4c8ef | |
parent | edf6795edaa4ec822ac0e2bc906c71606b84b5c8 (diff) |
MAINT-8653 - enforce z-height offset for animated mesh objects
-rw-r--r-- | indra/newview/llviewerobject.cpp | 14 | ||||
-rw-r--r-- | indra/newview/llvoavatar.cpp | 15 |
2 files changed, 23 insertions, 6 deletions
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 5ca6b25a18..29b2a217cc 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -4137,8 +4137,20 @@ const LLVector3 LLViewerObject::getRenderPosition() const { if (mDrawable.notNull() && mDrawable->isState(LLDrawable::RIGGED)) { + LLControlAvatar *cav = getControlAvatar(); + if (isRoot() && cav) + { + F32 fixup; + if ( cav->hasPelvisFixup( fixup) ) + { + //Apply a pelvis fixup (as defined by the avs skin) + LLVector3 pos = mDrawable->getPositionAgent(); + pos[VZ] += fixup; + return pos; + } + } LLVOAvatar* avatar = getAvatar(); - if (avatar && !getControlAvatar()) + if ((avatar) && !getControlAvatar()) { return avatar->getPositionAgent(); } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 728155382f..8d9a063670 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1296,11 +1296,15 @@ void LLVOAvatar::calculateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) LL_RECORD_BLOCK_TIME(FTM_AVATAR_EXTENT_UPDATE); S32 box_detail = gSavedSettings.getS32("AvatarBoundingBoxComplexity"); - LLVector4a buffer(0.1); + + // AXON the update_min_max function used below assumes there is a + // known starting point, but in general there isn't. Ideally the + // box update logic should be modified to handle the no-point-yet + // case. For most models, starting with the pelvis is safe though. LLVector4a pos; pos.load3(mPelvisp->getWorldPosition().mV); - newMin.setSub(pos, buffer); - newMax.setAdd(pos, buffer); + newMin = pos; + newMax = pos; //stretch bounding box by joint positions. No point doing this for //control avs, where the polymeshes aren't maintained or @@ -1429,8 +1433,9 @@ void LLVOAvatar::calculateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) //pad bounding box - newMin.sub(buffer); - newMax.add(buffer); + LLVector4a padding(0.1); + newMin.sub(padding); + newMax.add(padding); } void render_sphere_and_line(const LLVector3& begin_pos, const LLVector3& end_pos, F32 sphere_scale, const LLVector3& occ_color, const LLVector3& visible_color) |