Compute when negative deltas

This commit is contained in:
luiscuenca 2019-09-11 16:27:07 -07:00
parent 793b2917f6
commit 8af22f0c04
No known key found for this signature in database
GPG key ID: 2387ECD129A6961D

View file

@ -3420,12 +3420,12 @@ void MyAvatar::updateOrientation(float deltaTime) {
_lookAtOffsetPitch = Quaternions::IDENTITY;
} else {
// Compute new look at vectors
if (totalBodyYaw > 0.0f) {
if (totalBodyYaw != 0.0f) {
_lookAtOffsetYaw = _lookAtOffsetYaw * glm::quat(glm::radians(glm::vec3(0.0f, totalBodyYaw, 0.0f)));
}
float pitchIncrement = getDriveKey(PITCH) * _pitchSpeed * deltaTime
+ getDriveKey(DELTA_PITCH) * _pitchSpeed / PITCH_SPEED_DEFAULT;
if (pitchIncrement > 0.0f) {
if (pitchIncrement != 0.0f) {
glm::quat _previousLookAtOffsetPitch = _lookAtOffsetPitch;
_lookAtOffsetPitch = _lookAtOffsetPitch * glm::quat(glm::radians(glm::vec3(pitchIncrement, 0.0f, 0.0f)));
// Limit the camera horizontal pitch