From fdc94bd13ad378b87fbb8d82a0e7212e9600d474 Mon Sep 17 00:00:00 2001 From: curt Date: Sun, 17 May 1998 16:59:03 +0000 Subject: [PATCH] First pass at view frustum culling now operational. --- Main/Makefile.am | 6 +----- Main/views.cxx | 17 ++++++++++------- Main/views.hxx | 7 +++++++ 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/Main/Makefile.am b/Main/Makefile.am index 2497c22c0..08cc5d65b 100644 --- a/Main/Makefile.am +++ b/Main/Makefile.am @@ -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) \ diff --git a/Main/views.cxx b/Main/views.cxx index d9ac0d6e6..803eb4d89 100644 --- a/Main/views.cxx +++ b/Main/views.cxx @@ -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. diff --git a/Main/views.hxx b/Main/views.hxx index a4c0f580d..d95f9945f 100644 --- a/Main/views.hxx +++ b/Main/views.hxx @@ -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. -- 2.39.2