Fixes #294 Visibility no more customizable when sky dome enabled in Options / Graphics menu ; when sky dome enabled, use 2*skyDomeDistance+1 as far clip plane distance and fogEnd distance, and half of it for forStart distance ; left these distances untouched for when sky dome disabled ; but fixed F6 camera fog distance odd settings
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@4136 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: d6d39fc16320e99379eb8a9ce77d7b020b18fb53 Former-commit-id: ad4595b9e9e094525ea27333a499c9635b061150
This commit is contained in:
parent
2c1ce668be
commit
ce5e4b45a7
4 changed files with 129 additions and 108 deletions
|
@ -1463,7 +1463,8 @@ class cGrCarCamRoadZoomTVD : public cGrCarCamRoadZoom
|
|||
|
||||
|
||||
void
|
||||
grCamCreateSceneCameraList(class cGrScreen *myscreen, tGrCamHead *cams, tdble fovFactor)
|
||||
grCamCreateSceneCameraList(class cGrScreen *myscreen, tGrCamHead *cams,
|
||||
tdble fovFactor, tdble fixedFar)
|
||||
{
|
||||
int id;
|
||||
int c;
|
||||
|
@ -1485,9 +1486,9 @@ grCamCreateSceneCameraList(class cGrScreen *myscreen, tGrCamHead *cams, tdble fo
|
|||
50.0, /* fovymin */
|
||||
95.0, /* fovymax */
|
||||
0.3, /* near */
|
||||
600.0 * fovFactor, /* far */
|
||||
300.0 * fovFactor, /* fogstart */
|
||||
600.0 * fovFactor /* fogend */
|
||||
fixedFar ? fixedFar : 600.0 * fovFactor, /* far */
|
||||
fixedFar ? fixedFar/2 : 300.0 * fovFactor, /* fogstart */
|
||||
fixedFar ? fixedFar : 600.0 * fovFactor /* fogend */
|
||||
);
|
||||
cam->add(&cams[c]);
|
||||
id++;
|
||||
|
@ -1502,9 +1503,9 @@ grCamCreateSceneCameraList(class cGrScreen *myscreen, tGrCamHead *cams, tdble fo
|
|||
50.0, /* fovymin */
|
||||
95.0, /* fovymax */
|
||||
0.03, /* near */
|
||||
600.0 * fovFactor, /* far */
|
||||
300.0 * fovFactor, /* fogstart */
|
||||
600.0 * fovFactor /* fogend */
|
||||
fixedFar ? fixedFar : 600.0 * fovFactor, /* far */
|
||||
fixedFar ? fixedFar/2 : 300.0 * fovFactor, /* fogstart */
|
||||
fixedFar ? fixedFar : 600.0 * fovFactor /* fogend */
|
||||
);
|
||||
cam->add(&cams[c]);
|
||||
id++;
|
||||
|
@ -1518,9 +1519,9 @@ grCamCreateSceneCameraList(class cGrScreen *myscreen, tGrCamHead *cams, tdble fo
|
|||
50.0, /* fovymin */
|
||||
95.0, /* fovymax */
|
||||
0.3, /* near */
|
||||
600.0 * fovFactor, /* far */
|
||||
300.0 * fovFactor, /* fogstart */
|
||||
600.0 * fovFactor /* fogend */
|
||||
fixedFar ? fixedFar : 600.0 * fovFactor, /* far */
|
||||
fixedFar ? fixedFar/2 : 300.0 * fovFactor, /* fogstart */
|
||||
fixedFar ? fixedFar : 600.0 * fovFactor /* fogend */
|
||||
);
|
||||
cam->add(&cams[c]);
|
||||
id++;
|
||||
|
@ -1534,9 +1535,9 @@ grCamCreateSceneCameraList(class cGrScreen *myscreen, tGrCamHead *cams, tdble fo
|
|||
50.0, /* fovymin */
|
||||
95.0, /* fovymax */
|
||||
0.3, /* near */
|
||||
600.0 * fovFactor, /* far */
|
||||
fixedFar ? fixedFar : 600.0 * fovFactor, /* far */
|
||||
300.0 * fovFactor, /* fogstart */
|
||||
600.0 * fovFactor /* fogend */
|
||||
fixedFar ? fixedFar : 600.0 * fovFactor /* fogend */
|
||||
);
|
||||
cam->add(&cams[c]);
|
||||
id++;
|
||||
|
@ -1550,9 +1551,9 @@ grCamCreateSceneCameraList(class cGrScreen *myscreen, tGrCamHead *cams, tdble fo
|
|||
50.0, /* fovymin */
|
||||
95.0, /* fovymax */
|
||||
0.3, /* near */
|
||||
600.0 * fovFactor, /* far */
|
||||
300.0 * fovFactor, /* fogstart */
|
||||
600.0 * fovFactor /* fogend */
|
||||
fixedFar ? fixedFar : 600.0 * fovFactor, /* far */
|
||||
fixedFar ? fixedFar/2 : 300.0 * fovFactor, /* fogstart */
|
||||
fixedFar ? fixedFar : 600.0 * fovFactor /* fogend */
|
||||
);
|
||||
cam->add(&cams[c]);
|
||||
id++;
|
||||
|
@ -1568,9 +1569,9 @@ grCamCreateSceneCameraList(class cGrScreen *myscreen, tGrCamHead *cams, tdble fo
|
|||
6.0, /* dist */
|
||||
2.0, /* height */
|
||||
1.0, /* near */
|
||||
600.0 * fovFactor, /* far */
|
||||
300.0 * fovFactor, /* fogstart */
|
||||
600.0 * fovFactor, /* fogend */
|
||||
fixedFar ? fixedFar : 600.0 * fovFactor, /* far */
|
||||
fixedFar ? fixedFar/2 : 300.0 * fovFactor, /* fogstart */
|
||||
fixedFar ? fixedFar : 600.0 * fovFactor, /* fogend */
|
||||
0.0 /* relaxation */
|
||||
);
|
||||
cam->add(&cams[c]);
|
||||
|
@ -1587,9 +1588,9 @@ grCamCreateSceneCameraList(class cGrScreen *myscreen, tGrCamHead *cams, tdble fo
|
|||
10.0, /* dist */
|
||||
2.0, /* height */
|
||||
1.0, /* near */
|
||||
600.0 * fovFactor, /* far */
|
||||
300.0 * fovFactor, /* fogstart */
|
||||
600.0 * fovFactor, /* fogend */
|
||||
fixedFar ? fixedFar : 600.0 * fovFactor, /* far */
|
||||
fixedFar ? fixedFar/2 : 300.0 * fovFactor, /* fogstart */
|
||||
fixedFar ? fixedFar : 600.0 * fovFactor, /* fogend */
|
||||
25.0 /* relaxation */
|
||||
);
|
||||
cam->add(&cams[c]);
|
||||
|
@ -1611,9 +1612,9 @@ grCamCreateSceneCameraList(class cGrScreen *myscreen, tGrCamHead *cams, tdble fo
|
|||
20.0, /* dist */
|
||||
4.0, /* height */
|
||||
1.0, /* near */
|
||||
600.0 * fovFactor, /* far */
|
||||
300.0 * fovFactor, /* fogstart */
|
||||
600.0 * fovFactor, /* fogend */
|
||||
fixedFar ? fixedFar : 600.0 * fovFactor, /* far */
|
||||
fixedFar ? fixedFar/2 : 300.0 * fovFactor, /* fogstart */
|
||||
fixedFar ? fixedFar : 600.0 * fovFactor, /* fogend */
|
||||
15.0 /* relaxation */
|
||||
);
|
||||
cam->add(&cams[c]);
|
||||
|
@ -1629,9 +1630,9 @@ grCamCreateSceneCameraList(class cGrScreen *myscreen, tGrCamHead *cams, tdble fo
|
|||
95.0, /* fovymax */
|
||||
30.0, /* dist */
|
||||
1.0, /* near */
|
||||
1000.0 * fovFactor, /* far */
|
||||
500.0 * fovFactor, /* fogstart */
|
||||
1000.0 * fovFactor /* fogend */
|
||||
fixedFar ? fixedFar : 1000.0 * fovFactor, /* far */
|
||||
fixedFar ? fixedFar/2 : 500.0 * fovFactor, /* fogstart */
|
||||
fixedFar ? fixedFar : 1000.0 * fovFactor /* fogend */
|
||||
);
|
||||
cam->add(&cams[c]);
|
||||
id++;
|
||||
|
@ -1647,9 +1648,9 @@ grCamCreateSceneCameraList(class cGrScreen *myscreen, tGrCamHead *cams, tdble fo
|
|||
8.0, /* dist */
|
||||
.50, /* height */
|
||||
.50, /* near */
|
||||
600.0 * fovFactor, /* far */
|
||||
300.0 * fovFactor, /* fogstart */
|
||||
600.0 * fovFactor /* fogend */
|
||||
fixedFar ? fixedFar : 600.0 * fovFactor, /* far */
|
||||
fixedFar ? fixedFar/2 : 300.0 * fovFactor, /* fogstart */
|
||||
fixedFar ? fixedFar : 600.0 * fovFactor /* fogend */
|
||||
);
|
||||
cam->add(&cams[c]);
|
||||
id++;
|
||||
|
@ -1664,9 +1665,9 @@ grCamCreateSceneCameraList(class cGrScreen *myscreen, tGrCamHead *cams, tdble fo
|
|||
95.0, /* fovymax */
|
||||
8.0, /* dist */
|
||||
0.5, /* near */
|
||||
1000.0 * fovFactor, /* far */
|
||||
500.0 * fovFactor, /* fogstart */
|
||||
1000.0 * fovFactor /* fogend */
|
||||
fixedFar ? fixedFar : 1000.0 * fovFactor, /* far */
|
||||
fixedFar ? fixedFar/2 : 500.0 * fovFactor, /* fogstart */
|
||||
fixedFar ? fixedFar : 1000.0 * fovFactor /* fogend */
|
||||
);
|
||||
cam->add(&cams[c]);
|
||||
|
||||
|
@ -1687,9 +1688,9 @@ grCamCreateSceneCameraList(class cGrScreen *myscreen, tGrCamHead *cams, tdble fo
|
|||
-20.0, /* disty */
|
||||
3.0, /* distz */
|
||||
1.0, /* near */
|
||||
1000.0 * fovFactor, /* far */
|
||||
500.0 * fovFactor, /* fogstart */
|
||||
1000.0 * fovFactor /* fogend */
|
||||
fixedFar ? fixedFar : 1000.0 * fovFactor, /* far */
|
||||
fixedFar ? fixedFar/2 : 500.0 * fovFactor, /* fogstart */
|
||||
fixedFar ? fixedFar : 1000.0 * fovFactor /* fogend */
|
||||
);
|
||||
cam->add(&cams[c]);
|
||||
id++;
|
||||
|
@ -1706,9 +1707,9 @@ grCamCreateSceneCameraList(class cGrScreen *myscreen, tGrCamHead *cams, tdble fo
|
|||
20.0, /* disty */
|
||||
3.0, /* distz */
|
||||
1.0, /* near */
|
||||
1000.0 * fovFactor, /* far */
|
||||
500.0 * fovFactor, /* fogstart */
|
||||
1000.0 * fovFactor /* fogend */
|
||||
fixedFar ? fixedFar : 1000.0 * fovFactor, /* far */
|
||||
fixedFar ? fixedFar/2 : 500.0 * fovFactor, /* fogstart */
|
||||
fixedFar ? fixedFar : 1000.0 * fovFactor /* fogend */
|
||||
);
|
||||
cam->add(&cams[c]);
|
||||
id++;
|
||||
|
@ -1725,9 +1726,9 @@ grCamCreateSceneCameraList(class cGrScreen *myscreen, tGrCamHead *cams, tdble fo
|
|||
0.0, /* disty */
|
||||
3.0, /* distz */
|
||||
1.0, /* near */
|
||||
1000.0 * fovFactor, /* far */
|
||||
500.0 * fovFactor, /* fogstart */
|
||||
1000.0 * fovFactor /* fogend */
|
||||
fixedFar ? fixedFar : 1000.0 * fovFactor, /* far */
|
||||
fixedFar ? fixedFar/2 : 500.0 * fovFactor, /* fogstart */
|
||||
fixedFar ? fixedFar : 1000.0 * fovFactor /* fogend */
|
||||
);
|
||||
cam->add(&cams[c]);
|
||||
id++;
|
||||
|
@ -1744,9 +1745,9 @@ grCamCreateSceneCameraList(class cGrScreen *myscreen, tGrCamHead *cams, tdble fo
|
|||
0.0, /* disty */
|
||||
3.0, /* distz */
|
||||
1.0, /* near */
|
||||
1000.0 * fovFactor, /* far */
|
||||
500.0 * fovFactor, /* fogstart */
|
||||
1000.0 * fovFactor /* fogend */
|
||||
fixedFar ? fixedFar : 1000.0 * fovFactor, /* far */
|
||||
fixedFar ? fixedFar/2 : 500.0 * fovFactor, /* fogstart */
|
||||
fixedFar ? fixedFar : 1000.0 * fovFactor /* fogend */
|
||||
);
|
||||
cam->add(&cams[c]);
|
||||
id++;
|
||||
|
@ -1763,9 +1764,9 @@ grCamCreateSceneCameraList(class cGrScreen *myscreen, tGrCamHead *cams, tdble fo
|
|||
-40.0, /* disty */
|
||||
6.0, /* distz */
|
||||
1.0, /* near */
|
||||
1000.0 * fovFactor, /* far */
|
||||
500.0 * fovFactor, /* fogstart */
|
||||
1000.0 * fovFactor /* fogend */
|
||||
fixedFar ? fixedFar : 1000.0 * fovFactor, /* far */
|
||||
fixedFar ? fixedFar/2 : 500.0 * fovFactor, /* fogstart */
|
||||
fixedFar ? fixedFar : 1000.0 * fovFactor /* fogend */
|
||||
);
|
||||
cam->add(&cams[c]);
|
||||
id++;
|
||||
|
@ -1782,9 +1783,9 @@ grCamCreateSceneCameraList(class cGrScreen *myscreen, tGrCamHead *cams, tdble fo
|
|||
40.0, /* disty */
|
||||
6.0, /* distz */
|
||||
1.0, /* near */
|
||||
1000.0 * fovFactor, /* far */
|
||||
500.0 * fovFactor, /* fogstart */
|
||||
1000.0 * fovFactor /* fogend */
|
||||
fixedFar ? fixedFar : 1000.0 * fovFactor, /* far */
|
||||
fixedFar ? fixedFar/2 : 500.0 * fovFactor, /* fogstart */
|
||||
fixedFar ? fixedFar : 1000.0 * fovFactor /* fogend */
|
||||
);
|
||||
cam->add(&cams[c]);
|
||||
id++;
|
||||
|
@ -1801,9 +1802,9 @@ grCamCreateSceneCameraList(class cGrScreen *myscreen, tGrCamHead *cams, tdble fo
|
|||
0.0, /* disty */
|
||||
6.0, /* distz */
|
||||
1.0, /* near */
|
||||
1000.0 * fovFactor, /* far */
|
||||
500.0 * fovFactor, /* fogstart */
|
||||
1000.0 * fovFactor /* fogend */
|
||||
fixedFar ? fixedFar : 1000.0 * fovFactor, /* far */
|
||||
fixedFar ? fixedFar/2 : 500.0 * fovFactor, /* fogstart */
|
||||
fixedFar ? fixedFar : 1000.0 * fovFactor /* fogend */
|
||||
);
|
||||
cam->add(&cams[c]);
|
||||
id++;
|
||||
|
@ -1820,9 +1821,9 @@ grCamCreateSceneCameraList(class cGrScreen *myscreen, tGrCamHead *cams, tdble fo
|
|||
0.0, /* disty */
|
||||
6.0, /* distz */
|
||||
1.0, /* near */
|
||||
1000.0 * fovFactor, /* far */
|
||||
500.0 * fovFactor, /* fogstart */
|
||||
1000.0 * fovFactor /* fogend */
|
||||
fixedFar ? fixedFar : 1000.0 * fovFactor, /* far */
|
||||
fixedFar ? fixedFar/2 : 500.0 * fovFactor, /* fogstart */
|
||||
fixedFar ? fixedFar : 1000.0 * fovFactor /* fogend */
|
||||
);
|
||||
cam->add(&cams[c]);
|
||||
|
||||
|
@ -1845,9 +1846,9 @@ grCamCreateSceneCameraList(class cGrScreen *myscreen, tGrCamHead *cams, tdble fo
|
|||
0, /* axis */
|
||||
//200.0, /* near */
|
||||
100.0, /* near */
|
||||
1000.0 * fovFactor,/* far */
|
||||
500.0 * fovFactor, /* fogstart */
|
||||
1000.0 * fovFactor /* fogend */
|
||||
fixedFar ? fixedFar : 1000.0 * fovFactor,/* far */
|
||||
fixedFar ? fixedFar/2 : 500.0 * fovFactor, /* fogstart */
|
||||
fixedFar ? fixedFar : 1000.0 * fovFactor /* fogend */
|
||||
);
|
||||
cam->add(&cams[c]);
|
||||
id++;
|
||||
|
@ -1865,9 +1866,9 @@ grCamCreateSceneCameraList(class cGrScreen *myscreen, tGrCamHead *cams, tdble fo
|
|||
250.0, /* distz */
|
||||
1, /* axis */
|
||||
200.0, /* near */
|
||||
1000.0 * fovFactor,/* far */
|
||||
500.0 * fovFactor, /* fogstart */
|
||||
1000.0 * fovFactor /* fogend */
|
||||
fixedFar ? fixedFar : 1000.0 * fovFactor,/* far */
|
||||
fixedFar ? fixedFar/2 : 500.0 * fovFactor, /* fogstart */
|
||||
fixedFar ? fixedFar : 1000.0 * fovFactor /* fogend */
|
||||
);
|
||||
cam->add(&cams[c]);
|
||||
id++;
|
||||
|
@ -1885,9 +1886,9 @@ grCamCreateSceneCameraList(class cGrScreen *myscreen, tGrCamHead *cams, tdble fo
|
|||
350.0, /* distz */
|
||||
2, /* axis */
|
||||
200.0, /* near */
|
||||
1000.0 * fovFactor,/* far */
|
||||
500.0 * fovFactor, /* fogstart */
|
||||
1000.0 * fovFactor /* fogend */
|
||||
fixedFar ? fixedFar : 1000.0 * fovFactor,/* far */
|
||||
fixedFar ? fixedFar/2 : 500.0 * fovFactor, /* fogstart */
|
||||
fixedFar ? fixedFar : 1000.0 * fovFactor /* fogend */
|
||||
);
|
||||
cam->add(&cams[c]);
|
||||
id++;
|
||||
|
@ -1905,9 +1906,9 @@ grCamCreateSceneCameraList(class cGrScreen *myscreen, tGrCamHead *cams, tdble fo
|
|||
400.0, /* distz */
|
||||
3, /* axis */
|
||||
200.0, /* near */
|
||||
1000.0 * fovFactor,/* far */
|
||||
500.0 * fovFactor, /* fogstart */
|
||||
1000.0 * fovFactor /* fogend */
|
||||
fixedFar ? fixedFar : 1000.0 * fovFactor,/* far */
|
||||
fixedFar ? fixedFar/2 : 500.0 * fovFactor, /* fogstart */
|
||||
fixedFar ? fixedFar : 1000.0 * fovFactor /* fogend */
|
||||
);
|
||||
cam->add(&cams[c]);
|
||||
|
||||
|
@ -1926,9 +1927,9 @@ grCamCreateSceneCameraList(class cGrScreen *myscreen, tGrCamHead *cams, tdble fo
|
|||
60.0, /* fovymax */
|
||||
120.0, /* distz */
|
||||
100.0, /* near */
|
||||
1500.0,/* far */
|
||||
10500.0,/* fogstart */
|
||||
20500.0 /* fogend */
|
||||
fixedFar ? fixedFar : 1000.0 * fovFactor,/* far */
|
||||
fixedFar ? fixedFar/2 : 500.0 * fovFactor,/* fogstart */
|
||||
fixedFar ? fixedFar : 1000.0 * fovFactor /* fogend */
|
||||
);
|
||||
cam->add(&cams[c]);
|
||||
|
||||
|
@ -2067,9 +2068,9 @@ grCamCreateSceneCameraList(class cGrScreen *myscreen, tGrCamHead *cams, tdble fo
|
|||
5.0, /* fovymin */
|
||||
60.0, /* fovymax */
|
||||
1.0, /* near */
|
||||
1000.0 * fovFactor,/* far */
|
||||
500.0 * fovFactor, /* fogstart */
|
||||
1000.0 * fovFactor /* fogend */
|
||||
fixedFar ? fixedFar : 1000.0 * fovFactor,/* far */
|
||||
fixedFar ? fixedFar/2 : 500.0 * fovFactor, /* fogstart */
|
||||
fixedFar ? fixedFar : 1000.0 * fovFactor /* fogend */
|
||||
);
|
||||
cam->add(&cams[c]);
|
||||
|
||||
|
@ -2087,9 +2088,9 @@ grCamCreateSceneCameraList(class cGrScreen *myscreen, tGrCamHead *cams, tdble fo
|
|||
1.0, /* fovymin */
|
||||
90.0, /* fovymax */
|
||||
1.0, /* near */
|
||||
1000.0 * fovFactor, /* far */
|
||||
500.0 * fovFactor, /* fogstart */
|
||||
1000.0 * fovFactor /* fogend */
|
||||
fixedFar ? fixedFar : 1000.0 * fovFactor, /* far */
|
||||
fixedFar ? fixedFar/2 : 500.0 * fovFactor, /* fogstart */
|
||||
fixedFar ? fixedFar : 1000.0 * fovFactor /* fogend */
|
||||
);
|
||||
cam->add(&cams[c]);
|
||||
|
||||
|
@ -2107,9 +2108,9 @@ grCamCreateSceneCameraList(class cGrScreen *myscreen, tGrCamHead *cams, tdble fo
|
|||
1.0, /* fovymin */
|
||||
90.0, /* fovymax */
|
||||
1.0, /* near */
|
||||
1000.0 * fovFactor, /* far */
|
||||
500.0 * fovFactor, /* fogstart */
|
||||
1000.0 * fovFactor /* fogend */
|
||||
fixedFar ? fixedFar : 1000.0 * fovFactor, /* far */
|
||||
fixedFar ? fixedFar/2 : 500.0 * fovFactor, /* fogstart */
|
||||
fixedFar ? fixedFar : 1000.0 * fovFactor /* fogend */
|
||||
);
|
||||
cam->add(&cams[c]);
|
||||
|
||||
|
@ -2125,10 +2126,9 @@ grCamCreateSceneCameraList(class cGrScreen *myscreen, tGrCamHead *cams, tdble fo
|
|||
1.0, /* fovymin */
|
||||
90.0, /* fovymax */
|
||||
1.0, /* near */
|
||||
1000.0 * fovFactor, /* far */
|
||||
500.0 * fovFactor, /* fogstart */
|
||||
1000.0 * fovFactor /* fogend */
|
||||
fixedFar ? fixedFar : 1000.0 * fovFactor, /* far */
|
||||
fixedFar ? fixedFar/2 : 500.0 * fovFactor, /* fogstart */
|
||||
fixedFar ? fixedFar : 1000.0 * fovFactor /* fogend */
|
||||
);
|
||||
cam->add(&cams[c]);
|
||||
|
||||
}
|
||||
|
|
|
@ -275,6 +275,9 @@ class cGrCarCamMirror : public cGrPerspCamera
|
|||
#define GR_ZOOM_MIN 3
|
||||
#define GR_ZOOM_DFLT 4
|
||||
|
||||
extern void grCamCreateSceneCameraList(class cGrScreen *myscreen, tGrCamHead *cams, tdble fovFactor);
|
||||
// If fixedFar is not nul, the fovFactor is used for the far clip plane ;
|
||||
// otherwise, fixedFar is used.
|
||||
extern void grCamCreateSceneCameraList(class cGrScreen *myscreen, tGrCamHead *cams,
|
||||
tdble fovFactor, tdble fixedFar = 0);
|
||||
|
||||
#endif /* _GRCAM_H_ */
|
||||
|
|
|
@ -464,19 +464,18 @@ void cGrScreen::loadParams(tSituation *s)
|
|||
/* Create cameras */
|
||||
void cGrScreen::initCams(tSituation *s)
|
||||
{
|
||||
// Get the factor of visibiity from the graphics settings and from the track.
|
||||
tdble fovFactor = GfParmGetNum(grHandle, GR_SCT_GRAPHIC, GR_ATT_FOVFACT, (char*)NULL, 1.0);
|
||||
fovFactor *= GfParmGetNum(grTrackHandle, TRK_SECT_GRAPH, TRK_ATT_FOVFACT, (char*)NULL, 1.0);
|
||||
if (grSkyDomeDistance) {
|
||||
// TODO: Don't roughly overwrite fovFactor with such a huge value without taking care
|
||||
// of graphic/track settings (see the proposal below).
|
||||
fovFactor = (grSkyDomeDistance / 10);
|
||||
|
||||
// TODO: This formula is more consistent, but it prevents the sky dome from being visible.
|
||||
//fovFactor *= grSkyDomeDistance / grSkyDomeNeutralFOVDistance;
|
||||
}
|
||||
GfLogTrace("Screen #%d : Factor of visibility = %.2f\n", id, fovFactor);
|
||||
// If sky dome is enabled, we have a "fixed far" cut plane.
|
||||
// Warning: In theory, 2*grSkyDomeDistance+1 should be enough, but it is not (why ?).
|
||||
const tdble fixedFar = grSkyDomeDistance ? (2.1f * grSkyDomeDistance + 1.0f) : 0;
|
||||
|
||||
if (boardCam == NULL) {
|
||||
GfLogTrace("Screen #%d : FOV = %.2f, Far=%.0f\n", id, fovFactor, fixedFar);
|
||||
|
||||
// Board camera.
|
||||
if (!boardCam) {
|
||||
fakeWidth = (int)((float) scrw * 600 / (float) scrh);
|
||||
if (fakeWidth < 800)
|
||||
fakeWidth = 800;
|
||||
|
@ -485,11 +484,13 @@ void cGrScreen::initCams(tSituation *s)
|
|||
board->setWidth(fakeWidth);
|
||||
}
|
||||
|
||||
if (bgCam == NULL) {
|
||||
// Background camera.
|
||||
if (!bgCam) {
|
||||
bgCam = new cGrBackgroundCam(this);
|
||||
}
|
||||
|
||||
if (mirrorCam == NULL) {
|
||||
// Mirror camera.
|
||||
if (!mirrorCam) {
|
||||
mirrorCam = new cGrCarCamMirror(
|
||||
this,
|
||||
-1,
|
||||
|
@ -499,16 +500,15 @@ void cGrScreen::initCams(tSituation *s)
|
|||
0.0, // fovymin
|
||||
360.0, // fovymax
|
||||
0.3, // near
|
||||
300.0 * fovFactor, // far
|
||||
200.0 * fovFactor, // fogstart
|
||||
300.0 * fovFactor // fogend
|
||||
fixedFar ? fixedFar : 300.0 * fovFactor, // far
|
||||
fixedFar ? 2*fixedFar/3 : 200.0 * fovFactor, // fogstart
|
||||
fixedFar ? fixedFar : 300.0 * fovFactor // fogend
|
||||
);
|
||||
}
|
||||
|
||||
// Scene Cameras
|
||||
memset(cams, 0, sizeof(cams));
|
||||
|
||||
grCamCreateSceneCameraList(this, cams, fovFactor);
|
||||
grCamCreateSceneCameraList(this, cams, fovFactor, fixedFar);
|
||||
|
||||
cars = (tCarElt**)calloc(s->_ncars, sizeof (tCarElt*));
|
||||
for (int i = 0; i < s->_ncars; i++) {
|
||||
|
|
|
@ -146,10 +146,14 @@ LoadGraphicOptions()
|
|||
}
|
||||
}
|
||||
GfuiLabelSetText(ScrHandle, DynamicSkyDomeLabelId, DynamicSkyDomeValues[DynamicSkyDomeIndex]);
|
||||
|
||||
// FOV not taken into account when sky dome enabled.
|
||||
GfuiEnable(ScrHandle, FovEditId, GFUI_DISABLE);
|
||||
}
|
||||
else
|
||||
{
|
||||
ChangeSkyDomeDist(0); // No dynamic time if no sky dome
|
||||
// No dynamic time if no sky dome
|
||||
ChangeSkyDomeDist(0);
|
||||
}
|
||||
|
||||
PrecipDensityIndex = NbPrecipDensityValues - 1; // Default value index, in case file value not found in list.
|
||||
|
@ -229,15 +233,29 @@ ChangeSkyDomeDist(void* vp)
|
|||
snprintf(buf, sizeof(buf), "%d", SkyDomeDistValues[SkyDomeDistIndex]);
|
||||
GfuiLabelSetText(ScrHandle, SkyDomeDistLabelId, buf);
|
||||
|
||||
const bool bLockDynamicSkyDome = SkyDomeDistValues[SkyDomeDistIndex] == 0;
|
||||
if (bLockDynamicSkyDome)
|
||||
// If realistic sky dome not enabled :
|
||||
if (!SkyDomeDistValues[SkyDomeDistIndex])
|
||||
{
|
||||
// Disable dynamic time of day
|
||||
DynamicSkyDomeIndex = 0;
|
||||
ChangeDynamicSkyDome(0);
|
||||
|
||||
// Make it clear that it is
|
||||
GfuiEnable(ScrHandle, DynamicSkyDomeLeftButtonId, GFUI_DISABLE);
|
||||
GfuiEnable(ScrHandle, DynamicSkyDomeRightButtonId, GFUI_DISABLE);
|
||||
|
||||
// Enable FOV editbox
|
||||
GfuiEnable(ScrHandle, FovEditId, GFUI_ENABLE);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Enable changes of dynamic time of day
|
||||
GfuiEnable(ScrHandle, DynamicSkyDomeLeftButtonId, GFUI_ENABLE);
|
||||
GfuiEnable(ScrHandle, DynamicSkyDomeRightButtonId, GFUI_ENABLE);
|
||||
|
||||
// Enable FOV editbox
|
||||
GfuiEnable(ScrHandle, FovEditId, GFUI_DISABLE);
|
||||
}
|
||||
const int nArrowsVisibility = bLockDynamicSkyDome ? GFUI_INVISIBLE : GFUI_VISIBLE;
|
||||
GfuiVisibilitySet(ScrHandle, DynamicSkyDomeLeftButtonId, nArrowsVisibility);
|
||||
GfuiVisibilitySet(ScrHandle, DynamicSkyDomeRightButtonId, nArrowsVisibility);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in a new issue