diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2018-07-09 22:30:50 +0100 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2018-07-09 22:30:50 +0100 |
commit | 9be476e3bb4cde7b086581931ed39ac137207ffe (patch) | |
tree | 149562627e24310c97533aa50fe77e5cccfb8621 /indra/newview/lldrawable.cpp | |
parent | 0b5bc866183c7b28aaea93f201e5010b90dd706d (diff) |
MAINT-7926, MAINT-8400 - fixes related to bounding box and LOD calculations for rigged meshes in animated objects
Diffstat (limited to 'indra/newview/lldrawable.cpp')
-rw-r--r-- | indra/newview/lldrawable.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index 22ed54913a..6d9c2c5eb8 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -32,6 +32,7 @@ #include "material_codes.h" // viewer includes +#include "llagent.h" #include "llcriticaldamp.h" #include "llface.h" #include "lllightconstants.h" @@ -900,6 +901,25 @@ void LLDrawable::updateDistance(LLCamera& camera, bool force_update) } } } + + // MAINT-7926 Handle volumes in an animated object as a special case + if (volume->getAvatar() && volume->getAvatar()->isControlAvatar()) + { + const LLVector3* av_box = volume->getAvatar()->getLastAnimExtents(); + LLVector3d cam_pos = gAgent.getPosGlobalFromAgent(LLViewerCamera::getInstance()->getOrigin()); + LLVector3 cam_region_pos = LLVector3(cam_pos - volume->getRegion()->getOriginGlobal()); + + LLVector3 cam_to_box_offset = point_to_box_offset(cam_region_pos, av_box); + //LL_DEBUGS("DynamicBox") << volume->getAvatar()->getFullname() + // << " pos (ignored) " << pos + // << " cam pos " << cam_pos + // << " cam region pos " << cam_region_pos + // << " box " << av_box[0] << "," << av_box[1] << LL_ENDL; + mDistanceWRTCamera = ll_round(cam_to_box_offset.magVec(), 0.01f); + mVObjp->updateLOD(); + return; + } + } else { |