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:
Shannon Romano 2019-11-20 09:27:36 -08:00 committed by GitHub
commit 37a46d91fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3620,14 +3620,17 @@ void MyAvatar::updateOrientation(float deltaTime) {
ajustedYawVector = (leftRightDot < 0.0f ? -avatarVectorRight : avatarVectorRight);
}
if (frontBackDot < limitAngle) {
if (!isRotatingWhileSeated) {
if (frontBackDot < triggerAngle) {
if (frontBackDot < triggerAngle && _seatedBodyYawDelta == 0.0f) {
_shouldTurnToFaceCamera = true;
_firstPersonSteadyHeadTimer = 0.0f;
} else {
setWorldOrientation(previousOrientation);
_seatedBodyYawDelta = 0.0f;
}
} else {
setWorldOrientation(previousOrientation);
_seatedBodyYawDelta = 0.0f;
}
} else if (frontBackDot > glm::sin(glm::radians(reorientAngle))) {
_shouldTurnToFaceCamera = false;