1
0
mirror of https://github.com/XProger/OpenLara.git synced 2025-01-17 21:09:00 +01:00

fix look in spectator mode

This commit is contained in:
XProger 2021-03-22 08:54:09 +03:00
parent 0724a5bd71
commit 734f6255c0

View File

@ -442,13 +442,15 @@ struct Camera : ICamera {
if (lookAngle.y < EPS) lookAngle.y = 0.0f;
}
vec2 R = Input::joy[Core::settings.controls[cameraIndex].joyIndex].R;
R.x = sign(R.x) * max(0.0f, (fabsf(R.x) - INPUT_JOY_DZ_STICK) / (1.0f - INPUT_JOY_DZ_STICK));
R.y = sign(R.y) * max(0.0f, (fabsf(R.y) - INPUT_JOY_DZ_STICK) / (1.0f - INPUT_JOY_DZ_STICK));
if (!spectator) {
vec2 R = Input::joy[Core::settings.controls[cameraIndex].joyIndex].R;
R.x = sign(R.x) * max(0.0f, (fabsf(R.x) - INPUT_JOY_DZ_STICK) / (1.0f - INPUT_JOY_DZ_STICK));
R.y = sign(R.y) * max(0.0f, (fabsf(R.y) - INPUT_JOY_DZ_STICK) / (1.0f - INPUT_JOY_DZ_STICK));
viewAngle.x = -R.y * PI * 0.375f;
viewAngle.y = R.x * PI * 0.5f;
viewAngle.z = 0.0f;
viewAngle.x = -R.y * PI * 0.375f;
viewAngle.y = R.x * PI * 0.5f;
viewAngle.z = 0.0f;
}
}
}