aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/lltracker.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:42 -0500
committerJacek Antonelli2008-08-15 23:45:42 -0500
commitce28e056c20bf2723f565bbf464b87781ec248a2 (patch)
treeef7b0501c4de4b631a916305cbc2a5fdc125e52d /linden/indra/newview/lltracker.cpp
parentSecond Life viewer sources 1.19.1.4b (diff)
downloadmeta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.zip
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.gz
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.bz2
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.xz
Second Life viewer sources 1.20.2
Diffstat (limited to 'linden/indra/newview/lltracker.cpp')
-rw-r--r--linden/indra/newview/lltracker.cpp29
1 files changed, 10 insertions, 19 deletions
diff --git a/linden/indra/newview/lltracker.cpp b/linden/indra/newview/lltracker.cpp
index c1c060c..9ff2e97 100644
--- a/linden/indra/newview/lltracker.cpp
+++ b/linden/indra/newview/lltracker.cpp
@@ -135,18 +135,14 @@ void LLTracker::drawHUDArrow()
135 break; 135 break;
136 136
137 case TRACKING_LOCATION: 137 case TRACKING_LOCATION:
138 if (!gWorldp)
139 {
140 break;
141 }
142 // HACK -- try to keep the location just above the terrain 138 // HACK -- try to keep the location just above the terrain
143#if 0 139#if 0
144 // UNHACKED by CRO - keep location where the location is 140 // UNHACKED by CRO - keep location where the location is
145 instance()->mTrackedPositionGlobal.mdV[VZ] = 141 instance()->mTrackedPositionGlobal.mdV[VZ] =
146 0.9f * instance()->mTrackedPositionGlobal.mdV[VZ] 142 0.9f * instance()->mTrackedPositionGlobal.mdV[VZ]
147 + 0.1f * (gWorldp->resolveLandHeightGlobal(getTrackedPositionGlobal()) + 1.5f); 143 + 0.1f * (LLWorld::getInstance()->resolveLandHeightGlobal(getTrackedPositionGlobal()) + 1.5f);
148#endif 144#endif
149 instance()->mTrackedPositionGlobal.mdV[VZ] = llclamp((F32)instance()->mTrackedPositionGlobal.mdV[VZ], gWorldp->resolveLandHeightGlobal(getTrackedPositionGlobal()) + 1.5f, (F32)instance()->getTrackedPositionGlobal().mdV[VZ]); 145 instance()->mTrackedPositionGlobal.mdV[VZ] = llclamp((F32)instance()->mTrackedPositionGlobal.mdV[VZ], LLWorld::getInstance()->resolveLandHeightGlobal(getTrackedPositionGlobal()) + 1.5f, (F32)instance()->getTrackedPositionGlobal().mdV[VZ]);
150 instance()->drawMarker( getTrackedPositionGlobal(), gTrackColor ); 146 instance()->drawMarker( getTrackedPositionGlobal(), gTrackColor );
151 break; 147 break;
152 148
@@ -480,14 +476,14 @@ void LLTracker::renderBeacon(LLVector3d pos_global,
480 476
481 F32 dist = (F32)to_vec.magVec(); 477 F32 dist = (F32)to_vec.magVec();
482 F32 color_frac = 1.f; 478 F32 color_frac = 1.f;
483 if (dist > 0.99f * gCamera->getFar()) 479 if (dist > 0.99f * LLViewerCamera::getInstance()->getFar())
484 { 480 {
485 color_frac = 0.4f; 481 color_frac = 0.4f;
486 // pos_global = gAgent.getCameraPositionGlobal() + 0.99f*(gCamera->getFar()/dist)*to_vec; 482 // pos_global = gAgent.getCameraPositionGlobal() + 0.99f*(LLViewerCamera::getInstance()->getFar()/dist)*to_vec;
487 } 483 }
488 else 484 else
489 { 485 {
490 color_frac = 1.f - 0.6f*(dist/gCamera->getFar()); 486 color_frac = 1.f - 0.6f*(dist/LLViewerCamera::getInstance()->getFar());
491 } 487 }
492 488
493 LLColor4 fogged_color = color_frac * color + (1 - color_frac)*gSky.getFogColor(); 489 LLColor4 fogged_color = color_frac * color + (1 - color_frac)*gSky.getFogColor();
@@ -512,9 +508,9 @@ void LLTracker::renderBeacon(LLVector3d pos_global,
512 const U32 BEACON_VERTS = 256; 508 const U32 BEACON_VERTS = 256;
513 const F32 step = 1024.0f/BEACON_VERTS; 509 const F32 step = 1024.0f/BEACON_VERTS;
514 510
515 LLVector3 x_axis = gCamera->getLeftAxis(); 511 LLVector3 x_axis = LLViewerCamera::getInstance()->getLeftAxis();
516 F32 t = gRenderStartTime.getElapsedTimeF32(); 512 F32 t = gRenderStartTime.getElapsedTimeF32();
517 F32 dr = dist/gCamera->getFar(); 513 F32 dr = dist/LLViewerCamera::getInstance()->getFar();
518 514
519 for (U32 i = 0; i < BEACON_VERTS; i++) 515 for (U32 i = 0; i < BEACON_VERTS; i++)
520 { 516 {
@@ -645,11 +641,6 @@ void LLTracker::clearFocus()
645 641
646void LLTracker::drawMarker(const LLVector3d& pos_global, const LLColor4& color) 642void LLTracker::drawMarker(const LLVector3d& pos_global, const LLColor4& color)
647{ 643{
648 if (!gCamera)
649 {
650 return;
651 }
652
653 // get position 644 // get position
654 LLVector3 pos_local = gAgent.getPosAgentFromGlobal(pos_global); 645 LLVector3 pos_local = gAgent.getPosAgentFromGlobal(pos_global);
655 646
@@ -659,8 +650,8 @@ void LLTracker::drawMarker(const LLVector3d& pos_global, const LLColor4& color)
659 S32 y = 0; 650 S32 y = 0;
660 const BOOL CLAMP = TRUE; 651 const BOOL CLAMP = TRUE;
661 652
662 if (gCamera->projectPosAgentToScreen(pos_local, screen, CLAMP) 653 if (LLViewerCamera::getInstance()->projectPosAgentToScreen(pos_local, screen, CLAMP)
663 || gCamera->projectPosAgentToScreenEdge(pos_local, screen) ) 654 || LLViewerCamera::getInstance()->projectPosAgentToScreenEdge(pos_local, screen) )
664 { 655 {
665 gHUDView->screenPointToLocal(screen.mX, screen.mY, &x, &y); 656 gHUDView->screenPointToLocal(screen.mX, screen.mY, &x, &y);
666 657
@@ -727,7 +718,7 @@ void LLTracker::drawMarker(const LLVector3d& pos_global, const LLColor4& color)
727 mHUDArrowCenterY - half_arrow_size, 718 mHUDArrowCenterY - half_arrow_size,
728 HUD_ARROW_SIZE, HUD_ARROW_SIZE, 719 HUD_ARROW_SIZE, HUD_ARROW_SIZE,
729 RAD_TO_DEG * angle, 720 RAD_TO_DEG * angle,
730 LLWorldMapView::sTrackArrowImage, 721 LLWorldMapView::sTrackArrowImage->getImage(),
731 color); 722 color);
732 } 723 }
733} 724}