Merge remote-tracking branch 'upstream/master' into connection-class-ignored-unused

This commit is contained in:
Simon Walton 2019-09-25 13:06:32 -07:00
commit 6ccfc37f27
13 changed files with 115 additions and 56 deletions

View file

@ -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<int16_t*>(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<int16_t*>(audio.data());
int numSamples = AudioConstants::NETWORK_FRAME_SAMPLES_PER_CHANNEL;
_audioGate.render(samples, samples, numSamples);
}

View file

@ -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')

View file

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

View file

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

View file

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

View file

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

View file

@ -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<float> _realWorldFieldOfView;
Setting::Handle<bool> _useAdvancedMovementControls;
Setting::Handle<bool> _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;

View file

@ -50,9 +50,6 @@ ContextOverlayInterface::ContextOverlayInterface() {
_entityPropertyFlags += PROP_OWNING_AVATAR_ID;
auto entityScriptingInterface = DependencyManager::get<EntityScriptingInterface>().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()) {

View file

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

View file

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

View file

@ -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) {

View file

@ -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 <code>0.0</code> &ndash; <code>1.0</code>.
*/
void setPlayerVolume(float volume);