diff options
| author | Sabrina Shanman <cosmic@lindenlab.com> | 2022-04-05 20:26:18 +0000 | 
|---|---|---|
| committer | Sabrina Shanman <cosmic@lindenlab.com> | 2022-04-05 20:26:18 +0000 | 
| commit | 6367d1f02a7ec0cb9a66b14c2b6e036c7265b46c (patch) | |
| tree | 62a9a5f9e82ead861d598e74166651c171837e82 /indra/newview | |
| parent | c7d137067cae548bca919d0f0b49e4818d4fed31 (diff) | |
| parent | d4cadd53d49b47c56ab3ff5bbfab6f2baf5a4631 (diff) | |
Merged in SL-17058 (pull request #934)
SL-17058: Convert frustum on minimap to arc from triangle
Approved-by: Andrey Lihatskiy
Diffstat (limited to 'indra/newview')
| -rwxr-xr-x | indra/newview/llnetmap.cpp | 56 | ||||
| -rw-r--r-- | indra/newview/skins/default/colors.xml | 3 | 
2 files changed, 24 insertions, 35 deletions
| diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index d0fe771295..5cae3ce8d6 100755 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -171,7 +171,6 @@ void LLNetMap::draw()  	static LLUIColor map_track_color = LLUIColorTable::instance().getColor("MapTrackColor", LLColor4::white);  	//static LLUIColor map_track_disabled_color = LLUIColorTable::instance().getColor("MapTrackDisabledColor", LLColor4::white);  	static LLUIColor map_frustum_color = LLUIColorTable::instance().getColor("MapFrustumColor", LLColor4::white); -	static LLUIColor map_frustum_rotating_color = LLUIColorTable::instance().getColor("MapFrustumRotatingColor", LLColor4::white);  	static LLUIColor map_parcel_outline_color = LLUIColorTable::instance().getColor("MapParcelOutlineColor", LLColor4(LLColor3(LLColor4::yellow), 0.5f));  	if (mObjectImagep.isNull()) @@ -488,41 +487,34 @@ void LLNetMap::draw()  		F32 horiz_fov = LLViewerCamera::getInstance()->getView() * LLViewerCamera::getInstance()->getAspect();  		F32 far_clip_meters = LLViewerCamera::getInstance()->getFar();  		F32 far_clip_pixels = far_clip_meters * meters_to_pixels; - -		F32 half_width_meters = far_clip_meters * tan( horiz_fov / 2 ); -		F32 half_width_pixels = half_width_meters * meters_to_pixels; -		F32 ctr_x = (F32)center_sw_left; -		F32 ctr_y = (F32)center_sw_bottom; - +        F32 ctr_x = (F32)center_sw_left; +        F32 ctr_y = (F32)center_sw_bottom; -		gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); +        const F32 steps_per_circle = 40.0f; +        const F32 steps_per_radian = steps_per_circle / F_TWO_PI; +        const F32 arc_start = -(horiz_fov / 2.0f) + F_PI_BY_TWO; +        const F32 arc_end = (horiz_fov / 2.0f) + F_PI_BY_TWO; +        const S32 steps = llmax(1, (S32)((horiz_fov * steps_per_radian) + 0.5f)); -		if( rotate_map ) -		{ -			gGL.color4fv((map_frustum_color()).mV); +        gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); -			gGL.begin( LLRender::TRIANGLES  ); -				gGL.vertex2f( ctr_x, ctr_y ); -				gGL.vertex2f( ctr_x - half_width_pixels, ctr_y + far_clip_pixels ); -				gGL.vertex2f( ctr_x + half_width_pixels, ctr_y + far_clip_pixels ); -			gGL.end(); -		} -		else -		{ -			gGL.color4fv((map_frustum_rotating_color()).mV); -			 -			// If we don't rotate the map, we have to rotate the frustum. -			gGL.pushMatrix(); -				gGL.translatef( ctr_x, ctr_y, 0 ); -				gGL.rotatef( atan2( LLViewerCamera::getInstance()->getAtAxis().mV[VX], LLViewerCamera::getInstance()->getAtAxis().mV[VY] ) * RAD_TO_DEG, 0.f, 0.f, -1.f); -				gGL.begin( LLRender::TRIANGLES  ); -					gGL.vertex2f( 0, 0 ); -					gGL.vertex2f( -half_width_pixels, far_clip_pixels ); -					gGL.vertex2f(  half_width_pixels, far_clip_pixels ); -				gGL.end(); -			gGL.popMatrix(); -		} +        if( rotate_map ) +        { +            gGL.pushMatrix(); +                gGL.translatef( ctr_x, ctr_y, 0 ); +                gl_washer_segment_2d(far_clip_pixels, 0, arc_start, arc_end, steps, map_frustum_color(), map_frustum_color()); +            gGL.popMatrix(); +        } +        else +        { +            gGL.pushMatrix(); +                gGL.translatef( ctr_x, ctr_y, 0 ); +                // If we don't rotate the map, we have to rotate the frustum. +                gGL.rotatef( atan2( LLViewerCamera::getInstance()->getAtAxis().mV[VX], LLViewerCamera::getInstance()->getAtAxis().mV[VY] ) * RAD_TO_DEG, 0.f, 0.f, -1.f); +                gl_washer_segment_2d(far_clip_pixels, 0, arc_start, arc_end, steps, map_frustum_color(), map_frustum_color()); +            gGL.popMatrix(); +        }  	}  	gGL.popMatrix(); diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index 82e1942aa5..ad2bc075c6 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -517,9 +517,6 @@       name="MapParcelOutlineColor"       value="1 1 0 0.5" />      <color -     name="MapFrustumRotatingColor" -     value="1 1 1 0.2" /> -    <color       name="MapTrackColor"       reference="Red" />      <color | 
