From b9ba8b5d80a92b2baa7c32eed347c4702b739cf2 Mon Sep 17 00:00:00 2001 From: Thijs Wenker Date: Wed, 1 Feb 2017 01:28:06 +0100 Subject: [PATCH 1/6] Readme fix, default AC parameters example Six ACs is minimum required for a full stack, using the --min --max parameters will not out-date the documentation as quick --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 48e0de03af..44bfb94634 100644 --- a/README.md +++ b/README.md @@ -58,9 +58,9 @@ In a new Terminal window, run: Any target can be terminated with Ctrl-C (SIGINT) in the associated Terminal window. -This assignment-client will grab one assignment from the domain-server. You can tell the assignment-client what type you want it to be with the `-t` option. You can also run an assignment-client that forks off *n* assignment-clients with the `-n` option. +This assignment-client will grab one assignment from the domain-server. You can tell the assignment-client what type you want it to be with the `-t` option. You can also run an assignment-client that forks off *n* assignment-clients with the `-n` option. The `-min` and `-max` options allow you to set a range of required assignment-clients, this allows you to have flexibility in the number of assignment-clients that are running. See `--help` for more options. - ./assignment-client -n 4 + ./assignment-client --min 6 --max 20 To test things out you'll want to run the Interface client. From 4af51186543c58179b506f2ba86e12ff464522fb Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Wed, 1 Feb 2017 17:04:21 -0800 Subject: [PATCH 2/6] First pass --- assignment-client/src/avatars/AvatarMixer.cpp | 9 +++++++-- libraries/avatars/src/AvatarData.cpp | 14 ++++++-------- libraries/avatars/src/AvatarData.h | 5 +++-- libraries/avatars/src/AvatarHashMap.cpp | 4 +++- 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/assignment-client/src/avatars/AvatarMixer.cpp b/assignment-client/src/avatars/AvatarMixer.cpp index 457787013f..61164ee8d7 100644 --- a/assignment-client/src/avatars/AvatarMixer.cpp +++ b/assignment-client/src/avatars/AvatarMixer.cpp @@ -593,10 +593,15 @@ void AvatarMixer::handleAvatarIdentityPacket(QSharedPointer mes // parse the identity packet and update the change timestamp if appropriate AvatarData::Identity identity; AvatarData::parseAvatarIdentityPacket(message->getMessage(), identity); - if (avatar.processAvatarIdentity(identity)) { + bool identityChanged = false; + bool displayNameChanged = false; + avatar.processAvatarIdentity(identity, identityChanged, displayNameChanged); + if (identityChanged) { QMutexLocker nodeDataLocker(&nodeData->getMutex()); nodeData->flagIdentityChange(); - nodeData->setAvatarSessionDisplayNameMustChange(true); + if (displayNameChanged) { + nodeData->setAvatarSessionDisplayNameMustChange(true); + } } } } diff --git a/libraries/avatars/src/AvatarData.cpp b/libraries/avatars/src/AvatarData.cpp index c35572a415..8bc87d6027 100644 --- a/libraries/avatars/src/AvatarData.cpp +++ b/libraries/avatars/src/AvatarData.cpp @@ -1336,24 +1336,24 @@ const QUrl& AvatarData::cannonicalSkeletonModelURL(const QUrl& emptyURL) { return _skeletonModelURL.scheme() == "file" ? emptyURL : _skeletonModelURL; } -bool AvatarData::processAvatarIdentity(const Identity& identity) { - bool hasIdentityChanged = false; +void AvatarData::processAvatarIdentity(const Identity& identity, bool& identityChanged, bool& displayNameChanged) { if (_firstSkeletonCheck || (identity.skeletonModelURL != cannonicalSkeletonModelURL(emptyURL))) { setSkeletonModelURL(identity.skeletonModelURL); - hasIdentityChanged = true; + identityChanged = true; _firstSkeletonCheck = false; } if (identity.displayName != _displayName) { _displayName = identity.displayName; - hasIdentityChanged = true; + identityChanged = true; + displayNameChanged = true; } maybeUpdateSessionDisplayNameFromTransport(identity.sessionDisplayName); if (identity.attachmentData != _attachmentData) { setAttachmentData(identity.attachmentData); - hasIdentityChanged = true; + identityChanged = true; } bool avatarEntityDataChanged = false; @@ -1362,10 +1362,8 @@ bool AvatarData::processAvatarIdentity(const Identity& identity) { }); if (avatarEntityDataChanged) { setAvatarEntityData(identity.avatarEntityData); - hasIdentityChanged = true; + identityChanged = true; } - - return hasIdentityChanged; } QByteArray AvatarData::identityByteArray() { diff --git a/libraries/avatars/src/AvatarData.h b/libraries/avatars/src/AvatarData.h index 5d989b0eee..52cf81798e 100644 --- a/libraries/avatars/src/AvatarData.h +++ b/libraries/avatars/src/AvatarData.h @@ -471,8 +471,9 @@ public: static void parseAvatarIdentityPacket(const QByteArray& data, Identity& identityOut); - // returns true if identity has changed, false otherwise. - bool processAvatarIdentity(const Identity& identity); + // identityChanged returns true if identity has changed, false otherwise. + // displayNameChanged returns true if displayName has changed, false otherwise. + void processAvatarIdentity(const Identity& identity, bool& identityChanged, bool& displayNameChanged); QByteArray identityByteArray(); diff --git a/libraries/avatars/src/AvatarHashMap.cpp b/libraries/avatars/src/AvatarHashMap.cpp index f4e94b9a35..9d43bf438b 100644 --- a/libraries/avatars/src/AvatarHashMap.cpp +++ b/libraries/avatars/src/AvatarHashMap.cpp @@ -148,7 +148,9 @@ void AvatarHashMap::processAvatarIdentityPacket(QSharedPointer if (!nodeList->isIgnoringNode(identity.uuid) || nodeList->getRequestsDomainListData()) { // mesh URL for a UUID, find avatar in our list auto avatar = newOrExistingAvatar(identity.uuid, sendingNode); - avatar->processAvatarIdentity(identity); + bool identityChanged = false; + bool displayNameChanged = false; + avatar->processAvatarIdentity(identity, identityChanged, displayNameChanged); } } From 9d124983a629eeecf95b2e34d6c48536b5e095c0 Mon Sep 17 00:00:00 2001 From: "Anthony J. Thibault" Date: Wed, 1 Feb 2017 17:48:28 -0800 Subject: [PATCH 3/6] Tablet-ui: fix tablet orientation for users in 2d desktop mode Double 180 flip. Once before to account for -z forward of camera. Once after to account for avatar 180 flip. --- interface/src/avatar/Avatar.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/src/avatar/Avatar.cpp b/interface/src/avatar/Avatar.cpp index 9e6c524c2c..64e82f63da 100644 --- a/interface/src/avatar/Avatar.cpp +++ b/interface/src/avatar/Avatar.cpp @@ -900,7 +900,7 @@ glm::quat Avatar::getAbsoluteJointRotationInObjectFrame(int index) const { _skeletonModel->getAbsoluteJointRotationInRigFrame(headJointIndex, rotation); } } - return rotation; + return Quaternions::Y_180 * rotation * Quaternions::Y_180; } default: { glm::quat rotation; @@ -936,7 +936,7 @@ glm::vec3 Avatar::getAbsoluteJointTranslationInObjectFrame(int index) const { _skeletonModel->getAbsoluteJointTranslationInRigFrame(headJointIndex, translation); } } - return translation; + return Quaternions::Y_180 * translation * Quaternions::Y_180; } default: { glm::vec3 translation; From 5ea3c5dffdee18c7283af99cdec11a62fa0fc823 Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Wed, 1 Feb 2017 18:13:24 -0800 Subject: [PATCH 4/6] Skipped this line --- libraries/avatars/src/AvatarData.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libraries/avatars/src/AvatarData.cpp b/libraries/avatars/src/AvatarData.cpp index 8bc87d6027..b25140d0a8 100644 --- a/libraries/avatars/src/AvatarData.cpp +++ b/libraries/avatars/src/AvatarData.cpp @@ -1341,6 +1341,9 @@ void AvatarData::processAvatarIdentity(const Identity& identity, bool& identityC if (_firstSkeletonCheck || (identity.skeletonModelURL != cannonicalSkeletonModelURL(emptyURL))) { setSkeletonModelURL(identity.skeletonModelURL); identityChanged = true; + if (_firstSkeletonCheck) { + displayNameChanged = true; + } _firstSkeletonCheck = false; } From de55a5dfe692e8868cdda345d87873ff50da17dc Mon Sep 17 00:00:00 2001 From: "Anthony J. Thibault" Date: Wed, 1 Feb 2017 18:47:50 -0800 Subject: [PATCH 5/6] tablet-ui: reduced volume of button click --- interface/resources/qml/hifi/tablet/TabletRoot.qml | 1 + libraries/script-engine/src/SoundEffect.cpp | 9 +++++++++ libraries/script-engine/src/SoundEffect.h | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/interface/resources/qml/hifi/tablet/TabletRoot.qml b/interface/resources/qml/hifi/tablet/TabletRoot.qml index ded91a5eff..cfda92e774 100644 --- a/interface/resources/qml/hifi/tablet/TabletRoot.qml +++ b/interface/resources/qml/hifi/tablet/TabletRoot.qml @@ -20,6 +20,7 @@ Item { SoundEffect { id: buttonClickSound + volume: 0.1 source: "../../../sounds/Gamemaster-Audio-button-click.wav" } diff --git a/libraries/script-engine/src/SoundEffect.cpp b/libraries/script-engine/src/SoundEffect.cpp index 6833bb1f31..1c78ae84bf 100644 --- a/libraries/script-engine/src/SoundEffect.cpp +++ b/libraries/script-engine/src/SoundEffect.cpp @@ -23,10 +23,19 @@ void SoundEffect::setSource(QUrl url) { _sound = DependencyManager::get()->getSound(_url); } +float SoundEffect::getVolume() const { + return _volume; +} + +void SoundEffect::setVolume(float volume) { + _volume = volume; +} + void SoundEffect::play(QVariant position) { AudioInjectorOptions options; options.position = vec3FromVariant(position); options.localOnly = true; + options.volume = _volume; if (_injector) { _injector->setOptions(options); _injector->restart(); diff --git a/libraries/script-engine/src/SoundEffect.h b/libraries/script-engine/src/SoundEffect.h index 5d2a5095c1..656f98dd8d 100644 --- a/libraries/script-engine/src/SoundEffect.h +++ b/libraries/script-engine/src/SoundEffect.h @@ -22,6 +22,7 @@ class AudioInjector; class SoundEffect : public QQuickItem { Q_OBJECT Q_PROPERTY(QUrl source READ getSource WRITE setSource) + Q_PROPERTY(float volume READ getVolume WRITE setVolume) public: virtual ~SoundEffect(); @@ -29,9 +30,13 @@ public: QUrl getSource() const; void setSource(QUrl url); + float getVolume() const; + void setVolume(float volume); + Q_INVOKABLE void play(QVariant position); protected: QUrl _url; + float _volume { 1.0f }; SharedSoundPointer _sound; AudioInjector* _injector { nullptr }; }; From 4ae163ac60bf3484032298483b80c398bdd4d206 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Wed, 1 Feb 2017 19:01:55 -0800 Subject: [PATCH 6/6] hook pal audio meter up again --- scripts/system/pal.js | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/system/pal.js b/scripts/system/pal.js index 800a1a8c42..8c53ccd59d 100644 --- a/scripts/system/pal.js +++ b/scripts/system/pal.js @@ -520,6 +520,7 @@ function onClicked() { Controller.mouseMoveEvent.connect(handleMouseMoveEvent); triggerMapping.enable(); triggerPressMapping.enable(); + createAudioInterval(); } else { off(); }