Clamp rotation velocity if hit trigger angle, but only bounce forward if cameraYaw is true.

This commit is contained in:
DouglasWilcox 2019-11-19 12:05:25 -08:00
parent 0f428f0afb
commit 8ccdfaf220

View file

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