summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoxie Linden <roxie@lindenlab.com>2023-10-03 16:04:32 -0700
committerRoxie Linden <roxie@lindenlab.com>2024-02-22 23:11:35 -0800
commit751ff2d4accdef1f0f2acf8d282dfd91e5af25d9 (patch)
treea0ab2ed27e8d9b5ee49fc56e57077e8d15b1642a
parent9d070201fe57e22db7cf55a2160a82e3c6413471 (diff)
hook up listen from avatar vs camera
-rw-r--r--indra/newview/llvoicewebrtc.cpp35
1 files changed, 28 insertions, 7 deletions
diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp
index 8d929fd36a..3584fa31b2 100644
--- a/indra/newview/llvoicewebrtc.cpp
+++ b/indra/newview/llvoicewebrtc.cpp
@@ -2175,6 +2175,27 @@ Json::Value LLWebRTCVoiceClient::getPositionAndVolumeUpdateJson(bool force)
if ((mSpatialCoordsDirty || force) && inSpatialChannel())
{
+ LLVector3d earPosition;
+ LLQuaternion earRot;
+ switch (mEarLocation)
+ {
+ case earLocCamera:
+ default:
+ earPosition = mCameraPosition;
+ earRot = mCameraRot;
+ break;
+
+ case earLocAvatar:
+ earPosition = mAvatarPosition;
+ earRot = mAvatarRot;
+ break;
+
+ case earLocMixed:
+ earPosition = mAvatarPosition;
+ earRot = mCameraRot;
+ break;
+ }
+
root["sp"] = Json::objectValue;
root["sp"]["x"] = (int) (mAvatarPosition[0] * 100);
root["sp"]["y"] = (int) (mAvatarPosition[1] * 100);
@@ -2186,14 +2207,14 @@ Json::Value LLWebRTCVoiceClient::getPositionAndVolumeUpdateJson(bool force)
root["sh"]["w"] = (int) (mAvatarRot[3] * 100);
root["lp"] = Json::objectValue;
- root["lp"]["x"] = (int) (mCameraPosition[0] * 100);
- root["lp"]["y"] = (int) (mCameraPosition[1] * 100);
- root["lp"]["z"] = (int) (mCameraPosition[2] * 100);
+ root["lp"]["x"] = (int) (earPosition[0] * 100);
+ root["lp"]["y"] = (int) (earPosition[1] * 100);
+ root["lp"]["z"] = (int) (earPosition[2] * 100);
root["lh"] = Json::objectValue;
- root["lh"]["x"] = (int) (mCameraRot[0] * 100);
- root["lh"]["y"] = (int) (mCameraRot[1] * 100);
- root["lh"]["z"] = (int) (mCameraRot[2] * 100);
- root["lh"]["w"] = (int) (mCameraRot[3] * 100);
+ root["lh"]["x"] = (int) (earRot[0] * 100);
+ root["lh"]["y"] = (int) (earRot[1] * 100);
+ root["lh"]["z"] = (int) (earRot[2] * 100);
+ root["lh"]["w"] = (int) (earRot[3] * 100);
mSpatialCoordsDirty = false;
}