mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-07-23 15:34:47 +02:00
Merge remote-tracking branch 'upstream/master' into qt59
This commit is contained in:
commit
de9f620121
5 changed files with 30 additions and 13 deletions
|
@ -506,7 +506,7 @@ Rectangle {
|
||||||
}
|
}
|
||||||
HifiControls.Tree {
|
HifiControls.Tree {
|
||||||
id: treeView
|
id: treeView
|
||||||
height: 430
|
height: 290
|
||||||
anchors.leftMargin: hifi.dimensions.contentMargin.x + 2 // Extra for border
|
anchors.leftMargin: hifi.dimensions.contentMargin.x + 2 // Extra for border
|
||||||
anchors.rightMargin: hifi.dimensions.contentMargin.x + 2 // Extra for border
|
anchors.rightMargin: hifi.dimensions.contentMargin.x + 2 // Extra for border
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
|
|
|
@ -27,8 +27,6 @@
|
||||||
#include "AudioSRC.h"
|
#include "AudioSRC.h"
|
||||||
#include "AudioHelpers.h"
|
#include "AudioHelpers.h"
|
||||||
|
|
||||||
int audioInjectorPtrMetaTypeId = qRegisterMetaType<AudioInjector*>();
|
|
||||||
|
|
||||||
AbstractAudioInterface* AudioInjector::_localAudioInterface{ nullptr };
|
AbstractAudioInterface* AudioInjector::_localAudioInterface{ nullptr };
|
||||||
|
|
||||||
AudioInjectorState operator& (AudioInjectorState lhs, AudioInjectorState rhs) {
|
AudioInjectorState operator& (AudioInjectorState lhs, AudioInjectorState rhs) {
|
||||||
|
|
|
@ -125,6 +125,4 @@ private:
|
||||||
friend class AudioInjectorManager;
|
friend class AudioInjectorManager;
|
||||||
};
|
};
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(AudioInjectorPointer)
|
|
||||||
|
|
||||||
#endif // hifi_AudioInjector_h
|
#endif // hifi_AudioInjector_h
|
||||||
|
|
|
@ -1034,9 +1034,18 @@ EquipHotspotBuddy.prototype.update = function(deltaTime, timestamp) {
|
||||||
|
|
||||||
function getControllerJointIndex(hand) {
|
function getControllerJointIndex(hand) {
|
||||||
if (HMD.isHandControllerAvailable()) {
|
if (HMD.isHandControllerAvailable()) {
|
||||||
return MyAvatar.getJointIndex(hand === RIGHT_HAND ?
|
var controllerJointIndex = -1;
|
||||||
|
if (Camera.mode === "first person") {
|
||||||
|
controllerJointIndex = MyAvatar.getJointIndex(hand === RIGHT_HAND ?
|
||||||
"_CONTROLLER_RIGHTHAND" :
|
"_CONTROLLER_RIGHTHAND" :
|
||||||
"_CONTROLLER_LEFTHAND");
|
"_CONTROLLER_LEFTHAND");
|
||||||
|
} else if (Camera.mode === "third person") {
|
||||||
|
controllerJointIndex = MyAvatar.getJointIndex(hand === RIGHT_HAND ?
|
||||||
|
"_CAMERA_RELATIVE_CONTROLLER_RIGHTHAND" :
|
||||||
|
"_CAMERA_RELATIVE_CONTROLLER_LEFTHAND");
|
||||||
|
}
|
||||||
|
|
||||||
|
return controllerJointIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
return MyAvatar.getJointIndex("Head");
|
return MyAvatar.getJointIndex("Head");
|
||||||
|
|
|
@ -122,10 +122,20 @@
|
||||||
|
|
||||||
this.rolesToOverride = function() {
|
this.rolesToOverride = function() {
|
||||||
return MyAvatar.getAnimationRoles().filter(function(role) {
|
return MyAvatar.getAnimationRoles().filter(function(role) {
|
||||||
return role === "fly" || role.startsWith("inAir");
|
return !(role.startsWith("right") || role.startsWith("left"));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Handler for user changing the avatar model while sitting. There's currently an issue with changing avatar models while override role animations are applied,
|
||||||
|
// so to avoid that problem, re-apply the role overrides once the model has finished changing.
|
||||||
|
this.modelURLChangeFinished = function () {
|
||||||
|
print("Sitter's model has FINISHED changing. Reapply anim role overrides.");
|
||||||
|
var roles = this.rolesToOverride();
|
||||||
|
for (i in roles) {
|
||||||
|
MyAvatar.overrideRoleAnimation(roles[i], ANIMATION_URL, ANIMATION_FPS, true, ANIMATION_FIRST_FRAME, ANIMATION_LAST_FRAME);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.sitDown = function() {
|
this.sitDown = function() {
|
||||||
if (this.checkSeatForAvatar()) {
|
if (this.checkSeatForAvatar()) {
|
||||||
print("Someone is already sitting in that chair.");
|
print("Someone is already sitting in that chair.");
|
||||||
|
@ -164,12 +174,14 @@
|
||||||
return { headType: 0 };
|
return { headType: 0 };
|
||||||
}, ["headType"]);
|
}, ["headType"]);
|
||||||
Script.update.connect(this, this.update);
|
Script.update.connect(this, this.update);
|
||||||
|
MyAvatar.onLoadComplete.connect(this, this.modelURLChangeFinished);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.standUp = function() {
|
this.standUp = function() {
|
||||||
print("Standing up (" + this.entityID + ")");
|
print("Standing up (" + this.entityID + ")");
|
||||||
MyAvatar.removeAnimationStateHandler(this.animStateHandlerID);
|
MyAvatar.removeAnimationStateHandler(this.animStateHandlerID);
|
||||||
Script.update.disconnect(this, this.update);
|
Script.update.disconnect(this, this.update);
|
||||||
|
MyAvatar.onLoadComplete.disconnect(this, this.modelURLChangeFinished);
|
||||||
|
|
||||||
if (MyAvatar.sessionUUID === this.getSeatUser()) {
|
if (MyAvatar.sessionUUID === this.getSeatUser()) {
|
||||||
this.setSeatUser(null);
|
this.setSeatUser(null);
|
||||||
|
|
Loading…
Reference in a new issue