From b25020b84af7ed9b094dce02fe9aea25df608fc8 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Thu, 17 Oct 2013 10:58:33 -0700 Subject: [PATCH] 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