From c324933b8a22f9ff2dfae8df80068734b9d2fbc2 Mon Sep 17 00:00:00 2001 From: Philip Rosedale Date: Wed, 16 Oct 2013 16:49:33 -0700 Subject: [PATCH 1/5] Move to 'european' comfort distance for chat circle --- interface/src/avatar/MyAvatar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 7fc625072e..1ce02ea4e2 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -1127,7 +1127,7 @@ void MyAvatar::updateChatCircle(float deltaTime) { } // remove members whose accumulated circles are too far away to influence us - const float CIRCUMFERENCE_PER_MEMBER = 2.0f; + const float CIRCUMFERENCE_PER_MEMBER = 1.0f; const float CIRCLE_INFLUENCE_SCALE = 1.1f; for (int i = sortedAvatars.size() - 1; i >= 0; i--) { float radius = (CIRCUMFERENCE_PER_MEMBER * (i + 2)) / PI_TIMES_TWO; From 89d6c7905bb443cb21cf922e961ef7760b2c5a85 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Wed, 16 Oct 2013 17:21:09 -0700 Subject: [PATCH 2/5] Decrease the distance between members, increase the influence of the circle, don't rotate members. --- interface/src/avatar/MyAvatar.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 1ce02ea4e2..55752339fa 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -1127,8 +1127,8 @@ void MyAvatar::updateChatCircle(float deltaTime) { } // remove members whose accumulated circles are too far away to influence us - const float CIRCUMFERENCE_PER_MEMBER = 1.0f; - const float CIRCLE_INFLUENCE_SCALE = 1.1f; + const float CIRCUMFERENCE_PER_MEMBER = 0.5f; + const float CIRCLE_INFLUENCE_SCALE = 1.5f; for (int i = sortedAvatars.size() - 1; i >= 0; i--) { float radius = (CIRCUMFERENCE_PER_MEMBER * (i + 2)) / PI_TIMES_TWO; if (glm::distance(_position, sortedAvatars[i].accumulatedCenter) > radius * CIRCLE_INFLUENCE_SCALE) { @@ -1182,15 +1182,9 @@ void MyAvatar::updateChatCircle(float deltaTime) { float targetAngle = myAngle + (rightDistance - leftDistance) / 2.0f; glm::vec3 targetPosition = center + (front * sinf(targetAngle) + right * cosf(targetAngle)) * radius; - // face the center of the circle - glm::quat orientation = getOrientation(); - glm::quat targetOrientation = rotationBetween(orientation * IDENTITY_FRONT, center - targetPosition) * orientation; - targetOrientation = rotationBetween(targetOrientation * IDENTITY_UP, up) * targetOrientation; - - // approach the target position/orientation + // approach the target position const float APPROACH_RATE = 0.025f; _position = glm::mix(_position, targetPosition, APPROACH_RATE); - setOrientation(safeMix(orientation, targetOrientation, APPROACH_RATE)); } void MyAvatar::setGravity(glm::vec3 gravity) { From a5a81a585e78c757339e0cbc66edbb7514e8ce4c Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Wed, 16 Oct 2013 17:47:39 -0700 Subject: [PATCH 3/5] Fix for glow flickering. --- interface/src/renderer/GlowEffect.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/src/renderer/GlowEffect.cpp b/interface/src/renderer/GlowEffect.cpp index fc95ed24d6..fe46e02688 100644 --- a/interface/src/renderer/GlowEffect.cpp +++ b/interface/src/renderer/GlowEffect.cpp @@ -133,7 +133,7 @@ QOpenGLFramebufferObject* GlowEffect::render(bool toTexture) { QOpenGLFramebufferObject* destFBO = toTexture ? Application::getInstance()->getTextureCache()->getSecondaryFramebufferObject() : NULL; - if (_isEmpty) { + if (_isEmpty && _renderMode != DIFFUSE_ADD_MODE) { // copy the primary to the screen if (QOpenGLFramebufferObject::hasOpenGLFramebufferBlit()) { QOpenGLFramebufferObject::blitFramebuffer(destFBO, primaryFBO); From 121a7f82703471473e99b952caf89f2371b2636e Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Wed, 16 Oct 2013 17:48:28 -0700 Subject: [PATCH 4/5] Widen the circle influence, increase the approach rate. --- interface/src/avatar/MyAvatar.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 55752339fa..120ee2c09b 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -1128,7 +1128,7 @@ void MyAvatar::updateChatCircle(float deltaTime) { // remove members whose accumulated circles are too far away to influence us const float CIRCUMFERENCE_PER_MEMBER = 0.5f; - const float CIRCLE_INFLUENCE_SCALE = 1.5f; + const float CIRCLE_INFLUENCE_SCALE = 2.0f; for (int i = sortedAvatars.size() - 1; i >= 0; i--) { float radius = (CIRCUMFERENCE_PER_MEMBER * (i + 2)) / PI_TIMES_TWO; if (glm::distance(_position, sortedAvatars[i].accumulatedCenter) > radius * CIRCLE_INFLUENCE_SCALE) { @@ -1183,7 +1183,7 @@ void MyAvatar::updateChatCircle(float deltaTime) { glm::vec3 targetPosition = center + (front * sinf(targetAngle) + right * cosf(targetAngle)) * radius; // approach the target position - const float APPROACH_RATE = 0.025f; + const float APPROACH_RATE = 0.05f; _position = glm::mix(_position, targetPosition, APPROACH_RATE); } From b25020b84af7ed9b094dce02fe9aea25df608fc8 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Thu, 17 Oct 2013 10:58:33 -0700 Subject: [PATCH 5/5] Need to halve the target angle, because both participants will be moving. Use randomness to resolve cases where two participants are on top of one another. --- interface/src/avatar/MyAvatar.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 120ee2c09b..bbdd414494 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -1178,8 +1178,13 @@ void MyAvatar::updateChatCircle(float deltaTime) { } } + // if we're on top of a neighbor, we need to randomize so that they don't both go in the same direction + if (rightDistance == 0.0f && randomBoolean()) { + swap(leftDistance, rightDistance); + } + // split the difference between our neighbors - float targetAngle = myAngle + (rightDistance - leftDistance) / 2.0f; + float targetAngle = myAngle + (rightDistance - leftDistance) / 4.0f; glm::vec3 targetPosition = center + (front * sinf(targetAngle) + right * cosf(targetAngle)) * radius; // approach the target position