Merge pull request #1072 from ey6es/master

Another slight fix for circling.
This commit is contained in:
Andrzej Kapolka 2013-10-17 11:01:40 -07:00
commit 537f325447

View file

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