aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llviewercamera.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llviewercamera.cpp')
-rw-r--r--linden/indra/newview/llviewercamera.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/linden/indra/newview/llviewercamera.cpp b/linden/indra/newview/llviewercamera.cpp
index 7c4271a..07e3109 100644
--- a/linden/indra/newview/llviewercamera.cpp
+++ b/linden/indra/newview/llviewercamera.cpp
@@ -47,12 +47,12 @@
47#include "llviewerwindow.h" 47#include "llviewerwindow.h"
48#include "llvovolume.h" 48#include "llvovolume.h"
49#include "llworld.h" 49#include "llworld.h"
50#include "lltoolmgr.h"
51#include "llviewerjoystick.h"
50 52
51GLfloat gGLZFar; 53GLfloat gGLZFar;
52GLfloat gGLZNear; 54GLfloat gGLZNear;
53 55
54LLViewerCamera *gCamera = NULL;
55
56//glu pick matrix implementation borrowed from Mesa3D 56//glu pick matrix implementation borrowed from Mesa3D
57glh::matrix4f gl_pick_matrix(GLfloat x, GLfloat y, GLfloat width, GLfloat height, GLint* viewport) 57glh::matrix4f gl_pick_matrix(GLfloat x, GLfloat y, GLfloat width, GLfloat height, GLint* viewport)
58{ 58{
@@ -99,6 +99,13 @@ void LLViewerCamera::updateCameraLocation(const LLVector3 &center,
99 const LLVector3 &up_direction, 99 const LLVector3 &up_direction,
100 const LLVector3 &point_of_interest) 100 const LLVector3 &point_of_interest)
101{ 101{
102 // do not update if we are in build mode AND avatar didn't move
103 if (LLToolMgr::getInstance()->inBuildMode()
104 && !LLViewerJoystick::getInstance()->getCameraNeedsUpdate())
105 {
106 return;
107 }
108
102 LLVector3 last_position; 109 LLVector3 last_position;
103 LLVector3 last_axis; 110 LLVector3 last_axis;
104 last_position = getOrigin(); 111 last_position = getOrigin();
@@ -170,7 +177,7 @@ void LLViewerCamera::calcProjection(const F32 far_distance) const
170 177
171 f = 1/tan(fov_y*0.5f); 178 f = 1/tan(fov_y*0.5f);
172 179
173 mProjectionMatrix.zero(); 180 mProjectionMatrix.setZero();
174 mProjectionMatrix.mMatrix[0][0] = f/aspect; 181 mProjectionMatrix.mMatrix[0][0] = f/aspect;
175 mProjectionMatrix.mMatrix[1][1] = f; 182 mProjectionMatrix.mMatrix[1][1] = f;
176 mProjectionMatrix.mMatrix[2][2] = (z_far + z_near)/(z_near - z_far); 183 mProjectionMatrix.mMatrix[2][2] = (z_far + z_near)/(z_near - z_far);