From 83ad7988988169ad3de942cd8e9829f6730cadc2 Mon Sep 17 00:00:00 2001 From: curt Date: Wed, 25 Oct 2000 19:46:43 +0000 Subject: [PATCH] Removed references to Point3D from FGViewers interface. --- src/Main/main.cxx | 8 +------- src/Main/viewer.cxx | 7 ++++--- src/Main/viewer.hxx | 7 +++---- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/Main/main.cxx b/src/Main/main.cxx index 7c7b798be..1a372b3bf 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -442,12 +442,6 @@ void fgRenderFrame( void ) { // update the sky dome if ( globals->get_options()->get_skyblend() ) { - sgVec3 zero_elev; - sgSetVec3( zero_elev, - globals->get_current_view()->get_cur_zero_elev().x(), - globals->get_current_view()->get_cur_zero_elev().y(), - globals->get_current_view()->get_cur_zero_elev().z() ); - /* cout << "thesky->repaint() sky_color = " << cur_light_params.sky_color[0] << " " << cur_light_params.sky_color[1] << " " @@ -484,7 +478,7 @@ void fgRenderFrame( void ) { << " moon dec = " << globals->get_ephem()->getMoonDeclination() << endl; */ thesky->reposition( globals->get_current_view()->get_view_pos(), - zero_elev, + globals->get_current_view()->get_zero_elev(), globals->get_current_view()->get_local_up(), cur_fdm_state->get_Longitude(), cur_fdm_state->get_Latitude(), diff --git a/src/Main/viewer.cxx b/src/Main/viewer.cxx index 85401aa29..731a98f52 100644 --- a/src/Main/viewer.cxx +++ b/src/Main/viewer.cxx @@ -170,7 +170,7 @@ static void print_sgMat4( sgMat4 &in) { // Update the view parameters void FGViewer::update() { - + Point3D tmp; sgVec3 minus_z, forward; sgMat4 VIEWo; @@ -179,7 +179,8 @@ void FGViewer::update() { geod_view_pos[1], sea_level_radius ); - cur_zero_elev = sgPolarToCart3d(p) - scenery.center; + tmp = sgPolarToCart3d(p) - scenery.center; + sgSetVec3( zero_elev, tmp[0], tmp[1], tmp[2] ); // calculate view position in current FG view coordinate system // p.lon & p.lat are already defined earlier, p.radius was set to @@ -190,7 +191,7 @@ void FGViewer::update() { p.setz( p.radius() + scenery.cur_elev + 0.5 * METER_TO_FEET ); } - Point3D tmp = sgPolarToCart3d(p); + tmp = sgPolarToCart3d(p); sgdSetVec3( abs_view_pos, tmp[0], tmp[1], tmp[2] ); sgdVec3 sc; diff --git a/src/Main/viewer.hxx b/src/Main/viewer.hxx index 7bfeb3b6b..a41c4b27b 100644 --- a/src/Main/viewer.hxx +++ b/src/Main/viewer.hxx @@ -31,7 +31,6 @@ #endif #include -#include #include #include @@ -87,7 +86,7 @@ private: // cartesion coordinates of current lon/lat if at sea level // translated to scenery.center - Point3D cur_zero_elev; + sgVec3 zero_elev; // vector in cartesian coordinates from current position to the // postion on the earth's surface the sun is directly over @@ -202,9 +201,9 @@ public: if ( dirty ) { update(); } return view_pos; } - inline Point3D get_cur_zero_elev() { + inline float *get_zero_elev() { if ( dirty ) { update(); } - return cur_zero_elev; + return zero_elev; } inline float *get_surface_south() { if ( dirty ) { update(); } -- 2.39.2