diff options
author | Jacek Antonelli | 2008-08-15 23:45:08 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:08 -0500 |
commit | d3536025fdb47955c02c897d8274b81d6f8eadbb (patch) | |
tree | 36d53aa6bccfad3a267d994d5d99cafb16aed498 /linden/indra/newview/lltracker.cpp | |
parent | Second Life viewer sources 1.18.3.2-RC (diff) | |
download | meta-impy-d3536025fdb47955c02c897d8274b81d6f8eadbb.zip meta-impy-d3536025fdb47955c02c897d8274b81d6f8eadbb.tar.gz meta-impy-d3536025fdb47955c02c897d8274b81d6f8eadbb.tar.bz2 meta-impy-d3536025fdb47955c02c897d8274b81d6f8eadbb.tar.xz |
Second Life viewer sources 1.18.3.3-RC
Diffstat (limited to 'linden/indra/newview/lltracker.cpp')
-rw-r--r-- | linden/indra/newview/lltracker.cpp | 51 |
1 files changed, 24 insertions, 27 deletions
diff --git a/linden/indra/newview/lltracker.cpp b/linden/indra/newview/lltracker.cpp index feb4207..4125bb6 100644 --- a/linden/indra/newview/lltracker.cpp +++ b/linden/indra/newview/lltracker.cpp | |||
@@ -107,6 +107,15 @@ 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 | */ | ||
110 | switch (getTrackingStatus()) | 119 | switch (getTrackingStatus()) |
111 | { | 120 | { |
112 | case TRACKING_AVATAR: | 121 | case TRACKING_AVATAR: |
@@ -470,6 +479,7 @@ void LLTracker::renderBeacon(LLVector3d pos_global, | |||
470 | if (dist > 0.99f * gCamera->getFar()) | 479 | if (dist > 0.99f * gCamera->getFar()) |
471 | { | 480 | { |
472 | color_frac = 0.4f; | 481 | color_frac = 0.4f; |
482 | // pos_global = gAgent.getCameraPositionGlobal() + 0.99f*(gCamera->getFar()/dist)*to_vec; | ||
473 | } | 483 | } |
474 | else | 484 | else |
475 | { | 485 | { |
@@ -494,6 +504,7 @@ void LLTracker::renderBeacon(LLVector3d pos_global, | |||
494 | 504 | ||
495 | draw_shockwave(1024.f, gRenderStartTime.getElapsedTimeF32(), 32, fogged_color); | 505 | draw_shockwave(1024.f, gRenderStartTime.getElapsedTimeF32(), 32, fogged_color); |
496 | 506 | ||
507 | //glScalef(1.f, 1.f, 1000.f); | ||
497 | glColor4fv(fogged_color.mV); | 508 | glColor4fv(fogged_color.mV); |
498 | const U32 BEACON_VERTS = 256; | 509 | const U32 BEACON_VERTS = 256; |
499 | const F32 step = 1024.0f/BEACON_VERTS; | 510 | const F32 step = 1024.0f/BEACON_VERTS; |
@@ -543,30 +554,24 @@ void LLTracker::renderBeacon(LLVector3d pos_global, | |||
543 | glEnd(); | 554 | glEnd(); |
544 | } | 555 | } |
545 | 556 | ||
557 | //gCylinder.render(1000); | ||
546 | glPopMatrix(); | 558 | glPopMatrix(); |
547 | 559 | ||
548 | if (!gCamera || to_vec.magVec() > gCamera->getFar()) | 560 | char text[1024]; /* Flawfinder: ignore */ |
549 | { | 561 | snprintf(text, sizeof(text), "%.0f m", to_vec.magVec()); /* Flawfinder: ignore */ |
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 */ | ||
556 | 562 | ||
557 | LLWString wstr; | 563 | LLWString wstr; |
558 | wstr += utf8str_to_wstring(label); | 564 | wstr += utf8str_to_wstring(label); |
559 | wstr += '\n'; | 565 | wstr += '\n'; |
560 | wstr += utf8str_to_wstring(text); | 566 | wstr += utf8str_to_wstring(text); |
561 | 567 | ||
562 | hud_textp->setFont(LLFontGL::sSansSerif); | 568 | hud_textp->setFont(LLFontGL::sSansSerif); |
563 | hud_textp->setZCompare(FALSE); | 569 | hud_textp->setZCompare(FALSE); |
564 | hud_textp->setColor(LLColor4(1.f, 1.f, 1.f, llmax(0.2f, llmin(1.f,(dist-FADE_DIST)/FADE_DIST)))); | 570 | hud_textp->setColor(LLColor4(1.f, 1.f, 1.f, llmax(0.2f, llmin(1.f,(dist-FADE_DIST)/FADE_DIST)))); |
565 | 571 | ||
566 | hud_textp->setString(wstr); | 572 | hud_textp->setString(wstr); |
567 | hud_textp->setVertAlignment(LLHUDText::ALIGN_VERT_CENTER); | 573 | hud_textp->setVertAlignment(LLHUDText::ALIGN_VERT_CENTER); |
568 | hud_textp->setPositionAgent(pos_agent); | 574 | hud_textp->setPositionAgent(pos_agent); |
569 | } | ||
570 | } | 575 | } |
571 | 576 | ||
572 | 577 | ||
@@ -638,14 +643,6 @@ void LLTracker::drawMarker(const LLVector3d& pos_global, const LLColor4& color) | |||
638 | return; | 643 | return; |
639 | } | 644 | } |
640 | 645 | ||
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 | |||
649 | // get position | 646 | // get position |
650 | LLVector3 pos_local = gAgent.getPosAgentFromGlobal(pos_global); | 647 | LLVector3 pos_local = gAgent.getPosAgentFromGlobal(pos_global); |
651 | 648 | ||