summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorRoxie Linden <roxie@lindenlab.com>2023-10-03 16:04:32 -0700
committerRoxie Linden <roxie@lindenlab.com>2024-02-08 18:34:01 -0800
commitf98e714f60367322f41f6f81a9f68f34bddf03bb (patch)
tree27a1e8886b587e4b40def1ff9899280451589d40 /indra
parent6b29ced7071baf3fcf5fa2f12fd92cd2cbeda9a8 (diff)
hook up listen from avatar vs camera
Diffstat (limited to 'indra')
-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;
}