diff --git a/libraries/audio/src/AudioInjector.cpp b/libraries/audio/src/AudioInjector.cpp index f996361690..d98d4108ce 100644 --- a/libraries/audio/src/AudioInjector.cpp +++ b/libraries/audio/src/AudioInjector.cpp @@ -278,6 +278,12 @@ int64_t AudioInjector::injectNextFrame() { audioPacketStream.writeRawData(reinterpret_cast(&_options.orientation), sizeof(_options.orientation)); + audioPacketStream.writeRawData(reinterpret_cast(&_options.position), + sizeof(_options.position)); + glm::vec3 boxCorner = glm::vec3(0); + audioPacketStream.writeRawData(reinterpret_cast(&boxCorner), + sizeof(glm::vec3)); + // pack zero for radius float radius = 0; audioPacketStream << radius; diff --git a/libraries/networking/src/udt/PacketHeaders.cpp b/libraries/networking/src/udt/PacketHeaders.cpp index e766ab4368..34a70f8da6 100644 --- a/libraries/networking/src/udt/PacketHeaders.cpp +++ b/libraries/networking/src/udt/PacketHeaders.cpp @@ -78,7 +78,7 @@ PacketVersion versionForPacketType(PacketType packetType) { case PacketType::MicrophoneAudioNoEcho: case PacketType::MicrophoneAudioWithEcho: case PacketType::AudioStreamStats: - return static_cast(AudioVersion::TerminatingStreamStats); + return static_cast(AudioVersion::SpaceBubbleChanges); default: return 17; diff --git a/libraries/networking/src/udt/PacketHeaders.h b/libraries/networking/src/udt/PacketHeaders.h index a23f7b7124..dbeb1e63b0 100644 --- a/libraries/networking/src/udt/PacketHeaders.h +++ b/libraries/networking/src/udt/PacketHeaders.h @@ -234,6 +234,7 @@ enum class AudioVersion : PacketVersion { CodecNameInAudioPackets, Exactly10msAudioPackets, TerminatingStreamStats, + SpaceBubbleChanges, }; #endif // hifi_PacketHeaders_h diff --git a/scripts/system/assets/models/Bubble-v14.fbx b/scripts/system/assets/models/Bubble-v14.fbx new file mode 100644 index 0000000000..c7d3122f00 Binary files /dev/null and b/scripts/system/assets/models/Bubble-v14.fbx differ diff --git a/scripts/system/assets/models/bubble-v12.fbx b/scripts/system/assets/models/bubble-v12.fbx deleted file mode 100644 index bee88460cf..0000000000 Binary files a/scripts/system/assets/models/bubble-v12.fbx and /dev/null differ diff --git a/scripts/system/bubble.js b/scripts/system/bubble.js index 16c190bc6f..f02f69729b 100644 --- a/scripts/system/bubble.js +++ b/scripts/system/bubble.js @@ -23,11 +23,13 @@ var bubbleButtonFlashState = false; // Used for flashing the HUD button upon activation var bubbleButtonTimestamp; + // Affects bubble height + const BUBBLE_HEIGHT_SCALE = 0.15; // The bubble model itself var bubbleOverlay = Overlays.addOverlay("model", { - url: Script.resolvePath("assets/models/bubble-v12.fbx"), // If you'd like to change the model, modify this line (and the dimensions below) + url: Script.resolvePath("assets/models/Bubble-v14.fbx"), // If you'd like to change the model, modify this line (and the dimensions below) dimensions: { x: 1.0, y: 0.75, z: 1.0 }, - position: { x: MyAvatar.position.x, y: -MyAvatar.scale * 2 + MyAvatar.position.y + MyAvatar.scale * 0.28, z: MyAvatar.position.z }, + position: { x: MyAvatar.position.x, y: -MyAvatar.scale * 2 + MyAvatar.position.y + MyAvatar.scale * BUBBLE_HEIGHT_SCALE, z: MyAvatar.position.z }, rotation: Quat.fromPitchYawRollDegrees(MyAvatar.bodyPitch, 0, MyAvatar.bodyRoll), scale: { x: 2, y: MyAvatar.scale * 0.5 + 0.5, z: 2 }, visible: false, @@ -71,7 +73,7 @@ } Overlays.editOverlay(bubbleOverlay, { - position: { x: MyAvatar.position.x, y: -MyAvatar.scale * 2 + MyAvatar.position.y + MyAvatar.scale * 0.28, z: MyAvatar.position.z }, + position: { x: MyAvatar.position.x, y: -MyAvatar.scale * 2 + MyAvatar.position.y + MyAvatar.scale * BUBBLE_HEIGHT_SCALE, z: MyAvatar.position.z }, rotation: Quat.fromPitchYawRollDegrees(MyAvatar.bodyPitch, 0, MyAvatar.bodyRoll), scale: { x: 2, y: MyAvatar.scale * 0.5 + 0.5, z: 2 }, visible: true @@ -112,7 +114,7 @@ // Quickly raise the bubble from the ground up position: { x: MyAvatar.position.x, - y: (-((BUBBLE_RAISE_ANIMATION_DURATION_MS - delay) / BUBBLE_RAISE_ANIMATION_DURATION_MS)) * MyAvatar.scale * 2 + MyAvatar.position.y + MyAvatar.scale * 0.28, + y: (-((BUBBLE_RAISE_ANIMATION_DURATION_MS - delay) / BUBBLE_RAISE_ANIMATION_DURATION_MS)) * MyAvatar.scale * 2 + MyAvatar.position.y + MyAvatar.scale * BUBBLE_HEIGHT_SCALE, z: MyAvatar.position.z }, rotation: Quat.fromPitchYawRollDegrees(MyAvatar.bodyPitch, 0, MyAvatar.bodyRoll), @@ -127,7 +129,7 @@ Overlays.editOverlay(bubbleOverlay, { position: { x: MyAvatar.position.x, - y: MyAvatar.position.y + MyAvatar.scale * 0.28, + y: MyAvatar.position.y + MyAvatar.scale * BUBBLE_HEIGHT_SCALE, z: MyAvatar.position.z }, rotation: Quat.fromPitchYawRollDegrees(MyAvatar.bodyPitch, 0, MyAvatar.bodyRoll),