Merge branch 'master' of https://github.com/highfidelity/hifi into blue

This commit is contained in:
samcake 2017-02-02 10:08:05 -08:00
commit e77b920592
10 changed files with 42 additions and 17 deletions

View file

@ -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.

View file

@ -593,10 +593,15 @@ void AvatarMixer::handleAvatarIdentityPacket(QSharedPointer<ReceivedMessage> 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);
}
}
}
}

View file

@ -20,6 +20,7 @@ Item {
SoundEffect {
id: buttonClickSound
volume: 0.1
source: "../../../sounds/Gamemaster-Audio-button-click.wav"
}

View file

@ -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;

View file

@ -1336,24 +1336,27 @@ 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;
if (_firstSkeletonCheck) {
displayNameChanged = 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 +1365,8 @@ bool AvatarData::processAvatarIdentity(const Identity& identity) {
});
if (avatarEntityDataChanged) {
setAvatarEntityData(identity.avatarEntityData);
hasIdentityChanged = true;
identityChanged = true;
}
return hasIdentityChanged;
}
QByteArray AvatarData::identityByteArray() {

View file

@ -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();

View file

@ -148,7 +148,9 @@ void AvatarHashMap::processAvatarIdentityPacket(QSharedPointer<ReceivedMessage>
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);
}
}

View file

@ -23,10 +23,19 @@ void SoundEffect::setSource(QUrl url) {
_sound = DependencyManager::get<SoundCache>()->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();

View file

@ -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 };
};

View file

@ -520,6 +520,7 @@ function onClicked() {
Controller.mouseMoveEvent.connect(handleMouseMoveEvent);
triggerMapping.enable();
triggerPressMapping.enable();
createAudioInterval();
} else {
off();
}