summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerobject.cpp
diff options
context:
space:
mode:
authorskolb <none@none>2009-12-01 13:34:16 -0800
committerskolb <none@none>2009-12-01 13:34:16 -0800
commit0ab6d36094cc52eea063f6d3b05262c111857f29 (patch)
tree95840e0bf49f744520649b030d4bd65b99275bcf /indra/newview/llviewerobject.cpp
parent6dd3f54924b57224298f6d76c766b403d165783f (diff)
parent6a888b653a1ee5ed0eeedd8994ff59652f2913aa (diff)
Merge
Diffstat (limited to 'indra/newview/llviewerobject.cpp')
-rw-r--r--indra/newview/llviewerobject.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index e491e11960..3c79045cc5 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -2767,22 +2767,23 @@ void LLViewerObject::setPixelAreaAndAngle(LLAgent &agent)
// I don't think there's a better way to do this without calculating distance per-poly
F32 range = sqrt(dx*dx + dy*dy + dz*dz) - min_scale/2;
+ LLViewerCamera* camera = LLViewerCamera::getInstance();
if (range < 0.001f || isHUDAttachment()) // range == zero
{
mAppAngle = 180.f;
- mPixelArea = (F32)LLViewerCamera::getInstance()->getScreenPixelArea();
+ mPixelArea = (F32)camera->getScreenPixelArea();
}
else
{
mAppAngle = (F32) atan2( max_scale, range) * RAD_TO_DEG;
- F32 pixels_per_meter = LLViewerCamera::getInstance()->getPixelMeterRatio() / range;
+ F32 pixels_per_meter = camera->getPixelMeterRatio() / range;
mPixelArea = (pixels_per_meter * max_scale) * (pixels_per_meter * mid_scale);
- if (mPixelArea > LLViewerCamera::getInstance()->getScreenPixelArea())
+ if (mPixelArea > camera->getScreenPixelArea())
{
mAppAngle = 180.f;
- mPixelArea = (F32)LLViewerCamera::getInstance()->getScreenPixelArea();
+ mPixelArea = (F32)camera->getScreenPixelArea();
}
}
}