mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-05 23:27:42 +02:00
Clamp rotation velocity if hit trigger angle, but only bounce forward if cameraYaw is true.
This commit is contained in:
parent
0f428f0afb
commit
8ccdfaf220
1 changed files with 5 additions and 2 deletions
|
@ -3620,14 +3620,17 @@ 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) {
|
if (frontBackDot < triggerAngle && isCameraYawing) {
|
||||||
_shouldTurnToFaceCamera = true;
|
_shouldTurnToFaceCamera = true;
|
||||||
_firstPersonSteadyHeadTimer = 0.0f;
|
_firstPersonSteadyHeadTimer = 0.0f;
|
||||||
|
} else {
|
||||||
|
setWorldOrientation(previousOrientation);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
setWorldOrientation(previousOrientation);
|
setWorldOrientation(previousOrientation);
|
||||||
_seatedBodyYawDelta = 0.0f;
|
|
||||||
}
|
}
|
||||||
} 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