summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermessage.cpp
diff options
context:
space:
mode:
authorDave SIMmONs <simon@lindenlab.com>2011-02-25 11:33:20 -0800
committerDave SIMmONs <simon@lindenlab.com>2011-02-25 11:33:20 -0800
commitd413799644b8e7fa943fa86c7798634a28ce335d (patch)
treeb95fd653bf5e215b4adc338d5a9dddcc1f46a81f /indra/newview/llviewermessage.cpp
parent52ae219d502d182a7e6c000070e5935b923f30e7 (diff)
ER-350: Viewer / sim camera positioning not working well on login. Viewer now sets the camera before calling send_agent_update(). Reviewed by Kelly.
Diffstat (limited to 'indra/newview/llviewermessage.cpp')
-rw-r--r--indra/newview/llviewermessage.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 103989ee80..4203ba74b2 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -3761,10 +3761,22 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**)
}
else
{
- // This is likely just the initial logging in phase.
+ // This is initial log-in or a region crossing
gAgent.setTeleportState( LLAgent::TELEPORT_NONE );
+
+ if(LLStartUp::getStartupState() < STATE_STARTED)
+ { // This is initial log-in, not a region crossing:
+ // Set the camera looking ahead of the AV so send_agent_update() below
+ // will report the correct location to the server.
+ LLVector3 look_at_point = look_at;
+ look_at_point = agent_pos + look_at_point.rotVec(gAgent.getQuat());
+
+ static LLVector3 up_direction(0.0f, 0.0f, 1.0f);
+ LLViewerCamera::getInstance()->lookAt(agent_pos, look_at_point, up_direction);
+ }
}
+
if ( LLTracker::isTracking(NULL) )
{
// Check distance to beacon, if < 5m, remove beacon