summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llbottomtray.cpp4
-rw-r--r--indra/newview/llbottomtray.h6
-rw-r--r--indra/newview/lldynamictexture.cpp22
-rw-r--r--indra/newview/llface.cpp10
-rw-r--r--indra/newview/llhudicon.cpp18
-rw-r--r--indra/newview/llhudrender.cpp13
-rw-r--r--indra/newview/llselectmgr.cpp1
-rw-r--r--indra/newview/llselectmgr.h4
-rw-r--r--indra/newview/llviewercamera.cpp1
-rw-r--r--indra/newview/llviewercamera.h4
-rw-r--r--indra/newview/llviewerobject.cpp9
-rw-r--r--indra/newview/llviewerparceloverlay.cpp3
-rw-r--r--indra/newview/llviewerpartsim.cpp10
-rw-r--r--indra/newview/llvoicevisualizer.cpp9
-rw-r--r--indra/newview/llvopartgroup.cpp3
-rw-r--r--indra/newview/llvovolume.cpp9
-rw-r--r--indra/newview/pipeline.cpp33
17 files changed, 93 insertions, 66 deletions
diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp
index 4823932951..c44b0b5331 100644
--- a/indra/newview/llbottomtray.cpp
+++ b/indra/newview/llbottomtray.cpp
@@ -31,6 +31,8 @@
*/
#include "llviewerprecompiledheaders.h" // must be first include
+
+#define LLBOTTOMTRAY_CPP
#include "llbottomtray.h"
#include "llagent.h"
@@ -46,7 +48,7 @@
#include "llsyswellwindow.h"
#include "llfloatercamera.h"
-// Build time optimization, generate this once in .cpp file
+// Build time optimization, generate extern template once in .cpp file
template class LLBottomTray* LLSingleton<class LLBottomTray>::getInstance();
LLBottomTray::LLBottomTray(const LLSD&)
diff --git a/indra/newview/llbottomtray.h b/indra/newview/llbottomtray.h
index 30f5f88cce..728a420324 100644
--- a/indra/newview/llbottomtray.h
+++ b/indra/newview/llbottomtray.h
@@ -47,8 +47,10 @@ class LLSpeakButton;
class LLNearbyChatBar;
class LLIMChiclet;
-// Build time optimization, generate this once in .cpp file
-//extern template class LLBottomTray* LLSingleton<class LLBottomTray>::getInstance();
+// Build time optimization, generate once in .cpp file
+#ifndef LLBOTTOMTRAY_CPP
+extern template class LLBottomTray* LLSingleton<class LLBottomTray>::getInstance();
+#endif
class LLBottomTray
: public LLSingleton<LLBottomTray>
diff --git a/indra/newview/lldynamictexture.cpp b/indra/newview/lldynamictexture.cpp
index 9bc7221dc8..c7c79401a0 100644
--- a/indra/newview/lldynamictexture.cpp
+++ b/indra/newview/lldynamictexture.cpp
@@ -141,11 +141,12 @@ void LLViewerDynamicTexture::preRender(BOOL clear_depth)
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
}
// Set up camera
- mCamera.setOrigin(*LLViewerCamera::getInstance());
- mCamera.setAxes(*LLViewerCamera::getInstance());
- mCamera.setAspect(LLViewerCamera::getInstance()->getAspect());
- mCamera.setView(LLViewerCamera::getInstance()->getView());
- mCamera.setNear(LLViewerCamera::getInstance()->getNear());
+ LLViewerCamera* camera = LLViewerCamera::getInstance();
+ mCamera.setOrigin(*camera);
+ mCamera.setAxes(*camera);
+ mCamera.setAspect(camera->getAspect());
+ mCamera.setView(camera->getView());
+ mCamera.setNear(camera->getNear());
glViewport(mOrigin.mX, mOrigin.mY, mFullWidth, mFullHeight);
if (clear_depth)
@@ -174,11 +175,12 @@ void LLViewerDynamicTexture::postRender(BOOL success)
gViewerWindow->setup2DViewport();
// restore camera
- LLViewerCamera::getInstance()->setOrigin(mCamera);
- LLViewerCamera::getInstance()->setAxes(mCamera);
- LLViewerCamera::getInstance()->setAspect(mCamera.getAspect());
- LLViewerCamera::getInstance()->setView(mCamera.getView());
- LLViewerCamera::getInstance()->setNear(mCamera.getNear());
+ LLViewerCamera* camera = LLViewerCamera::getInstance();
+ camera->setOrigin(mCamera);
+ camera->setAxes(mCamera);
+ camera->setAspect(mCamera.getAspect());
+ camera->setView(mCamera.getView());
+ camera->setNear(mCamera.getNear());
}
//-----------------------------------------------------------------------------
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)
{
diff --git a/indra/newview/llhudicon.cpp b/indra/newview/llhudicon.cpp
index 040027c70d..28b0e7356a 100644
--- a/indra/newview/llhudicon.cpp
+++ b/indra/newview/llhudicon.cpp
@@ -103,28 +103,29 @@ void LLHUDIcon::renderIcon(BOOL for_select)
// put icon above object, and in front
// RN: don't use drawable radius, it's fricking HUGE
- LLVector3 icon_relative_pos = (LLViewerCamera::getInstance()->getUpAxis() * ~mSourceObject->getRenderRotation());
+ LLViewerCamera* camera = LLViewerCamera::getInstance();
+ LLVector3 icon_relative_pos = (camera->getUpAxis() * ~mSourceObject->getRenderRotation());
icon_relative_pos.abs();
F32 distance_scale = llmin(mSourceObject->getScale().mV[VX] / icon_relative_pos.mV[VX],
mSourceObject->getScale().mV[VY] / icon_relative_pos.mV[VY],
mSourceObject->getScale().mV[VZ] / icon_relative_pos.mV[VZ]);
F32 up_distance = 0.5f * distance_scale;
- LLVector3 icon_position = obj_position + (up_distance * LLViewerCamera::getInstance()->getUpAxis()) * 1.2f;
+ LLVector3 icon_position = obj_position + (up_distance * camera->getUpAxis()) * 1.2f;
LLVector3 icon_to_cam = LLViewerCamera::getInstance()->getOrigin() - icon_position;
icon_to_cam.normVec();
icon_position += icon_to_cam * mSourceObject->mDrawable->getRadius() * 1.1f;
- mDistance = dist_vec(icon_position, LLViewerCamera::getInstance()->getOrigin());
+ mDistance = dist_vec(icon_position, camera->getOrigin());
F32 alpha_factor = for_select ? 1.f : clamp_rescale(mDistance, DIST_START_FADE, DIST_END_FADE, 1.f, 0.f);
LLVector3 x_pixel_vec;
LLVector3 y_pixel_vec;
- LLViewerCamera::getInstance()->getPixelVectors(icon_position, y_pixel_vec, x_pixel_vec);
+ camera->getPixelVectors(icon_position, y_pixel_vec, x_pixel_vec);
F32 scale_factor = 1.f;
if (mAnimTimer.getElapsedTimeF32() < ANIM_TIME)
@@ -226,26 +227,27 @@ BOOL LLHUDIcon::lineSegmentIntersect(const LLVector3& start, const LLVector3& en
// put icon above object, and in front
// RN: don't use drawable radius, it's fricking HUGE
- LLVector3 icon_relative_pos = (LLViewerCamera::getInstance()->getUpAxis() * ~mSourceObject->getRenderRotation());
+ LLViewerCamera* camera = LLViewerCamera::getInstance();
+ LLVector3 icon_relative_pos = (camera->getUpAxis() * ~mSourceObject->getRenderRotation());
icon_relative_pos.abs();
F32 distance_scale = llmin(mSourceObject->getScale().mV[VX] / icon_relative_pos.mV[VX],
mSourceObject->getScale().mV[VY] / icon_relative_pos.mV[VY],
mSourceObject->getScale().mV[VZ] / icon_relative_pos.mV[VZ]);
F32 up_distance = 0.5f * distance_scale;
- LLVector3 icon_position = obj_position + (up_distance * LLViewerCamera::getInstance()->getUpAxis()) * 1.2f;
+ LLVector3 icon_position = obj_position + (up_distance * camera->getUpAxis()) * 1.2f;
LLVector3 icon_to_cam = LLViewerCamera::getInstance()->getOrigin() - icon_position;
icon_to_cam.normVec();
icon_position += icon_to_cam * mSourceObject->mDrawable->getRadius() * 1.1f;
- mDistance = dist_vec(icon_position, LLViewerCamera::getInstance()->getOrigin());
+ mDistance = dist_vec(icon_position, camera->getOrigin());
LLVector3 x_pixel_vec;
LLVector3 y_pixel_vec;
- LLViewerCamera::getInstance()->getPixelVectors(icon_position, y_pixel_vec, x_pixel_vec);
+ camera->getPixelVectors(icon_position, y_pixel_vec, x_pixel_vec);
F32 scale_factor = 1.f;
if (mAnimTimer.getElapsedTimeF32() < ANIM_TIME)
diff --git a/indra/newview/llhudrender.cpp b/indra/newview/llhudrender.cpp
index ab0be90def..a02dc3355b 100644
--- a/indra/newview/llhudrender.cpp
+++ b/indra/newview/llhudrender.cpp
@@ -64,11 +64,12 @@ void hud_render_text(const LLWString &wstr, const LLVector3 &pos_agent,
const LLColor4& color,
const BOOL orthographic)
{
+ LLViewerCamera* camera = LLViewerCamera::getInstance();
// Do cheap plane culling
- LLVector3 dir_vec = pos_agent - LLViewerCamera::getInstance()->getOrigin();
+ LLVector3 dir_vec = pos_agent - camera->getOrigin();
dir_vec /= dir_vec.magVec();
- if (wstr.empty() || (!orthographic && dir_vec * LLViewerCamera::getInstance()->getAtAxis() <= 0.f))
+ if (wstr.empty() || (!orthographic && dir_vec * camera->getAtAxis() <= 0.f))
{
return;
}
@@ -82,15 +83,15 @@ void hud_render_text(const LLWString &wstr, const LLVector3 &pos_agent,
}
else
{
- LLViewerCamera::getInstance()->getPixelVectors(pos_agent, up_axis, right_axis);
+ camera->getPixelVectors(pos_agent, up_axis, right_axis);
}
- LLCoordFrame render_frame = *LLViewerCamera::getInstance();
+ LLCoordFrame render_frame = *camera;
LLQuaternion rot;
if (!orthographic)
{
rot = render_frame.getQuaternion();
- rot = rot * LLQuaternion(-F_PI_BY_TWO, LLViewerCamera::getInstance()->getYAxis());
- rot = rot * LLQuaternion(F_PI_BY_TWO, LLViewerCamera::getInstance()->getXAxis());
+ rot = rot * LLQuaternion(-F_PI_BY_TWO, camera->getYAxis());
+ rot = rot * LLQuaternion(F_PI_BY_TWO, camera->getXAxis());
}
else
{
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index 4394271ec4..1605838b94 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -33,6 +33,7 @@
#include "llviewerprecompiledheaders.h"
// file include
+#define LLSELECTMGR_CPP
#include "llselectmgr.h"
// library includes
diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h
index 57e0ee4e0e..6641be335a 100644
--- a/indra/newview/llselectmgr.h
+++ b/indra/newview/llselectmgr.h
@@ -324,7 +324,9 @@ private:
typedef LLSafeHandle<LLObjectSelection> LLObjectSelectionHandle;
// Build time optimization, generate this once in .cpp file
-//extern template class LLSelectMgr* LLSingleton<class LLSelectMgr>::getInstance();
+#ifndef LLSELECTMGR_CPP
+extern template class LLSelectMgr* LLSingleton<class LLSelectMgr>::getInstance();
+#endif
class LLSelectMgr : public LLEditMenuHandler, public LLSingleton<LLSelectMgr>
{
diff --git a/indra/newview/llviewercamera.cpp b/indra/newview/llviewercamera.cpp
index 221db2defa..bd4f172907 100644
--- a/indra/newview/llviewercamera.cpp
+++ b/indra/newview/llviewercamera.cpp
@@ -32,6 +32,7 @@
#include "llviewerprecompiledheaders.h"
+#define LLVIEWERCAMERA_CPP
#include "llviewercamera.h"
// Viewer includes
diff --git a/indra/newview/llviewercamera.h b/indra/newview/llviewercamera.h
index bf561c3e4d..cd67af5fef 100644
--- a/indra/newview/llviewercamera.h
+++ b/indra/newview/llviewercamera.h
@@ -53,7 +53,9 @@ const BOOL FOR_SELECTION = TRUE;
const BOOL NOT_FOR_SELECTION = FALSE;
// Build time optimization, generate this once in .cpp file
-//extern template class LLViewerCamera* LLSingleton<class LLViewerCamera>::getInstance();
+#ifndef LLVIEWERCAMERA_CPP
+extern template class LLViewerCamera* LLSingleton<class LLViewerCamera>::getInstance();
+#endif
class LLViewerCamera : public LLCamera, public LLSingleton<LLViewerCamera>
{
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();
}
}
}
diff --git a/indra/newview/llviewerparceloverlay.cpp b/indra/newview/llviewerparceloverlay.cpp
index 9896adad97..9de1ef7190 100644
--- a/indra/newview/llviewerparceloverlay.cpp
+++ b/indra/newview/llviewerparceloverlay.cpp
@@ -808,6 +808,7 @@ S32 LLViewerParcelOverlay::renderPropertyLines ()
S32 drawn = 0;
F32* vertexp;
U8* colorp;
+ bool render_hidden = LLSelectMgr::sRenderHiddenSelections && LLFloaterReg::instanceVisible("build");
const F32 PROPERTY_LINE_CLIP_DIST = 256.f;
@@ -849,7 +850,7 @@ S32 LLViewerParcelOverlay::renderPropertyLines ()
gGL.end();
- if (LLSelectMgr::sRenderHiddenSelections && LLFloaterReg::instanceVisible("build"))
+ if (render_hidden)
{
LLGLDepthTest depth(GL_TRUE, GL_FALSE, GL_GREATER);
diff --git a/indra/newview/llviewerpartsim.cpp b/indra/newview/llviewerpartsim.cpp
index cfb8340462..841a7ccc5e 100644
--- a/indra/newview/llviewerpartsim.cpp
+++ b/indra/newview/llviewerpartsim.cpp
@@ -71,9 +71,9 @@ const F32 LLViewerPartSim::PART_ADAPT_RATE_MULT_RECIP = 1.0f/PART_ADAPT_RATE_MUL
U32 LLViewerPart::sNextPartID = 1;
-F32 calc_desired_size(LLVector3 pos, LLVector2 scale)
+F32 calc_desired_size(LLViewerCamera* camera, LLVector3 pos, LLVector2 scale)
{
- F32 desired_size = (pos-LLViewerCamera::getInstance()->getOrigin()).magVec();
+ F32 desired_size = (pos - camera->getOrigin()).magVec();
desired_size /= 4;
return llclamp(desired_size, scale.magVec()*0.5f, PART_SIM_BOX_SIDE*2);
}
@@ -273,6 +273,7 @@ void LLViewerPartGroup::updateParticles(const F32 lastdt)
LLViewerPartSim::checkParticleCount(mParticles.size());
+ LLViewerCamera* camera = LLViewerCamera::getInstance();
LLViewerRegion *regionp = getRegion();
S32 end = (S32) mParticles.size();
for (S32 i = 0 ; i < (S32)mParticles.size();)
@@ -394,7 +395,7 @@ void LLViewerPartGroup::updateParticles(const F32 lastdt)
}
else
{
- F32 desired_size = calc_desired_size(part->mPosAgent, part->mScale);
+ F32 desired_size = calc_desired_size(camera, part->mPosAgent, part->mScale);
if (!posInGroup(part->mPosAgent, desired_size))
{
// Transfer particles between groups
@@ -557,7 +558,8 @@ LLViewerPartGroup *LLViewerPartSim::put(LLViewerPart* part)
}
else
{
- F32 desired_size = calc_desired_size(part->mPosAgent, part->mScale);
+ LLViewerCamera* camera = LLViewerCamera::getInstance();
+ F32 desired_size = calc_desired_size(camera, part->mPosAgent, part->mScale);
S32 count = (S32) mViewerPartGroups.size();
for (S32 i = 0; i < count; i++)
diff --git a/indra/newview/llvoicevisualizer.cpp b/indra/newview/llvoicevisualizer.cpp
index e777d7362f..4794cab32e 100644
--- a/indra/newview/llvoicevisualizer.cpp
+++ b/indra/newview/llvoicevisualizer.cpp
@@ -369,8 +369,9 @@ void LLVoiceVisualizer::render()
//-------------------------------------------------------------
// create coordinates of the geometry for the dot
//-------------------------------------------------------------
- LLVector3 l = LLViewerCamera::getInstance()->getLeftAxis() * DOT_SIZE;
- LLVector3 u = LLViewerCamera::getInstance()->getUpAxis() * DOT_SIZE;
+ LLViewerCamera* camera = LLViewerCamera::getInstance();
+ LLVector3 l = camera->getLeftAxis() * DOT_SIZE;
+ LLVector3 u = camera->getUpAxis() * DOT_SIZE;
LLVector3 bottomLeft = mSoundSymbol.mPosition + l - u;
LLVector3 bottomRight = mSoundSymbol.mPosition - l - u;
@@ -496,8 +497,8 @@ void LLVoiceVisualizer::render()
F32 width = i * WAVE_WIDTH_SCALE * mSoundSymbol.mWaveExpansion[i];
F32 height = i * WAVE_HEIGHT_SCALE * mSoundSymbol.mWaveExpansion[i];
- LLVector3 l = LLViewerCamera::getInstance()->getLeftAxis() * width;
- LLVector3 u = LLViewerCamera::getInstance()->getUpAxis() * height;
+ LLVector3 l = camera->getLeftAxis() * width;
+ LLVector3 u = camera->getUpAxis() * height;
LLVector3 bottomLeft = mSoundSymbol.mPosition + l - u;
LLVector3 bottomRight = mSoundSymbol.mPosition - l - u;
diff --git a/indra/newview/llvopartgroup.cpp b/indra/newview/llvopartgroup.cpp
index 9dd0b598dc..139d2fbd88 100644
--- a/indra/newview/llvopartgroup.cpp
+++ b/indra/newview/llvopartgroup.cpp
@@ -386,6 +386,7 @@ void LLParticlePartition::addGeometryCount(LLSpatialGroup* group, U32& vertex_co
mFaceList.clear();
+ LLViewerCamera* camera = LLViewerCamera::getInstance();
for (LLSpatialGroup::element_iter i = group->getData().begin(); i != group->getData().end(); ++i)
{
LLDrawable* drawablep = *i;
@@ -415,7 +416,7 @@ void LLParticlePartition::addGeometryCount(LLSpatialGroup* group, U32& vertex_co
}
count++;
- facep->mDistance = (facep->mCenterLocal - LLViewerCamera::getInstance()->getOrigin()) * LLViewerCamera::getInstance()->getAtAxis();
+ facep->mDistance = (facep->mCenterLocal - camera->getOrigin()) * camera->getAtAxis();
obj->mDepth += facep->mDistance;
mFaceList.push_back(facep);
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 48bd387022..1ee0811ba6 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -622,6 +622,7 @@ void LLVOVolume::updateTextureVirtualSize()
const S32 num_faces = mDrawable->getNumFaces();
F32 min_vsize=999999999.f, max_vsize=0.f;
+ LLViewerCamera* camera = LLViewerCamera::getInstance();
for (S32 i = 0; i < num_faces; i++)
{
LLFace* face = mDrawable->getFace(i);
@@ -638,7 +639,7 @@ void LLVOVolume::updateTextureVirtualSize()
if (isHUDAttachment())
{
- F32 area = (F32) LLViewerCamera::getInstance()->getScreenPixelArea();
+ F32 area = (F32) camera->getScreenPixelArea();
vsize = area;
imagep->setBoostLevel(LLViewerTexture::BOOST_HUD);
face->setPixelArea(area); // treat as full screen
@@ -704,9 +705,9 @@ void LLVOVolume::updateTextureVirtualSize()
//if the sculpty very close to the view point, load first
{
- LLVector3 lookAt = getPositionAgent() - LLViewerCamera::getInstance()->getOrigin();
+ LLVector3 lookAt = getPositionAgent() - camera->getOrigin();
F32 dist = lookAt.normVec() ;
- F32 cos_angle_to_view_dir = lookAt * LLViewerCamera::getInstance()->getXAxis() ;
+ F32 cos_angle_to_view_dir = lookAt * camera->getXAxis() ;
mSculptTexture->setAdditionalDecodePriority(0.8f * LLFace::calcImportanceToCamera(cos_angle_to_view_dir, dist)) ;
}
}
@@ -741,7 +742,7 @@ void LLVOVolume::updateTextureVirtualSize()
F32 rad = getLightRadius();
mLightTexture->addTextureStats(gPipeline.calcPixelArea(getPositionAgent(),
LLVector3(rad,rad,rad),
- *LLViewerCamera::getInstance()));
+ *camera));
}
}
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index f908a015df..21b297c4ee 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -3768,9 +3768,10 @@ void LLPipeline::renderForSelect(std::set<LLViewerObject*>& objects, BOOL render
gGL.setColorMask(true, false);
gPipeline.resetDrawOrders();
+ LLViewerCamera* camera = LLViewerCamera::getInstance();
for (std::set<LLViewerObject*>::iterator iter = objects.begin(); iter != objects.end(); ++iter)
{
- stateSort((*iter)->mDrawable, *LLViewerCamera::getInstance());
+ stateSort((*iter)->mDrawable, *camera);
}
LLMemType mt(LLMemType::MTYPE_PIPELINE_RENDER_SELECT);
@@ -6248,6 +6249,7 @@ void LLPipeline::renderDeferredLighting()
{
LLFastTimer ftm(FTM_RENDER_DEFERRED);
+ LLViewerCamera* camera = LLViewerCamera::getInstance();
{
LLGLDepthTest depth(GL_TRUE);
mDeferredDepth.copyContents(mDeferredScreen, 0, 0, mDeferredScreen.getWidth(), mDeferredScreen.getHeight(),
@@ -6641,7 +6643,7 @@ void LLPipeline::renderDeferredLighting()
continue;
}
- if (LLViewerCamera::getInstance()->AABBInFrustumNoFarClip(center, LLVector3(s,s,s)) == 0)
+ if (camera->AABBInFrustumNoFarClip(center, LLVector3(s,s,s)) == 0)
{
continue;
}
@@ -6665,12 +6667,12 @@ void LLPipeline::renderDeferredLighting()
v[18] = c[0]+s; v[19] = c[1]+s; v[20] = c[2]-s; // 6 - 0110
v[21] = c[0]+s; v[22] = c[1]+s; v[23] = c[2]+s; // 7 - 0111
- if (LLViewerCamera::getInstance()->getOrigin().mV[0] > c[0] + s + 0.2f ||
- LLViewerCamera::getInstance()->getOrigin().mV[0] < c[0] - s - 0.2f ||
- LLViewerCamera::getInstance()->getOrigin().mV[1] > c[1] + s + 0.2f ||
- LLViewerCamera::getInstance()->getOrigin().mV[1] < c[1] - s - 0.2f ||
- LLViewerCamera::getInstance()->getOrigin().mV[2] > c[2] + s + 0.2f ||
- LLViewerCamera::getInstance()->getOrigin().mV[2] < c[2] - s - 0.2f)
+ if (camera->getOrigin().mV[0] > c[0] + s + 0.2f ||
+ camera->getOrigin().mV[0] < c[0] - s - 0.2f ||
+ camera->getOrigin().mV[1] > c[1] + s + 0.2f ||
+ camera->getOrigin().mV[1] < c[1] - s - 0.2f ||
+ camera->getOrigin().mV[2] > c[2] + s + 0.2f ||
+ camera->getOrigin().mV[2] < c[2] - s - 0.2f)
{ //draw box if camera is outside box
if (render_local)
{
@@ -6685,7 +6687,7 @@ void LLPipeline::renderDeferredLighting()
glTexCoord4f(tc.v[0], tc.v[1], tc.v[2], s*s);
glColor4f(col.mV[0], col.mV[1], col.mV[2], volume->getLightFalloff()*0.5f);
glDrawRangeElements(GL_TRIANGLE_FAN, 0, 7, 8,
- GL_UNSIGNED_BYTE, get_box_fan_indices(LLViewerCamera::getInstance(), center));
+ GL_UNSIGNED_BYTE, get_box_fan_indices(camera, center));
stop_glerror();
}
}
@@ -6750,7 +6752,7 @@ void LLPipeline::renderDeferredLighting()
glTexCoord4f(tc.v[0], tc.v[1], tc.v[2], s*s);
glColor4f(col.mV[0], col.mV[1], col.mV[2], volume->getLightFalloff()*0.5f);
glDrawRangeElements(GL_TRIANGLE_FAN, 0, 7, 8,
- GL_UNSIGNED_BYTE, get_box_fan_indices(LLViewerCamera::getInstance(), center));
+ GL_UNSIGNED_BYTE, get_box_fan_indices(camera, center));
}
gDeferredSpotLightProgram.disableTexture(LLViewerShaderMgr::DEFERRED_PROJECTION);
unbindDeferredShader(gDeferredSpotLightProgram);
@@ -8684,7 +8686,8 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar)
sShadowRender = TRUE;
sImpostorRender = TRUE;
- markVisible(avatar->mDrawable, *LLViewerCamera::getInstance());
+ LLViewerCamera* viewer_camera = LLViewerCamera::getInstance();
+ markVisible(avatar->mDrawable, *viewer_camera);
LLVOAvatar::sUseImpostors = FALSE;
LLVOAvatar::attachment_map_t::iterator iter;
@@ -8699,7 +8702,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar)
{
if (LLViewerObject* attached_object = (*attachment_iter))
{
- markVisible(attached_object->mDrawable->getSpatialBridge(), *LLViewerCamera::getInstance());
+ markVisible(attached_object->mDrawable->getSpatialBridge(), *viewer_camera);
}
}
}
@@ -8709,9 +8712,9 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar)
const LLVector3* ext = avatar->mDrawable->getSpatialExtents();
LLVector3 pos(avatar->getRenderPosition()+avatar->getImpostorOffset());
- LLCamera camera = *LLViewerCamera::getInstance();
+ LLCamera camera = *viewer_camera;
- camera.lookAt(LLViewerCamera::getInstance()->getOrigin(), pos, LLViewerCamera::getInstance()->getUpAxis());
+ camera.lookAt(viewer_camera->getOrigin(), pos, viewer_camera->getUpAxis());
LLVector2 tdim;
@@ -8754,7 +8757,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar)
glClearStencil(0);
// get the number of pixels per angle
- F32 pa = gViewerWindow->getWindowHeightRaw() / (RAD_TO_DEG * LLViewerCamera::getInstance()->getView());
+ F32 pa = gViewerWindow->getWindowHeightRaw() / (RAD_TO_DEG * viewer_camera->getView());
//get resolution based on angle width and height of impostor (double desired resolution to prevent aliasing)
U32 resY = llmin(nhpo2((U32) (fov*pa)), (U32) 512);