MAINT-6110 FIXED No hovertext (PRIM_TEXT/llSetText) on child prim 4.0.2-release

Wed, 09 Mar 2016 15:25:58 +0200

author
Mnikolenko ProductEngine <mnikolenko@productengine.com>
date
Wed, 09 Mar 2016 15:25:58 +0200
changeset 48919
e9d350764dfb
parent 48918
ca9da6367c91
child 48920
59b305ccfba9

MAINT-6110 FIXED No hovertext (PRIM_TEXT/llSetText) on child prim

indra/newview/llhudtext.cpp file | annotate | diff | revisions
     1.1 --- a/indra/newview/llhudtext.cpp	Mon Feb 29 14:00:04 2016 +0200
     1.2 +++ b/indra/newview/llhudtext.cpp	Wed Mar 09 15:25:58 2016 +0200
     1.3 @@ -374,7 +374,7 @@
     1.4  		mVisible = FALSE;
     1.5  		return;
     1.6  	}
     1.7 -		
     1.8 +
     1.9  	if (vec_from_camera * LLViewerCamera::getInstance()->getAtAxis() <= LLViewerCamera::getInstance()->getNear() + 0.1f + mSourceObject->getVObjRadius())
    1.10  	{
    1.11  		mPositionAgent = LLViewerCamera::getInstance()->getOrigin() + vec_from_camera * ((LLViewerCamera::getInstance()->getNear() + 0.1f) / (vec_from_camera * LLViewerCamera::getInstance()->getAtAxis()));
    1.12 @@ -384,21 +384,17 @@
    1.13  		mPositionAgent -= dir_from_camera * mSourceObject->getVObjRadius();
    1.14  	}
    1.15  
    1.16 -	if (!mTextSegments.size())
    1.17 +	mLastDistance = (mPositionAgent - LLViewerCamera::getInstance()->getOrigin()).magVec();
    1.18 +
    1.19 +	if (!mTextSegments.size() || (mDoFade && (mLastDistance > mFadeDistance + mFadeRange)))
    1.20  	{
    1.21  		mVisible = FALSE;
    1.22  		return;
    1.23  	}
    1.24  
    1.25 -	mLastDistance = (mPositionAgent - LLViewerCamera::getInstance()->getOrigin()).magVec();
    1.26 -	F32 obj_dist = dist_vec(mSourceObject->getPositionEdit(), LLViewerCamera::getInstance()->getOrigin());
    1.27 -
    1.28 -	if(mSourceObject->isAttachment())
    1.29 -	{
    1.30 -		LLViewerObject* parent = (LLViewerObject*)mSourceObject->getRoot();
    1.31 -		obj_dist = dist_vec(parent->getPositionEdit(), LLViewerCamera::getInstance()->getOrigin());
    1.32 -	}
    1.33 -	if ((mDoFade && (mLastDistance > mFadeDistance + mFadeRange)) || (obj_dist > MAX_DRAW_DISTANCE))
    1.34 +	LLVector3 pos_agent_center = gAgent.getPosAgentFromGlobal(mPositionGlobal) - dir_from_camera;
    1.35 +	F32 last_distance_center = (pos_agent_center - LLViewerCamera::getInstance()->getOrigin()).magVec();
    1.36 +	if(last_distance_center > MAX_DRAW_DISTANCE)
    1.37  	{
    1.38  		mVisible = FALSE;
    1.39  		return;

mercurial