Fixed BezelCompensation calculation

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@4703 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: eb1407e05055982bf3c93616e3bbd780973df881
Former-commit-id: 1d53522dc2463c8807cf610954bb566121476f09
This commit is contained in:
mungewell 2012-04-20 02:30:35 +00:00
parent 714f6c6019
commit 5d91fe44bf

View file

@ -305,7 +305,8 @@ class cGrCarCamInsideDriverEye : public cGrPerspCamera
// Compute offset angle and bezel compensation)
if (spansplit && viewOffset) {
offset += (viewOffset - 10) * bezelcomp / 100 * atan(screen->getViewRatio() * tan(spanfovy * M_PI / 360.0)) * 2;
offset += (viewOffset - 10 + (int((viewOffset - 10) * 2) * (bezelcomp - 100)/200)) *
atan(screen->getViewRatio() * tan(spanfovy * M_PI / 360.0)) * 2;
fovy = spanfovy;
}
@ -585,7 +586,8 @@ class cGrCarCamInsideFixedCar : public cGrPerspCamera
// Compute offset angle and bezel compensation)
if (spansplit && viewOffset) {
offset += (viewOffset - 10) * bezelcomp / 100 * atan(screen->getViewRatio() * tan(spanfovy * M_PI / 360.0)) * 2;
offset += (viewOffset - 10 + (int((viewOffset - 10) * 2) * (bezelcomp - 100)/200)) *
atan(screen->getViewRatio() * tan(spanfovy * M_PI / 360.0)) * 2;
fovy = spanfovy;
}
@ -640,7 +642,8 @@ class cGrCarCamBehindFixedCar : public cGrPerspCamera
// Compute offset angle and bezel compensation)
if (spansplit && viewOffset) {
offset += (viewOffset - 10) * bezelcomp / 100 * atan(screen->getViewRatio() * tan(spanfovy * M_PI / 360.0)) * 2;
offset += (viewOffset - 10 + (int((viewOffset - 10) * 2) * (bezelcomp - 100)/200)) *
atan(screen->getViewRatio() * tan(spanfovy * M_PI / 360.0)) * 2;
fovy = spanfovy;
}
@ -711,7 +714,8 @@ class cGrCarCamBehindReverse : public cGrPerspCamera
// Compute offset angle and bezel compensation)
if (spansplit && viewOffset) {
offset += (viewOffset - 10) * bezelcomp / 100 * atan(screen->getViewRatio() * tan(spanfovy * M_PI / 360.0)) * 2;
offset += (viewOffset - 10 + (int((viewOffset - 10) * 2) * (bezelcomp - 100)/200)) *
atan(screen->getViewRatio() * tan(spanfovy * M_PI / 360.0)) * 2;
fovy = spanfovy;
}