From 447aadc37b56190893bbd4e2f527a4683844024b Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 31 Jul 2018 21:57:42 +0100 Subject: SL-937 - use dynamic box for rigged mesh attached to normal avatar as well. Still has a 2x error in the radius calc, but gets radius using the dynamic box. --- indra/newview/lldrawable.cpp | 5 ++++- indra/newview/llvovolume.cpp | 10 ++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index 6d9c2c5eb8..6f48b8a968 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -902,8 +902,11 @@ 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()) + // SL-937: add dynamic box handling for rigged mesh on regular avatars. + //if (volume->getAvatar() && volume->getAvatar()->isControlAvatar()) + if (volume->getAvatar()) { const LLVector3* av_box = volume->getAvatar()->getLastAnimExtents(); LLVector3d cam_pos = gAgent.getPosGlobalFromAgent(LLViewerCamera::getInstance()->getOrigin()); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 61d82ec1cf..01b70088ab 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -1296,6 +1296,8 @@ BOOL LLVOVolume::calcLOD() } distance = avatar->mDrawable->mDistanceWRTCamera; + + if (avatar->isControlAvatar()) { // MAINT-7926 Handle volumes in an animated object as a special case @@ -1306,8 +1308,16 @@ BOOL LLVOVolume::calcLOD() } else { + // Volume in a rigged mesh attached to a regular avatar. +#if 0 // Note this isn't really a radius, so distance calcs are off by factor of 2 radius = avatar->getBinRadius(); +#else + // SL-937: add dynamic box handling for rigged mesh on regular avatars. + const LLVector3* box = avatar->getLastAnimExtents(); + LLVector3 diag = box[1] - box[0]; + radius = diag.magVec(); // preserve old BinRadius behavior - 2x off +#endif } if (distance <= 0.f || radius <= 0.f) { -- cgit v1.2.3