mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 09:24:00 +02:00
Merge pull request #1072 from ey6es/master
Another slight fix for circling.
This commit is contained in:
commit
537f325447
1 changed files with 6 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue