diff options
Diffstat (limited to 'linden/indra/newview/lltracker.cpp')
-rw-r--r-- | linden/indra/newview/lltracker.cpp | 51 |
1 files changed, 27 insertions, 24 deletions
diff --git a/linden/indra/newview/lltracker.cpp b/linden/indra/newview/lltracker.cpp index 4125bb6..feb4207 100644 --- a/linden/indra/newview/lltracker.cpp +++ b/linden/indra/newview/lltracker.cpp | |||
@@ -107,15 +107,6 @@ void LLTracker::stopTracking(void* userdata) | |||
107 | // static virtual | 107 | // static virtual |
108 | void LLTracker::drawHUDArrow() | 108 | void LLTracker::drawHUDArrow() |
109 | { | 109 | { |
110 | /* tracking autopilot destination has been disabled | ||
111 | -- 2004.01.09, Leviathan | ||
112 | // Draw dot for autopilot target | ||
113 | if (gAgent.getAutoPilot()) | ||
114 | { | ||
115 | instance()->drawMarker( gAgent.getAutoPilotTargetGlobal(), gTrackColor ); | ||
116 | return; | ||
117 | } | ||
118 | */ | ||
119 | switch (getTrackingStatus()) | 110 | switch (getTrackingStatus()) |
120 | { | 111 | { |
121 | case TRACKING_AVATAR: | 112 | case TRACKING_AVATAR: |
@@ -479,7 +470,6 @@ void LLTracker::renderBeacon(LLVector3d pos_global, | |||
479 | if (dist > 0.99f * gCamera->getFar()) | 470 | if (dist > 0.99f * gCamera->getFar()) |
480 | { | 471 | { |
481 | color_frac = 0.4f; | 472 | color_frac = 0.4f; |
482 | // pos_global = gAgent.getCameraPositionGlobal() + 0.99f*(gCamera->getFar()/dist)*to_vec; | ||
483 | } | 473 | } |
484 | else | 474 | else |
485 | { | 475 | { |
@@ -504,7 +494,6 @@ void LLTracker::renderBeacon(LLVector3d pos_global, | |||
504 | 494 | ||
505 | draw_shockwave(1024.f, gRenderStartTime.getElapsedTimeF32(), 32, fogged_color); | 495 | draw_shockwave(1024.f, gRenderStartTime.getElapsedTimeF32(), 32, fogged_color); |
506 | 496 | ||
507 | //glScalef(1.f, 1.f, 1000.f); | ||
508 | glColor4fv(fogged_color.mV); | 497 | glColor4fv(fogged_color.mV); |
509 | const U32 BEACON_VERTS = 256; | 498 | const U32 BEACON_VERTS = 256; |
510 | const F32 step = 1024.0f/BEACON_VERTS; | 499 | const F32 step = 1024.0f/BEACON_VERTS; |
@@ -554,24 +543,30 @@ void LLTracker::renderBeacon(LLVector3d pos_global, | |||
554 | glEnd(); | 543 | glEnd(); |
555 | } | 544 | } |
556 | 545 | ||
557 | //gCylinder.render(1000); | ||
558 | glPopMatrix(); | 546 | glPopMatrix(); |
559 | 547 | ||
560 | char text[1024]; /* Flawfinder: ignore */ | 548 | if (!gCamera || to_vec.magVec() > gCamera->getFar()) |
561 | snprintf(text, sizeof(text), "%.0f m", to_vec.magVec()); /* Flawfinder: ignore */ | 549 | { |
550 | hud_textp->clearString(); | ||
551 | } | ||
552 | else | ||
553 | { | ||
554 | char text[1024]; /* Flawfinder: ignore */ | ||
555 | snprintf(text, sizeof(text), "%.0f m", to_vec.magVec()); /* Flawfinder: ignore */ | ||
562 | 556 | ||
563 | LLWString wstr; | 557 | LLWString wstr; |
564 | wstr += utf8str_to_wstring(label); | 558 | wstr += utf8str_to_wstring(label); |
565 | wstr += '\n'; | 559 | wstr += '\n'; |
566 | wstr += utf8str_to_wstring(text); | 560 | wstr += utf8str_to_wstring(text); |
567 | 561 | ||
568 | hud_textp->setFont(LLFontGL::sSansSerif); | 562 | hud_textp->setFont(LLFontGL::sSansSerif); |
569 | hud_textp->setZCompare(FALSE); | 563 | hud_textp->setZCompare(FALSE); |
570 | hud_textp->setColor(LLColor4(1.f, 1.f, 1.f, llmax(0.2f, llmin(1.f,(dist-FADE_DIST)/FADE_DIST)))); | 564 | hud_textp->setColor(LLColor4(1.f, 1.f, 1.f, llmax(0.2f, llmin(1.f,(dist-FADE_DIST)/FADE_DIST)))); |
571 | 565 | ||
572 | hud_textp->setString(wstr); | 566 | hud_textp->setString(wstr); |
573 | hud_textp->setVertAlignment(LLHUDText::ALIGN_VERT_CENTER); | 567 | hud_textp->setVertAlignment(LLHUDText::ALIGN_VERT_CENTER); |
574 | hud_textp->setPositionAgent(pos_agent); | 568 | hud_textp->setPositionAgent(pos_agent); |
569 | } | ||
575 | } | 570 | } |
576 | 571 | ||
577 | 572 | ||
@@ -643,6 +638,14 @@ void LLTracker::drawMarker(const LLVector3d& pos_global, const LLColor4& color) | |||
643 | return; | 638 | return; |
644 | } | 639 | } |
645 | 640 | ||
641 | LLVector3d to_vec = pos_global - gAgent.getCameraPositionGlobal(); | ||
642 | to_vec.mdV[2] = 0; | ||
643 | |||
644 | if (to_vec.magVec() > gCamera->getFar()) | ||
645 | { //only draw arrow if lateral distance to object is less than view distance. | ||
646 | return; | ||
647 | } | ||
648 | |||
646 | // get position | 649 | // get position |
647 | LLVector3 pos_local = gAgent.getPosAgentFromGlobal(pos_global); | 650 | LLVector3 pos_local = gAgent.getPosAgentFromGlobal(pos_global); |
648 | 651 | ||