First pass at view frustum culling now operational.
This commit is contained in:
parent
5c03d933a3
commit
fdc94bd13a
3 changed files with 18 additions and 12 deletions
|
@ -1,6 +1,6 @@
|
|||
EXTRA_DIST = runfg.in runfg.bat.in
|
||||
|
||||
bin_PROGRAMS = fg ttest
|
||||
bin_PROGRAMS = fg
|
||||
|
||||
bin_SCRIPTS = runfg runfg.bat
|
||||
|
||||
|
@ -31,10 +31,6 @@ fg_LDADD = \
|
|||
$(top_builddir)/Lib/Debug/libDebug.la \
|
||||
$(top_builddir)/Lib/zlib/libz.la
|
||||
|
||||
ttest_SOURCES = ttest.cxx
|
||||
|
||||
ttest_LDADD = $(top_builddir)/Lib/Math/libMath.la \
|
||||
|
||||
INCLUDES += \
|
||||
-DGLUT \
|
||||
-I$(top_builddir) \
|
||||
|
|
|
@ -72,23 +72,23 @@ void fgVIEW::Update( fgFLIGHT *f ) {
|
|||
scenery.center.y = scenery.next_center.y;
|
||||
scenery.center.z = scenery.next_center.z;
|
||||
|
||||
printf("win_ratio = %.2f\n", win_ratio);
|
||||
// printf("win_ratio = %.2f\n", win_ratio);
|
||||
|
||||
// calculate sin() and cos() of fov / 2 in X direction;
|
||||
theta_x = FG_PI_2 - (o->fov * win_ratio * DEG_TO_RAD) / 2.0;
|
||||
printf("theta_x = %.2f\n", theta_x);
|
||||
theta_x = (o->fov * win_ratio * DEG_TO_RAD) / 2.0;
|
||||
// printf("theta_x = %.2f\n", theta_x);
|
||||
sin_fov_x = sin(theta_x);
|
||||
cos_fov_x = cos(theta_x);
|
||||
slope_x = sin_fov_x / cos_fov_x;
|
||||
printf("slope_x = %.2f\n", slope_x);
|
||||
// printf("slope_x = %.2f\n", slope_x);
|
||||
|
||||
// calculate sin() and cos() of fov / 2 in Y direction;
|
||||
theta_y = FG_PI_2 - (o->fov * DEG_TO_RAD) / 2.0;
|
||||
printf("theta_y = %.2f\n", theta_y);
|
||||
theta_y = (o->fov * DEG_TO_RAD) / 2.0;
|
||||
// printf("theta_y = %.2f\n", theta_y);
|
||||
sin_fov_y = sin(theta_y);
|
||||
cos_fov_y = cos(theta_y);
|
||||
slope_y = sin_fov_y / cos_fov_y;
|
||||
printf("slope_y = %.2f\n", slope_y);
|
||||
// printf("slope_y = %.2f\n", slope_y);
|
||||
|
||||
// calculate the cartesion coords of the current lat/lon/0 elev
|
||||
p.lon = FG_Longitude;
|
||||
|
@ -318,6 +318,9 @@ fgVIEW::~fgVIEW( void ) {
|
|||
|
||||
|
||||
// $Log$
|
||||
// Revision 1.10 1998/05/17 16:59:03 curt
|
||||
// First pass at view frustum culling now operational.
|
||||
//
|
||||
// Revision 1.9 1998/05/16 13:08:37 curt
|
||||
// C++ - ified views.[ch]xx
|
||||
// Shuffled some additional view parameters into the fgVIEW class.
|
||||
|
|
|
@ -69,6 +69,10 @@ public:
|
|||
// slope of view frustum edge in eye space X axis
|
||||
double slope_x;
|
||||
|
||||
// View frustum cull ratio (% of tiles culled ... used for
|
||||
// reporting purposes)
|
||||
double vfc_ratio;
|
||||
|
||||
// absolute view position
|
||||
fgCartesianPoint3d abs_view_pos;
|
||||
|
||||
|
@ -142,6 +146,9 @@ extern fgVIEW current_view;
|
|||
|
||||
|
||||
// $Log$
|
||||
// Revision 1.7 1998/05/17 16:59:04 curt
|
||||
// First pass at view frustum culling now operational.
|
||||
//
|
||||
// Revision 1.6 1998/05/16 13:08:37 curt
|
||||
// C++ - ified views.[ch]xx
|
||||
// Shuffled some additional view parameters into the fgVIEW class.
|
||||
|
|
Loading…
Add table
Reference in a new issue