Merge pull request #16310 from luiscuenca/fixStrafeWhileFlying

DEV-2261: DEV-2320: Fix strafe while flying, and ramp up diagonal movement
This commit is contained in:
Shannon Romano 2019-10-08 11:45:26 -07:00 committed by GitHub
commit 0bf7fd0233
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3560,7 +3560,7 @@ void MyAvatar::updateOrientation(float deltaTime) {
if (faceForward || _shouldTurnToFaceCamera) {
const float REORIENT_FORWARD_BLEND = 0.25f;
const float REORIENT_TURN_BLEND = 0.03f;
const float DIAGONAL_TURN_BLEND = 0.02f;
const float DIAGONAL_TURN_BLEND = 0.1f;
float blend = (_shouldTurnToFaceCamera ? REORIENT_TURN_BLEND : REORIENT_FORWARD_BLEND) * timeScale;
if (blend > 1.0f) {
blend = 1.0f;
@ -3772,7 +3772,8 @@ glm::vec3 MyAvatar::scaleMotorSpeed(const glm::vec3 forward, const glm::vec3 rig
// Desktop mode.
direction = (zSpeed * forward) + (xSpeed * right);
CameraMode mode = qApp->getCamera().getMode();
if ((mode == CAMERA_MODE_LOOK_AT || mode == CAMERA_MODE_FIRST_PERSON || mode == CAMERA_MODE_SELFIE) && zSpeed != 0.0f && xSpeed != 0.0f){
if ((mode == CAMERA_MODE_LOOK_AT || mode == CAMERA_MODE_FIRST_PERSON || mode == CAMERA_MODE_SELFIE) &&
zSpeed != 0.0f && xSpeed != 0.0f && !isFlying()){
direction = (zSpeed * forward);
}