summaryrefslogtreecommitdiff
path: root/indra/newview/lltracker.cpp
diff options
context:
space:
mode:
authorChristian Goetze <cg@lindenlab.com>2007-08-21 22:17:53 +0000
committerChristian Goetze <cg@lindenlab.com>2007-08-21 22:17:53 +0000
commitce0a5fe14590b8d675b885fccd5f79d7ea17a302 (patch)
tree3388e6f8ff02292ec4521d278c841801462945b8 /indra/newview/lltracker.cpp
parentb699ae454d8477d19342d320758cd993d1d28cec (diff)
EFFECTIVE MERGE: svn merge -r 66133:68118 svn+ssh://svn/svn/linden/branches/maintenance into release
Actual action: branched maintenance-r68118, merged in release, then copied result into release
Diffstat (limited to 'indra/newview/lltracker.cpp')
-rw-r--r--indra/newview/lltracker.cpp51
1 files changed, 27 insertions, 24 deletions
diff --git a/indra/newview/lltracker.cpp b/indra/newview/lltracker.cpp
index 42ef25ac4e..4166cc16fe 100644
--- a/indra/newview/lltracker.cpp
+++ b/indra/newview/lltracker.cpp
@@ -87,15 +87,6 @@ void LLTracker::stopTracking(void* userdata)
// static virtual
void LLTracker::drawHUDArrow()
{
- /* tracking autopilot destination has been disabled
- -- 2004.01.09, Leviathan
- // Draw dot for autopilot target
- if (gAgent.getAutoPilot())
- {
- instance()->drawMarker( gAgent.getAutoPilotTargetGlobal(), gTrackColor );
- return;
- }
- */
switch (getTrackingStatus())
{
case TRACKING_AVATAR:
@@ -459,7 +450,6 @@ void LLTracker::renderBeacon(LLVector3d pos_global,
if (dist > 0.99f * gCamera->getFar())
{
color_frac = 0.4f;
- // pos_global = gAgent.getCameraPositionGlobal() + 0.99f*(gCamera->getFar()/dist)*to_vec;
}
else
{
@@ -484,7 +474,6 @@ void LLTracker::renderBeacon(LLVector3d pos_global,
draw_shockwave(1024.f, gRenderStartTime.getElapsedTimeF32(), 32, fogged_color);
- //glScalef(1.f, 1.f, 1000.f);
glColor4fv(fogged_color.mV);
const U32 BEACON_VERTS = 256;
const F32 step = 1024.0f/BEACON_VERTS;
@@ -534,24 +523,30 @@ void LLTracker::renderBeacon(LLVector3d pos_global,
glEnd();
}
- //gCylinder.render(1000);
glPopMatrix();
- char text[1024]; /* Flawfinder: ignore */
- snprintf(text, sizeof(text), "%.0f m", to_vec.magVec()); /* Flawfinder: ignore */
+ if (!gCamera || to_vec.magVec() > gCamera->getFar())
+ {
+ hud_textp->clearString();
+ }
+ else
+ {
+ char text[1024]; /* Flawfinder: ignore */
+ snprintf(text, sizeof(text), "%.0f m", to_vec.magVec()); /* Flawfinder: ignore */
- LLWString wstr;
- wstr += utf8str_to_wstring(label);
- wstr += '\n';
- wstr += utf8str_to_wstring(text);
+ LLWString wstr;
+ wstr += utf8str_to_wstring(label);
+ wstr += '\n';
+ wstr += utf8str_to_wstring(text);
- hud_textp->setFont(LLFontGL::sSansSerif);
- hud_textp->setZCompare(FALSE);
- hud_textp->setColor(LLColor4(1.f, 1.f, 1.f, llmax(0.2f, llmin(1.f,(dist-FADE_DIST)/FADE_DIST))));
+ hud_textp->setFont(LLFontGL::sSansSerif);
+ hud_textp->setZCompare(FALSE);
+ hud_textp->setColor(LLColor4(1.f, 1.f, 1.f, llmax(0.2f, llmin(1.f,(dist-FADE_DIST)/FADE_DIST))));
- hud_textp->setString(wstr);
- hud_textp->setVertAlignment(LLHUDText::ALIGN_VERT_CENTER);
- hud_textp->setPositionAgent(pos_agent);
+ hud_textp->setString(wstr);
+ hud_textp->setVertAlignment(LLHUDText::ALIGN_VERT_CENTER);
+ hud_textp->setPositionAgent(pos_agent);
+ }
}
@@ -623,6 +618,14 @@ void LLTracker::drawMarker(const LLVector3d& pos_global, const LLColor4& color)
return;
}
+ LLVector3d to_vec = pos_global - gAgent.getCameraPositionGlobal();
+ to_vec.mdV[2] = 0;
+
+ if (to_vec.magVec() > gCamera->getFar())
+ { //only draw arrow if lateral distance to object is less than view distance.
+ return;
+ }
+
// get position
LLVector3 pos_local = gAgent.getPosAgentFromGlobal(pos_global);