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

This commit is contained in:
milad 2019-11-01 10:53:03 -07:00
commit d9d9877f83
4 changed files with 1891 additions and 1699 deletions

File diff suppressed because it is too large Load diff

View file

@ -100,7 +100,7 @@ static const QString USER_RECENTER_MODEL_DISABLE_HMD_LEAN = QStringLiteral("Disa
const QString HEAD_BLEND_DIRECTIONAL_ALPHA_NAME = "lookAroundAlpha";
const QString HEAD_BLEND_LINEAR_ALPHA_NAME = "lookBlendAlpha";
const float HEAD_ALPHA_BLENDING = 1.0f;
const QString SEATED_HEAD_BLEND_LINEAR_ALPHA_NAME = "seatedLookBlendAlpha";
const QString POINT_REACTION_NAME = "point";
const QString POINT_BLEND_DIRECTIONAL_ALPHA_NAME = "pointAroundAlpha";
@ -6672,8 +6672,17 @@ glm::vec3 MyAvatar::aimToBlendValues(const glm::vec3& aimVector, const glm::quat
void MyAvatar::resetHeadLookAt() {
if (_skeletonModel->isLoaded()) {
_skeletonModel->getRig().setDirectionalBlending(HEAD_BLEND_DIRECTIONAL_ALPHA_NAME, glm::vec3(),
HEAD_BLEND_LINEAR_ALPHA_NAME, HEAD_ALPHA_BLENDING);
if (isSeated()) {
_skeletonModel->getRig().setDirectionalBlending(HEAD_BLEND_DIRECTIONAL_ALPHA_NAME, glm::vec3(),
HEAD_BLEND_LINEAR_ALPHA_NAME, 0.0f);
_skeletonModel->getRig().setDirectionalBlending(HEAD_BLEND_DIRECTIONAL_ALPHA_NAME, glm::vec3(),
SEATED_HEAD_BLEND_LINEAR_ALPHA_NAME, 1.0f);
} else {
_skeletonModel->getRig().setDirectionalBlending(HEAD_BLEND_DIRECTIONAL_ALPHA_NAME, glm::vec3(),
HEAD_BLEND_LINEAR_ALPHA_NAME, 1.0f);
_skeletonModel->getRig().setDirectionalBlending(HEAD_BLEND_DIRECTIONAL_ALPHA_NAME, glm::vec3(),
SEATED_HEAD_BLEND_LINEAR_ALPHA_NAME, 0.0f);
}
}
}
@ -6686,13 +6695,22 @@ void MyAvatar::resetLookAtRotation(const glm::vec3& avatarPosition, const glm::q
resetHeadLookAt();
}
void MyAvatar::updateHeadLookAt(float deltaTime) {
void MyAvatar::updateHeadLookAt(float deltaTime) {
if (_skeletonModel->isLoaded()) {
glm::vec3 lookAtTarget = _scriptControlsHeadLookAt ? _lookAtScriptTarget : _lookAtCameraTarget;
glm::vec3 aimVector = lookAtTarget - getDefaultEyePosition();
glm::vec3 lookAtBlend = MyAvatar::aimToBlendValues(aimVector, getWorldOrientation());
_skeletonModel->getRig().setDirectionalBlending(HEAD_BLEND_DIRECTIONAL_ALPHA_NAME, lookAtBlend,
HEAD_BLEND_LINEAR_ALPHA_NAME, HEAD_ALPHA_BLENDING);
if (isSeated()) {
_skeletonModel->getRig().setDirectionalBlending(HEAD_BLEND_DIRECTIONAL_ALPHA_NAME, lookAtBlend,
HEAD_BLEND_LINEAR_ALPHA_NAME, 0.0f);
_skeletonModel->getRig().setDirectionalBlending(HEAD_BLEND_DIRECTIONAL_ALPHA_NAME, lookAtBlend,
SEATED_HEAD_BLEND_LINEAR_ALPHA_NAME, 1.0f);
} else {
_skeletonModel->getRig().setDirectionalBlending(HEAD_BLEND_DIRECTIONAL_ALPHA_NAME, lookAtBlend,
HEAD_BLEND_LINEAR_ALPHA_NAME, 1.0f);
_skeletonModel->getRig().setDirectionalBlending(HEAD_BLEND_DIRECTIONAL_ALPHA_NAME, lookAtBlend,
SEATED_HEAD_BLEND_LINEAR_ALPHA_NAME, 0.0f);
}
if (_scriptControlsHeadLookAt) {
_scriptHeadControlTimer += deltaTime;

View file

@ -1187,12 +1187,12 @@ void AudioClient::processWebrtcFarEnd(const int16_t* samples, int numFrames, int
const webrtc::StreamConfig streamConfig = webrtc::StreamConfig(sampleRate, numChannels);
const int numChunk = (int)streamConfig.num_frames();
if (sampleRate > WEBRTC_SAMPLE_RATE_MAX) {
qCWarning(audioclient) << "WebRTC does not support" << sampleRate << "output sample rate.";
return;
}
if (numChannels > WEBRTC_CHANNELS_MAX) {
qCWarning(audioclient) << "WebRTC does not support" << numChannels << "output channels.";
static int32_t lastWarningHash = 0;
if (sampleRate > WEBRTC_SAMPLE_RATE_MAX || numChannels > WEBRTC_CHANNELS_MAX) {
if (lastWarningHash != ((sampleRate << 8) | numChannels)) {
lastWarningHash = ((sampleRate << 8) | numChannels);
qCWarning(audioclient) << "AEC not unsupported for output format: sampleRate =" << sampleRate << "numChannels =" << numChannels;
}
return;
}
@ -1227,18 +1227,14 @@ void AudioClient::processWebrtcFarEnd(const int16_t* samples, int numFrames, int
void AudioClient::processWebrtcNearEnd(int16_t* samples, int numFrames, int numChannels, int sampleRate) {
const webrtc::StreamConfig streamConfig = webrtc::StreamConfig(sampleRate, numChannels);
const int numChunk = (int)streamConfig.num_frames();
assert(numFrames == (int)streamConfig.num_frames()); // WebRTC requires exactly 10ms of input
if (sampleRate > WEBRTC_SAMPLE_RATE_MAX) {
qCWarning(audioclient) << "WebRTC does not support" << sampleRate << "input sample rate.";
return;
}
if (numChannels > WEBRTC_CHANNELS_MAX) {
qCWarning(audioclient) << "WebRTC does not support" << numChannels << "input channels.";
return;
}
if (numFrames != numChunk) {
qCWarning(audioclient) << "WebRTC requires exactly 10ms of input.";
static int32_t lastWarningHash = 0;
if (sampleRate > WEBRTC_SAMPLE_RATE_MAX || numChannels > WEBRTC_CHANNELS_MAX) {
if (lastWarningHash != ((sampleRate << 8) | numChannels)) {
lastWarningHash = ((sampleRate << 8) | numChannels);
qCWarning(audioclient) << "AEC not unsupported for input format: sampleRate =" << sampleRate << "numChannels =" << numChannels;
}
return;
}