diff options
-rw-r--r-- | indra/newview/llface.cpp | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index b4f4d52014..d1e2b8b93d 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -2364,14 +2364,35 @@ F32 LLFace::getTextureVirtualSize() BOOL LLFace::calcPixelArea(F32& cos_angle_to_view_dir, F32& radius) { - LL_PROFILE_ZONE_SCOPED_CATEGORY_FACE + LL_PROFILE_ZONE_SCOPED_CATEGORY_FACE; //VECTORIZE THIS //get area of circle around face - LLVector4a center; - center.load3(getPositionAgent().mV); - LLVector4a size; - size.setSub(mExtents[1], mExtents[0]); + + LLVector4a center; + LLVector4a size; + + + if (isState(LLFace::RIGGED)) + { + //override with avatar bounding box + LLVOAvatar* avatar = mVObjp->getAvatar(); + if (avatar) + { + center.load3(avatar->getPositionAgent().mV); + const LLVector4a* exts = avatar->mDrawable->getSpatialExtents(); + size.setSub(exts[1], exts[0]); + } + else + { + return false; + } + } + else + { + center.load3(getPositionAgent().mV); + size.setSub(mExtents[1], mExtents[0]); + } size.mul(0.5f); LLViewerCamera* camera = LLViewerCamera::getInstance(); |