]> git.mxchange.org Git - flightgear.git/commitdiff
More view clean ups.
authorcurt <curt>
Wed, 1 Nov 2000 22:40:10 +0000 (22:40 +0000)
committercurt <curt>
Wed, 1 Nov 2000 22:40:10 +0000 (22:40 +0000)
src/Main/options.cxx
src/Main/viewer.hxx
src/Time/moonpos.cxx
src/Time/sunpos.cxx

index 721905fc2954d817d870f4d8fc278bc67c29f34d..d14df1a1fd93cea52167ed670caae88e181486b6 100644 (file)
@@ -263,13 +263,6 @@ FGOptions::toggle_panel() {
          current_panel->setVisibility(true);
     }
 
-    // new rule .. "fov" shouldn't get messed with like this.
-    /* if ( panel_status ) {
-       fov *= 0.4232;
-    } else {
-       fov *= (1.0 / 0.4232);
-    } */
-
     fgReshape( xsize, ysize);
 
     if( !freeze )
index 9a7ea47b13ed0a4735448baa1843396a7f4a2bfd..087b59c75dd23b5d528178b4e0aadba3b5cd2e5b 100644 (file)
@@ -84,20 +84,6 @@ protected:
     // Distances in meters of course.
     sgVec3 pilot_offset;
 
-    // vector in cartesian coordinates from current position to the
-    // postion on the earth's surface the sun is directly over
-    sgVec3 to_sun;
-
-    // surface direction to go to head towards sun
-    sgVec3 surface_to_sun;
-
-    // vector in cartesian coordinates from current position to the
-    // postion on the earth's surface the moon is directly over
-    sgVec3 to_moon;
-  
-    // surface direction to go to head towards moon
-    sgVec3 surface_to_moon;
-
     // surface vector heading south
     sgVec3 surface_south;
 
@@ -209,26 +195,6 @@ public:
        if ( dirty ) { update(); }
        return UP;
     }
-
-    //////////////////////////////////////////////////////////////////////
-    // need to fix these
-    //////////////////////////////////////////////////////////////////////
-    inline float *get_to_sun() { return to_sun; }
-    inline void set_to_sun( float x, float y, float z ) {
-       sgSetVec3( to_sun, x, y, z );
-    }
-    inline float *get_surface_to_sun() { return surface_to_sun; }
-    inline void set_surface_to_sun( float x, float y, float z) {
-       sgSetVec3( surface_to_sun, x, y, z );
-    }
-    inline float *get_to_moon() { return to_moon; }
-    inline void set_to_moon( float x, float y, float z) {
-       sgSetVec3( to_moon, x, y, z );
-    }
-    inline float *get_surface_to_moon() { return surface_to_moon; }
-    inline void set_surface_to_moon( float x, float y, float z) {
-       sgSetVec3( surface_to_moon, x, y, z );
-    }
 };
 
 
