Fix case where Avatar could get stuck facing camera if rotating camera quickly and avatar faced backward.

This commit is contained in:
DouglasWilcox 2019-11-19 14:32:51 -08:00
parent 8ccdfaf220
commit 19aacde3a2

View file

@ -3620,14 +3620,14 @@ void MyAvatar::updateOrientation(float deltaTime) {
ajustedYawVector = (leftRightDot < 0.0f ? -avatarVectorRight : avatarVectorRight); ajustedYawVector = (leftRightDot < 0.0f ? -avatarVectorRight : avatarVectorRight);
} }
if (frontBackDot < limitAngle) { if (frontBackDot < limitAngle) {
_seatedBodyYawDelta = 0.0f;
if (!isRotatingWhileSeated) { if (!isRotatingWhileSeated) {
if (frontBackDot < triggerAngle && isCameraYawing) { 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;
} }
} else { } else {
setWorldOrientation(previousOrientation); setWorldOrientation(previousOrientation);