diff options
Diffstat (limited to 'indra/newview/llvoavatar.cpp')
-rw-r--r-- | indra/newview/llvoavatar.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index c8a4e4c205..bfed8b9d39 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -687,7 +687,6 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mVisualComplexity(VISUAL_COMPLEXITY_UNKNOWN), mLoadedCallbacksPaused(false), mLoadedCallbackTextures(0), - mRenderUnloadedAvatar(LLCachedControl<bool>(gSavedSettings, "RenderUnloadedAvatar", false)), mLastRezzedStatus(-1), mIsEditingAppearance(false), mUseLocalAppearance(false), @@ -3767,6 +3766,7 @@ LLVector3 LLVOAvatar::idleCalcNameTagPosition(const LLVector3 &root_pos_last) // Avoid of crossing the name tag by the water surface if (mNameText) { + bool hidden = false; F32 water_height = getRegion()->getWaterHeight(); static const F32 WATER_HEIGHT_ABOVE_DELTA = 0.25; if (name_position[VZ] < water_height + WATER_HEIGHT_ABOVE_DELTA) @@ -3780,8 +3780,19 @@ LLVector3 LLVOAvatar::idleCalcNameTagPosition(const LLVector3 &root_pos_last) { name_position[VZ] = water_height + WATER_HEIGHT_ABOVE_DELTA; } + else + { + // Hide the name tag when the camera is above the water + // but the avatar is deep enough under the water surface + hidden = true; + } } } + + if (mNameText->getHidden() != hidden) + { + mNameText->setHidden(hidden); + } } return name_position; @@ -8511,7 +8522,8 @@ bool LLVOAvatar::processFullyLoadedChange(bool loading) bool LLVOAvatar::isFullyLoaded() const { - return (mRenderUnloadedAvatar || mFullyLoaded); + static LLCachedControl<bool> render_unloaded_avatars(gSavedSettings, "RenderUnloadedAvatar", false); + return (render_unloaded_avatars || mFullyLoaded); } bool LLVOAvatar::isTooComplex() const |