summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermediafocus.cpp
diff options
context:
space:
mode:
authorMonroe Linden <monroe@lindenlab.com>2009-11-06 19:30:52 -0800
committerMonroe Linden <monroe@lindenlab.com>2009-11-06 19:30:52 -0800
commit5fba55f58e35e52485f161d069f323120ec68b6d (patch)
treed222d2fa8d1cce6d7a6f62c90f7681d53810867c /indra/newview/llviewermediafocus.cpp
parentfcbad172a68f12169f1e6ab0390f71be10b900fb (diff)
Partial fix for DEV-42153.
This code seems to work on some objects and not on others. I suspect I'm not doing something quite right in LLVOVolume::getApproximateFaceNormal().
Diffstat (limited to 'indra/newview/llviewermediafocus.cpp')
-rw-r--r--indra/newview/llviewermediafocus.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/indra/newview/llviewermediafocus.cpp b/indra/newview/llviewermediafocus.cpp
index b2a0fa4b1c..70a7d835a3 100644
--- a/indra/newview/llviewermediafocus.cpp
+++ b/indra/newview/llviewermediafocus.cpp
@@ -499,8 +499,14 @@ void LLViewerMediaFocus::focusZoomOnMedia(LLUUID media_id)
S32 face = obj->getFaceIndexWithMediaImpl(impl, -1);
// We don't have a proper pick normal here, and finding a face's real normal is... complicated.
- // For now, use +z to look at the top of the object.
- LLVector3 normal(0.0f, 0.0f, 1.0f);
+ LLVector3 normal = obj->getApproximateFaceNormal(face);
+ if(normal.isNull())
+ {
+ // If that didn't work, use the inverse of the camera "look at" axis, which should keep the camera pointed in the same direction.
+// llinfos << "approximate face normal invalid, using camera direction." << llendl;
+ normal = LLViewerCamera::getInstance()->getAtAxis();
+ normal *= (F32)-1.0f;
+ }
// Attempt to focus/zoom on that face.
setFocusFace(obj, face, impl, normal);