mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 07:58:59 +02:00
Merge pull request #16513 from DouglasWilcox/Fix_seated_rotation_edge_case_bounce
Edge case fix for seated rotation - it would bounce forward if you let go of Q/E at exact right time.
This commit is contained in:
commit
37a46d91fa
1 changed files with 5 additions and 2 deletions
|
@ -3620,15 +3620,18 @@ void MyAvatar::updateOrientation(float deltaTime) {
|
||||||
ajustedYawVector = (leftRightDot < 0.0f ? -avatarVectorRight : avatarVectorRight);
|
ajustedYawVector = (leftRightDot < 0.0f ? -avatarVectorRight : avatarVectorRight);
|
||||||
}
|
}
|
||||||
if (frontBackDot < limitAngle) {
|
if (frontBackDot < limitAngle) {
|
||||||
|
|
||||||
if (!isRotatingWhileSeated) {
|
if (!isRotatingWhileSeated) {
|
||||||
if (frontBackDot < triggerAngle) {
|
if (frontBackDot < triggerAngle && _seatedBodyYawDelta == 0.0f) {
|
||||||
_shouldTurnToFaceCamera = true;
|
_shouldTurnToFaceCamera = true;
|
||||||
_firstPersonSteadyHeadTimer = 0.0f;
|
_firstPersonSteadyHeadTimer = 0.0f;
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
setWorldOrientation(previousOrientation);
|
setWorldOrientation(previousOrientation);
|
||||||
_seatedBodyYawDelta = 0.0f;
|
_seatedBodyYawDelta = 0.0f;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
setWorldOrientation(previousOrientation);
|
||||||
|
}
|
||||||
} else if (frontBackDot > glm::sin(glm::radians(reorientAngle))) {
|
} else if (frontBackDot > glm::sin(glm::radians(reorientAngle))) {
|
||||||
_shouldTurnToFaceCamera = false;
|
_shouldTurnToFaceCamera = false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue