summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermedia.cpp
diff options
context:
space:
mode:
authorcallum <none@none>2011-05-25 08:10:04 -0700
committercallum <none@none>2011-05-25 08:10:04 -0700
commite9f8a5441b0d737133a833cd240709962add56a5 (patch)
treec0af24c1f64f34062943fc097e6d7a6cc3c8f962 /indra/newview/llviewermedia.cpp
parent1afbbba03d0c93ad7897f336bb070bdf0bf1ecda (diff)
Added support for pushing agent global location on grid and agent orientation out to LLQtWebKit
Diffstat (limited to 'indra/newview/llviewermedia.cpp')
-rw-r--r--indra/newview/llviewermedia.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 2b9f32f6f5..c88c07942e 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -2365,6 +2365,19 @@ void LLViewerMediaImpl::updateJavascriptObject()
double z = agent_pos.mV[ VZ ];
mMediaSource->jsAgentLocationEvent( x, y, z );
+ // current location within the grid
+ LLVector3d agent_pos_global = gAgent.getLastPositionGlobal();
+ double global_x = agent_pos_global.mdV[ VX ];
+ double global_y = agent_pos_global.mdV[ VY ];
+ double global_z = agent_pos_global.mdV[ VZ ];
+ mMediaSource->jsAgentGlobalLocationEvent( global_x, global_y, global_z );
+
+ // current agent orientation
+ double rotation = atan2( gAgent.getAtAxis().mV[VX], gAgent.getAtAxis().mV[VY] );
+ double angle = rotation * RAD_TO_DEG;
+ if ( angle < 0.0f ) angle = 360.0f + angle; // TODO: has to be a better way to get orientation!
+ mMediaSource->jsAgentOrientationEvent( angle );
+
// current region agent is in
std::string region_name("");
LLViewerRegion* region = gAgent.getRegion();