summaryrefslogtreecommitdiff
path: root/indra/newview/llviewercamera.cpp
diff options
context:
space:
mode:
authorEli Linden <eli@lindenlab.com>2010-03-02 11:06:43 -0800
committerEli Linden <eli@lindenlab.com>2010-03-02 11:06:43 -0800
commit15af3f0e6acfccd2585c0a2a7be6e882ad71d256 (patch)
tree59bb1dafa87c33aa06bb795c5ce3ee978f634baf /indra/newview/llviewercamera.cpp
parentbfd1fd9936632bd3ed7724695d5c0ae87a707e3d (diff)
parent06b81466869dc021f7138579580a1939fdfceb89 (diff)
Merge
Diffstat (limited to 'indra/newview/llviewercamera.cpp')
-rw-r--r--indra/newview/llviewercamera.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/indra/newview/llviewercamera.cpp b/indra/newview/llviewercamera.cpp
index bd4f172907..0051f46716 100644
--- a/indra/newview/llviewercamera.cpp
+++ b/indra/newview/llviewercamera.cpp
@@ -338,7 +338,12 @@ void LLViewerCamera::setPerspective(BOOL for_selection,
{
// make a tiny little viewport
// anything drawn into this viewport will be "selected"
- GLint* viewport = (GLint*) gGLViewport;
+
+ GLint viewport[4];
+ viewport[0] = gViewerWindow->getWorldViewRectRaw().mLeft;
+ viewport[1] = gViewerWindow->getWorldViewRectRaw().mBottom;
+ viewport[2] = gViewerWindow->getWorldViewRectRaw().getWidth();
+ viewport[3] = gViewerWindow->getWorldViewRectRaw().getHeight();
proj_mat = gl_pick_matrix(x+width/2.f, y_from_bot+height/2.f, (GLfloat) width, (GLfloat) height, viewport);
@@ -405,6 +410,9 @@ void LLViewerCamera::setPerspective(BOOL for_selection,
if (for_selection && (width > 1 || height > 1))
{
+ // NB: as of this writing, i believe the code below is broken (doesn't take into account the world view, assumes entire window)
+ // however, it is also unused (the GL matricies are used for selection, (see LLCamera::sphereInFrustum())) and so i'm not
+ // comfortable hacking on it.
calculateFrustumPlanesFromWindow((F32)(x - width / 2) / (F32)gViewerWindow->getWindowWidthScaled() - 0.5f,
(F32)(y_from_bot - height / 2) / (F32)gViewerWindow->getWindowHeightScaled() - 0.5f,
(F32)(x + width / 2) / (F32)gViewerWindow->getWindowWidthScaled() - 0.5f,