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

fix camera lookAt for first person view

This commit is contained in:
XProger
2018-10-18 07:29:06 +03:00
parent 621c0495e7
commit 7e0a467016

View File

@@ -364,8 +364,6 @@ struct Camera : ICamera {
} else
updateFirstPerson();
} else {
Controller *lookAt = NULL;
if (Core::settings.detail.stereo == Core::Settings::STEREO_VR) {
lookAngle = vec3(0.0f);
} else {
@@ -392,6 +390,15 @@ struct Camera : ICamera {
}
}
targetAngle = owner->angle + lookAngle;
targetAngle.x = clampAngle(targetAngle.x);
targetAngle.y = clampAngle(targetAngle.y);
targetAngle.x = clamp(targetAngle.x, -85 * DEG2RAD, +85 * DEG2RAD);
Controller *lookAt = NULL;
if (mode != MODE_STATIC) {
if (!owner->viewTarget) {
if (viewTarget && !viewTarget->flags.invisible) {
@@ -408,15 +415,9 @@ struct Camera : ICamera {
owner->lookAt(NULL);
}
targetAngle = owner->angle + lookAngle;
if (!firstPerson && (mode == MODE_FOLLOW || mode == MODE_COMBAT))
targetAngle += angle;
targetAngle.x = clampAngle(targetAngle.x);
targetAngle.y = clampAngle(targetAngle.y);
targetAngle.x = clamp(targetAngle.x, -85 * DEG2RAD, +85 * DEG2RAD);
if (!firstPerson || viewIndex != -1) {
if (timer > 0.0f) {