index 83b47e15baa612119ec3ca93f05f404aa9c0ddc6..0fb907236d4742ad6f6f8db2dcf24470193cfd5d 100644 (file)
@@ -336,11 +336,18 @@ static void fgMoonPositionGST(double gst, double *lon, double *lat) {
 void fgUpdateMoonPos( void ) {
     fgLIGHT *l;
     FGViewerRPH *v;
-    sgVec3 nup, nmoon, surface_to_moon;
+    sgVec3 nup, nmoon;
     Point3D p, rel_moonpos;
     double dot, east_dot;
     double moon_gd_lat, sl_radius;
 
+    // vector in cartesian coordinates from current position to the
+    // postion on the earth's surface the moon is directly over
+    sgVec3 to_moon;
+  
+    // surface direction to go to head towards moon
+    sgVec3 surface_to_moon;
+
     l = &cur_light_params;
     SGTime *t = globals->get_time_params();
     v = (FGViewerRPH *)globals->get_current_view();
@@ -390,21 +397,19 @@ void fgUpdateMoonPos( void ) {
     // calculate vector to moon's position on the earth's surface
     Point3D vp( v->get_view_pos()[0],
                v->get_view_pos()[1],
-               v->get_view_pos()[1] );
+               v->get_view_pos()[2] );
     rel_moonpos = l->fg_moonpos - ( vp + scenery.center );
-    v->set_to_moon( rel_moonpos.x(), rel_moonpos.y(), rel_moonpos.z() );
+    sgSetVec3( to_moon, rel_moonpos.x(), rel_moonpos.y(), rel_moonpos.z() );
     // printf( "Vector to moon = %.2f %.2f %.2f\n",
-    //         v->to_moon[0], v->to_moon[1], v->to_moon[2]);
+    //         to_moon[0], to_moon[1], to_moon[2]);
 
     // Given a vector from the view position to the point on the
     // earth's surface the moon is directly over, map into onto the
     // local plane representing "horizontal".
 
     sgmap_vec_onto_cur_surface_plane( v->get_world_up(), v->get_view_pos(), 
-                                     v->get_to_moon(), surface_to_moon );
+                                     to_moon, surface_to_moon );
     sgNormalizeVec3(surface_to_moon);
-    v->set_surface_to_moon( surface_to_moon[0], surface_to_moon[1], 
-                           surface_to_moon[2] );
     // cout << "(sg) Surface direction to moon is "
     //   << surface_to_moon[0] << "," 
     //   << surface_to_moon[1] << ","
index 900f502c0c3f0107c731a57897e16e922e7c34ea..1c31b2982e2a8bc6672491e32510682ce4837489 100644 (file)
@@ -244,11 +244,18 @@ static void fgSunPositionGST(double gst, double *lon, double *lat) {
 void fgUpdateSunPos( void ) {
     fgLIGHT *l;
     FGViewerRPH *v;
-    sgVec3 nup, nsun, surface_to_sun;
+    sgVec3 nup, nsun;
     Point3D p, rel_sunpos;
     double dot, east_dot;
     double sun_gd_lat, sl_radius;
 
+    // vector in cartesian coordinates from current position to the
+    // postion on the earth's surface the sun is directly over
+    sgVec3 to_sun;
+
+    // surface direction to go to head towards sun
+    sgVec3 surface_to_sun;
+
     l = &cur_light_params;
     SGTime *t = globals->get_time_params();
     v = (FGViewerRPH *)globals->get_current_view();
@@ -296,9 +303,9 @@ void fgUpdateSunPos( void ) {
     // calculate vector to sun's position on the earth's surface
     Point3D vp( v->get_view_pos()[0],
                v->get_view_pos()[1],
-               v->get_view_pos()[1] );
+               v->get_view_pos()[2] );
     rel_sunpos = l->fg_sunpos - ( vp + scenery.center );
-    v->set_to_sun( rel_sunpos.x(), rel_sunpos.y(), rel_sunpos.z() );
+    sgSetVec3( to_sun, rel_sunpos.x(), rel_sunpos.y(), rel_sunpos.z() );
     // printf( "Vector to sun = %.2f %.2f %.2f\n",
     //         v->to_sun[0], v->to_sun[1], v->to_sun[2]);
 
@@ -307,10 +314,8 @@ void fgUpdateSunPos( void ) {
     // local plane representing "horizontal".
 
     sgmap_vec_onto_cur_surface_plane( v->get_world_up(), v->get_view_pos(),
-                                     v->get_to_sun(), surface_to_sun );
+                                     to_sun, surface_to_sun );
     sgNormalizeVec3(surface_to_sun);
-    v->set_surface_to_sun( surface_to_sun[0], surface_to_sun[1], 
-                          surface_to_sun[2] );
     // cout << "(sg) Surface direction to sun is "
     //   << surface_to_sun[0] << "," 
     //   << surface_to_sun[1] << ","
@@ -318,9 +323,10 @@ void fgUpdateSunPos( void ) {
     // cout << "Should be close to zero = " 
     //   << sgScalarProductVec3(nup, surface_to_sun) << endl;
 
-    // calculate the angle between v->surface_to_sun and
-    // v->surface_east.  We do this so we can sort out the acos()
-    // ambiguity.  I wish I could think of a more efficient way ... :-(
+    // calculate the angle between surface_to_sun and
+    // v->get_surface_east().  We do this so we can sort out the
+    // acos() ambiguity.  I wish I could think of a more efficient
+    // way. :-(
     east_dot = sgScalarProductVec3( surface_to_sun, v->get_surface_east() );
     // cout << "  East dot product = " << east_dot << endl;