diff --git a/assignment-client/src/Agent.cpp b/assignment-client/src/Agent.cpp index 68464fef91..ee1e21c837 100644 --- a/assignment-client/src/Agent.cpp +++ b/assignment-client/src/Agent.cpp @@ -433,7 +433,7 @@ void Agent::executeScript() { using namespace recording; static const FrameType AUDIO_FRAME_TYPE = Frame::registerFrameType(AudioConstants::getAudioFrameName()); - Frame::registerFrameHandler(AUDIO_FRAME_TYPE, [this, &scriptedAvatar](Frame::ConstPointer frame) { + Frame::registerFrameHandler(AUDIO_FRAME_TYPE, [this, &player, &scriptedAvatar](Frame::ConstPointer frame) { if (_shouldMuteRecordingAudio) { return; } @@ -442,9 +442,18 @@ void Agent::executeScript() { QByteArray audio(frame->data); + int16_t* samples = reinterpret_cast(audio.data()); + int numSamples = AudioConstants::NETWORK_FRAME_SAMPLES_PER_CHANNEL; + + auto volume = player->getVolume(); + if (volume >= 0.0f && volume < 1.0f) { + int32_t fract = (int32_t)(volume * (float)(1 << 16)); // Q16 + for (int i = 0; i < numSamples; i++) { + samples[i] = (fract * (int32_t)samples[i]) >> 16; + } + } + if (_isNoiseGateEnabled) { - int16_t* samples = reinterpret_cast(audio.data()); - int numSamples = AudioConstants::NETWORK_FRAME_SAMPLES_PER_CHANNEL; _audioGate.render(samples, samples, numSamples); } diff --git a/hifi_vcpkg.py b/hifi_vcpkg.py index f726a87945..821d9ae0b7 100644 --- a/hifi_vcpkg.py +++ b/hifi_vcpkg.py @@ -257,27 +257,26 @@ endif() def installQt(self): qt5InstallPath = self.getQt5InstallPath() - if os.getenv('QT_CMAKE_PREFIX_PATH') == None: - if not os.path.isdir(qt5InstallPath): - print ('Downloading Qt from AWS') - dest, tail = os.path.split(qt5InstallPath) + if not os.path.isdir(qt5InstallPath): + print ('Downloading Qt from AWS') + dest, tail = os.path.split(qt5InstallPath) - url = 'NOT DEFINED' - if platform.system() == 'Windows': - url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-windows3.tar.gz' - elif platform.system() == 'Darwin': - url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-macos3.tar.gz' - elif platform.system() == 'Linux': - if platform.linux_distribution()[1][:3] == '16.': - url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-ubuntu-16.04-with-symbols.tar.gz' - elif platform.linux_distribution()[1][:3] == '18.': - url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-ubuntu-18.04.tar.gz' - else: - print('UNKNOWN LINUX VERSION!!!') + url = 'NOT DEFINED' + if platform.system() == 'Windows': + url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-windows3.tar.gz' + elif platform.system() == 'Darwin': + url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-macos3.tar.gz' + elif platform.system() == 'Linux': + if platform.linux_distribution()[1][:3] == '16.': + url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-ubuntu-16.04-with-symbols.tar.gz' + elif platform.linux_distribution()[1][:3] == '18.': + url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-ubuntu-18.04.tar.gz' else: - print('UNKNOWN OPERATING SYSTEM!!!') - - print('Extracting ' + url + ' to ' + dest) - hifi_utils.downloadAndExtract(url, dest) + print('UNKNOWN LINUX VERSION!!!') else: - print ('Qt has already been downloaded') + print('UNKNOWN OPERATING SYSTEM!!!') + + print('Extracting ' + url + ' to ' + dest) + hifi_utils.downloadAndExtract(url, dest) + else: + print ('Qt has already been downloaded') diff --git a/interface/resources/avatar/animations/emote_point01_all.fbx b/interface/resources/avatar/animations/emote_point01_all.fbx index 4b7424ab1d..6302620794 100644 Binary files a/interface/resources/avatar/animations/emote_point01_all.fbx and b/interface/resources/avatar/animations/emote_point01_all.fbx differ diff --git a/interface/resources/avatar/avatar-animation.json b/interface/resources/avatar/avatar-animation.json index 9ab4d5d935..436f8b5949 100644 --- a/interface/resources/avatar/avatar-animation.json +++ b/interface/resources/avatar/avatar-animation.json @@ -3799,8 +3799,8 @@ { "easingType": "easeInOutQuad", "id": "reactionPoint", - "interpDuration": 18, - "interpTarget": 18, + "interpDuration": 10, + "interpTarget": 10, "interpType": "evaluateBoth", "transitions": [ { @@ -4610,9 +4610,9 @@ { "easingType": "easeInOutQuad", "id": "idle", - "interpDuration": 30, - "interpTarget": 30, - "interpType": "evaluateBoth", + "interpDuration": 10, + "interpTarget": 10, + "interpType": "snapshotPrev", "transitions": [ { "state": "WALKFWD", @@ -4742,14 +4742,34 @@ { "easingType": "easeInOutQuad", "id": "idleSettle", - "interpDuration": 12, - "interpTarget": 12, - "interpType": "evaluateBoth", + "interpDuration": 15, + "interpTarget": 15, + "interpType": "snapshotPrev", "transitions": [ { "state": "idle", "var": "idleSettleOnDone" }, + { + "state": "idle", + "var": "reactionPositiveTrigger" + }, + { + "state": "idle", + "var": "reactionNegativeTrigger" + }, + { + "state": "idle", + "var": "reactionRaiseHandEnabled" + }, + { + "state": "idle", + "var": "reactionApplaudEnabled" + }, + { + "state": "idle", + "var": "reactionPointEnabled" + }, { "state": "WALKFWD", "var": "isMovingForward" @@ -4810,7 +4830,7 @@ }, { "id": "WALKFWD", - "interpDuration": 10, + "interpDuration": 15, "interpTarget": 35, "interpType": "snapshotPrev", "transitions": [ @@ -4874,7 +4894,7 @@ }, { "id": "WALKBWD", - "interpDuration": 10, + "interpDuration": 15, "interpTarget": 35, "interpType": "snapshotPrev", "transitions": [ @@ -4938,7 +4958,7 @@ }, { "id": "STRAFERIGHT", - "interpDuration": 8, + "interpDuration": 15, "interpTarget": 25, "interpType": "snapshotPrev", "transitions": [ @@ -5002,7 +5022,7 @@ }, { "id": "STRAFELEFT", - "interpDuration": 8, + "interpDuration": 15, "interpTarget": 25, "interpType": "snapshotPrev", "transitions": [ @@ -5873,7 +5893,6 @@ }, "id": "userAnimStateMachine", "type": "stateMachine" - }, "version": "1.1" -} \ No newline at end of file +} diff --git a/interface/resources/qml/hifi/simplifiedUI/helpApp/controls/ControlsTable.qml b/interface/resources/qml/hifi/simplifiedUI/helpApp/controls/ControlsTable.qml index b647d5ca24..84b37db31b 100644 --- a/interface/resources/qml/hifi/simplifiedUI/helpApp/controls/ControlsTable.qml +++ b/interface/resources/qml/hifi/simplifiedUI/helpApp/controls/ControlsTable.qml @@ -699,8 +699,8 @@ Item { spacing: controlsTableRoot.rowPadding HifiStylesUit.GraphikRegular { - id: mirrorText - text: "Mirror Mode" + id: selfieText + text: "Selfie" width: paintedWidth height: parent.height horizontalAlignment: Text.AlignLeft @@ -710,8 +710,8 @@ Item { } HifiStylesUit.GraphikRegular { - text: "See your own avatar" - width: parent.width - mirrorText.width - parent.spacing - controlsTableRoot.rowPadding + text: "Look at self" + width: parent.width - selfieText.width - parent.spacing - controlsTableRoot.rowPadding height: parent.height horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter diff --git a/interface/resources/qml/hifi/simplifiedUI/settingsApp/general/General.qml b/interface/resources/qml/hifi/simplifiedUI/settingsApp/general/General.qml index 24fff2dae4..7a98849b95 100644 --- a/interface/resources/qml/hifi/simplifiedUI/settingsApp/general/General.qml +++ b/interface/resources/qml/hifi/simplifiedUI/settingsApp/general/General.qml @@ -234,9 +234,19 @@ Flickable { SimplifiedControls.RadioButton { id: thirdPerson text: "Third Person View" - checked: Camera.mode === "third person" + checked: Camera.mode === "look at" onClicked: { - Camera.mode = "third person" + Camera.mode = "look at" + } + } + + SimplifiedControls.RadioButton { + id: selfie + text: "Selfie" + checked: Camera.mode === "selfie" + visible: true + onClicked: { + Camera.mode = "selfie" } } @@ -246,11 +256,21 @@ Flickable { onModeUpdated: { if (Camera.mode === "first person") { firstPerson.checked = true - } else if (Camera.mode === "third person") { + } else if (Camera.mode === "look at") { thirdPerson.checked = true + } else if (Camera.mode === "selfie" && HMD.active) { + selfie.checked = true } } } + + Connections { + target: HMD + + onDisplayModeChanged: { + selfie.visible = isHMDMode ? false : true + } + } } } diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 112685e891..6f16e6e1bf 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -4144,6 +4144,7 @@ void MyAvatar::goToLocation(const glm::vec3& newPosition, _goToOrientation = quatOrientation; } + resetLookAtRotation(_goToPosition, _goToOrientation); emit transformChanged(); } @@ -5996,6 +5997,7 @@ bool MyAvatar::pinJoint(int index, const glm::vec3& position, const glm::quat& o } slamPosition(position); + resetLookAtRotation(position, orientation); setWorldOrientation(orientation); auto it = std::find(_pinnedJoints.begin(), _pinnedJoints.end(), index); @@ -6662,6 +6664,15 @@ void MyAvatar::resetHeadLookAt() { } } +void MyAvatar::resetLookAtRotation(const glm::vec3& avatarPosition, const glm::quat& avatarOrientation) { + // Align the look at values to the given avatar orientation + float yaw = safeEulerAngles(avatarOrientation).y; + _lookAtYaw = glm::angleAxis(yaw, avatarOrientation * Vectors::UP); + _lookAtPitch = Quaternions::IDENTITY; + _lookAtCameraTarget = avatarPosition + avatarOrientation * Vectors::FRONT; + resetHeadLookAt(); +} + void MyAvatar::updateHeadLookAt(float deltaTime) { if (_skeletonModelLoaded) { glm::vec3 lookAtTarget = _scriptControlsHeadLookAt ? _lookAtScriptTarget : _lookAtCameraTarget; diff --git a/interface/src/avatar/MyAvatar.h b/interface/src/avatar/MyAvatar.h index a6c53c1c0b..7b63e8e86b 100644 --- a/interface/src/avatar/MyAvatar.h +++ b/interface/src/avatar/MyAvatar.h @@ -2654,11 +2654,6 @@ private: bool _scriptControlsHeadLookAt { false }; float _scriptHeadControlTimer { 0.0f }; - // LookAt camera data - float _selfieTriggerAngle { 55.0f }; - float _frontLookAtSpeed { 0.15f }; - float _backLookAtSpeed { 0.25f }; - Setting::Handle _realWorldFieldOfView; Setting::Handle _useAdvancedMovementControls; Setting::Handle _showPlayArea; @@ -2685,6 +2680,7 @@ private: void initFlowFromFST(); void updateHeadLookAt(float deltaTime); void resetHeadLookAt(); + void resetLookAtRotation(const glm::vec3& avatarPosition, const glm::quat& avatarOrientation); // Avatar Preferences QUrl _fullAvatarURLFromPreferences; diff --git a/interface/src/ui/overlays/ContextOverlayInterface.cpp b/interface/src/ui/overlays/ContextOverlayInterface.cpp index 796fbadee1..1c8a9019ea 100644 --- a/interface/src/ui/overlays/ContextOverlayInterface.cpp +++ b/interface/src/ui/overlays/ContextOverlayInterface.cpp @@ -50,9 +50,6 @@ ContextOverlayInterface::ContextOverlayInterface() { _entityPropertyFlags += PROP_OWNING_AVATAR_ID; auto entityScriptingInterface = DependencyManager::get().data(); - /* REMOVING THIS AS AN EMERGENCY FIX. We will be returning to modify the code so that MP inspection is not intrusive in domains with a lot of certified content. - Jira bug to remove inspection temporarily: https://highfidelity.atlassian.net/browse/DEV-639 - Jira bug to modify it and bring it back: https://highfidelity.atlassian.net/browse/DEV-645 connect(entityScriptingInterface, &EntityScriptingInterface::mousePressOnEntity, this, &ContextOverlayInterface::clickDownOnEntity); connect(entityScriptingInterface, &EntityScriptingInterface::mouseReleaseOnEntity, this, &ContextOverlayInterface::mouseReleaseOnEntity); connect(entityScriptingInterface, &EntityScriptingInterface::hoverEnterEntity, this, &ContextOverlayInterface::contextOverlays_hoverEnterEntity); @@ -60,7 +57,6 @@ ContextOverlayInterface::ContextOverlayInterface() { connect(&qApp->getOverlays(), &Overlays::hoverEnterOverlay, this, &ContextOverlayInterface::contextOverlays_hoverEnterOverlay); connect(&qApp->getOverlays(), &Overlays::hoverLeaveOverlay, this, &ContextOverlayInterface::contextOverlays_hoverLeaveOverlay); - */ connect(_tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system"), &TabletProxy::tabletShownChanged, this, [&]() { if (_contextOverlayJustClicked && _hmdScriptingInterface->isMounted()) { diff --git a/libraries/recording/src/recording/Deck.cpp b/libraries/recording/src/recording/Deck.cpp index 4d65f0eb1b..bdbbc05d50 100644 --- a/libraries/recording/src/recording/Deck.cpp +++ b/libraries/recording/src/recording/Deck.cpp @@ -103,6 +103,10 @@ float Deck::position() const { return Frame::frameTimeToSeconds(currentPosition); } +void Deck::setVolume(float volume) { + _volume = std::min(std::max(volume, 0.0f), 1.0f); +} + static const Frame::Time MIN_FRAME_WAIT_INTERVAL = Frame::secondsToFrameTime(0.001f); static const Frame::Time MAX_FRAME_PROCESSING_TIME = Frame::secondsToFrameTime(0.004f); diff --git a/libraries/recording/src/recording/Deck.h b/libraries/recording/src/recording/Deck.h index 1f8d58d5e1..6dce3a445b 100644 --- a/libraries/recording/src/recording/Deck.h +++ b/libraries/recording/src/recording/Deck.h @@ -57,6 +57,9 @@ public: float position() const; void seek(float position); + float getVolume() const { return _volume; } + void setVolume(float volume); + signals: void playbackStateChanged(); void looped(); @@ -76,6 +79,7 @@ private: bool _pause { true }; bool _loop { false }; float _length { 0 }; + float _volume { 1.0f }; }; } diff --git a/libraries/script-engine/src/RecordingScriptingInterface.cpp b/libraries/script-engine/src/RecordingScriptingInterface.cpp index e57d80274a..f95edb482b 100644 --- a/libraries/script-engine/src/RecordingScriptingInterface.cpp +++ b/libraries/script-engine/src/RecordingScriptingInterface.cpp @@ -117,7 +117,7 @@ void RecordingScriptingInterface::startPlaying() { } void RecordingScriptingInterface::setPlayerVolume(float volume) { - // FIXME + _player->setVolume(std::min(std::max(volume, 0.0f), 1.0f)); } void RecordingScriptingInterface::setPlayerAudioOffset(float audioOffset) { diff --git a/libraries/script-engine/src/RecordingScriptingInterface.h b/libraries/script-engine/src/RecordingScriptingInterface.h index 6a058feea5..604ec6bc2e 100644 --- a/libraries/script-engine/src/RecordingScriptingInterface.h +++ b/libraries/script-engine/src/RecordingScriptingInterface.h @@ -95,8 +95,9 @@ public slots: /**jsdoc + * Sets the playback audio volume. * @function Recording.setPlayerVolume - * @param {number} volume + * @param {number} volume - The playback audio volume, range 0.01.0. */ void setPlayerVolume(float volume);