diff options
author | James Cook <james@lindenlab.com> | 2009-11-30 14:41:52 -0800 |
---|---|---|
committer | James Cook <james@lindenlab.com> | 2009-11-30 14:41:52 -0800 |
commit | 7d3b3cc474822db144b623980d08b7addc2f77ff (patch) | |
tree | 7d972191820ff94840a6f48d7f30b17fb6f3316a /indra/newview/llface.cpp | |
parent | 447d1c6498870e82834c3b404fa507aee331f45b (diff) |
Linker optimization - use "extern template" for commonly regenerated templates
Also replaced many duplicate calls to LLViewerCamera::getInstance() with local pointer.
Reviewed with Ambroff
Diffstat (limited to 'indra/newview/llface.cpp')
-rw-r--r-- | indra/newview/llface.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 31f1462a12..eef774426a 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -1378,7 +1378,8 @@ F32 LLFace::calcPixelArea(F32& cos_angle_to_view_dir, F32& radius) LLVector3 center = getPositionAgent(); LLVector3 size = (mExtents[1] - mExtents[0]) * 0.5f; - LLVector3 lookAt = center - LLViewerCamera::getInstance()->getOrigin(); + LLViewerCamera* camera = LLViewerCamera::getInstance(); + LLVector3 lookAt = center - camera->getOrigin(); F32 dist = lookAt.normVec() ; //get area of circle around node @@ -1393,7 +1394,7 @@ F32 LLFace::calcPixelArea(F32& cos_angle_to_view_dir, F32& radius) } else { - cos_angle_to_view_dir = lookAt * LLViewerCamera::getInstance()->getXAxis() ; + cos_angle_to_view_dir = lookAt * camera->getXAxis() ; mImportanceToCamera = LLFace::calcImportanceToCamera(cos_angle_to_view_dir, dist) ; } @@ -1443,8 +1444,9 @@ F32 LLFace::calcImportanceToCamera(F32 cos_angle_to_view_dir, F32 dist) if(cos_angle_to_view_dir > LLViewerCamera::getInstance()->getCosHalfFov() && dist < FACE_IMPORTANCE_TO_CAMERA_OVER_DISTANCE[FACE_IMPORTANCE_LEVEL - 1][0]) { - F32 camera_moving_speed = LLViewerCamera::getInstance()->getAverageSpeed() ; - F32 camera_angular_speed = LLViewerCamera::getInstance()->getAverageAngularSpeed(); + LLViewerCamera* camera = LLViewerCamera::getInstance(); + F32 camera_moving_speed = camera->getAverageSpeed() ; + F32 camera_angular_speed = camera->getAverageAngularSpeed(); if(camera_moving_speed > 10.0f || camera_angular_speed > 1.0f) { |