diff options
author | Jacek Antonelli | 2008-08-15 23:45:42 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:42 -0500 |
commit | ce28e056c20bf2723f565bbf464b87781ec248a2 (patch) | |
tree | ef7b0501c4de4b631a916305cbc2a5fdc125e52d /linden/indra/newview/llviewercamera.cpp | |
parent | Second Life viewer sources 1.19.1.4b (diff) | |
download | meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.zip meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.gz meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.bz2 meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.xz |
Second Life viewer sources 1.20.2
Diffstat (limited to 'linden/indra/newview/llviewercamera.cpp')
-rw-r--r-- | linden/indra/newview/llviewercamera.cpp | 13 |
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 | ||
51 | GLfloat gGLZFar; | 53 | GLfloat gGLZFar; |
52 | GLfloat gGLZNear; | 54 | GLfloat gGLZNear; |
53 | 55 | ||
54 | LLViewerCamera *gCamera = NULL; | ||
55 | |||
56 | //glu pick matrix implementation borrowed from Mesa3D | 56 | //glu pick matrix implementation borrowed from Mesa3D |
57 | glh::matrix4f gl_pick_matrix(GLfloat x, GLfloat y, GLfloat width, GLfloat height, GLint* viewport) | 57 | glh::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 ¢er, | |||
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); |