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:
parent
0724a5bd71
commit
734f6255c0
14
src/camera.h
14
src/camera.h
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user