]> git.mxchange.org Git - flightgear.git/commitdiff
Kill off many Point3D includes, and a couple of uses in the HUD code.
authorjmt <jmt>
Fri, 26 Dec 2008 12:28:05 +0000 (12:28 +0000)
committerjmt <jmt>
Fri, 26 Dec 2008 12:28:05 +0000 (12:28 +0000)
Requires a SimGear update to get some new SGGeodesy helpers.

22 files changed:
src/AIModel/AIAircraft.cxx
src/AIModel/AIBallistic.cxx
src/AIModel/AIBase.hxx
src/AIModel/AIStatic.cxx
src/AIModel/AIStorm.cxx
src/AIModel/AIThermal.cxx
src/ATCDCL/AIEntity.cxx
src/ATCDCL/AIPlane.cxx
src/ATCDCL/AIPlane.hxx
src/Cockpit/hud_rwy.cxx
src/FDM/SP/MagicCarpet.cxx
src/FDM/UFO.cxx
src/Instrumentation/HUD/HUD_runway.cxx
src/Instrumentation/adf.hxx
src/Instrumentation/dme.hxx
src/Instrumentation/tacan.hxx
src/Main/fg_init.cxx
src/Main/viewer.cxx
src/Model/model_panel.hxx
src/Scenery/tilemgr.cxx
src/Scenery/tilemgr.hxx
src/Time/light.hxx

index 1ed6f75721e08de0afa068cb46189704a020f65e..6207ffbdafa51ce234ce0f9b8c247b893f50800b 100644 (file)
@@ -22,7 +22,6 @@
 #  include <config.h>
 #endif
 
-#include <simgear/math/point3d.hxx>
 #include <simgear/route/waypoint.hxx>
 #include <Main/fg_props.hxx>
 #include <Main/globals.hxx>
index 0de56a46d63d4578fddc7cb25093941ac6857de7..7b66be4bbb1824080448853cd5c1fbde7650b48b 100644 (file)
@@ -23,7 +23,6 @@
 #  include <config.h>
 #endif
 
-#include <simgear/math/point3d.hxx>
 #include <simgear/math/sg_random.h>
 #include <simgear/math/sg_geodesy.hxx>
 #include <simgear/scene/model/modellib.hxx>
index b67c928787a686c24b301f68d2264a9050b617b3..46d287f732778dd4397f07fb6bf7cf6fccba2057 100644 (file)
@@ -25,7 +25,6 @@
 
 #include <simgear/constants.h>
 #include <simgear/math/SGMath.hxx>
-#include <simgear/math/point3d.hxx>
 #include <simgear/scene/model/placement.hxx>
 #include <simgear/misc/sg_path.hxx>
 #include <simgear/structure/SGSharedPtr.hxx>
index 140325d42a424e3a9eb1effab604c1edd88d69b4..83be7c8d60ded55d3d1e58ed90907dd261dcc927 100644 (file)
@@ -22,7 +22,6 @@
 #  include <config.h>
 #endif
 
-#include <simgear/math/point3d.hxx>
 #include <Main/fg_props.hxx>
 #include <Main/globals.hxx>
 #include <Scenery/scenery.hxx>
index 3220cc773a6e094b356f94f79c1c83a93c4d4cf4..fded8012d9ef85e4ed623c4bd0adb2cda146d860 100644 (file)
@@ -22,7 +22,6 @@
 #  include <config.h>
 #endif
 
-#include <simgear/math/point3d.hxx>
 #include <Main/fg_props.hxx>
 #include <Main/globals.hxx>
 #include <Scenery/scenery.hxx>
index 0f1ee18f569ea0e35dcfea7c9725cf679c6e58b4..e9ad927a137e24fc4aedb4fda5364d63e9200dc1 100644 (file)
@@ -22,7 +22,6 @@
 #  include <config.h>
 #endif
 
-#include <simgear/math/point3d.hxx>
 #include <Main/fg_props.hxx>
 #include <Main/globals.hxx>
 #include <Scenery/scenery.hxx>
index 41baf4a05eebb9c597cdb9222e161e5ec9974fea..f8284c3dbe2149ff331ef1bdde5b21643d07fe75 100644 (file)
@@ -33,7 +33,6 @@
 #include <Main/globals.hxx>
 #include <Scenery/scenery.hxx>
 #include <simgear/constants.h>
-#include <simgear/math/point3d.hxx>
 #include <simgear/math/sg_geodesy.hxx>
 #include <simgear/misc/sg_path.hxx>
 #include <string>
index 5352c1c47d00324497dcbb71dc5290fd515f984d..f3bf43b8c2e8a6618ccead66178b330455844642 100644 (file)
@@ -20,7 +20,6 @@
 
 #include <Main/globals.hxx>
 #include <Main/fg_props.hxx>
-#include <simgear/math/point3d.hxx>
 #include <simgear/debug/logstream.hxx>
 #include <simgear/sound/soundmgr_openal.hxx>
 #include <math.h>
index b29726c39f262ed72866f7eda71a48a41881864c..489ec1793de2d6e39a9232d38f8bc8f9bac35785 100644 (file)
@@ -21,8 +21,6 @@
 #ifndef _FG_AI_PLANE_HXX
 #define _FG_AI_PLANE_HXX
 
-#include <simgear/math/point3d.hxx>
-
 #include "AIEntity.hxx"
 #include "ATC.hxx"
 
index de1b7d2b818cc22afeef5de8943bba3d32c79f44..321d20d3e581afa8a7565e539e3416b267a5fd0b 100644 (file)
@@ -386,12 +386,10 @@ bool runway_instr::boundOutsidePoints(sgdVec3& v, sgdVec3& m)
 
 void runway_instr::drawArrow()
 {
-    Point3D ac(0.0), rwy(0.0);
-    ac.setlat(current_aircraft.fdm_state->get_Latitude_deg());
-    ac.setlon(current_aircraft.fdm_state->get_Longitude_deg());
-    rwy.setlat(runway->latitude());
-    rwy.setlon(runway->longitude());
-    float theta = GetHeadingFromTo(ac, rwy);
+    SGGeod acPos(SGGeod::fromDeg(
+        fgGetDouble("/position/longitude-deg"), 
+        fgGetDouble("/position/latitude-deg")));
+    float theta = SGGeodesy::courseDeg(acPos, runway->geod());
     theta -= fgGetDouble("/orientation/heading-deg");
     theta = -theta;
     glMatrixMode(GL_MODELVIEW);
@@ -419,13 +417,11 @@ void runway_instr::drawArrow()
 void runway_instr::setLineWidth()
 {
     //Calculate the distance from the runway, A
-    double course, distance;
-    calc_gc_course_dist(Point3D(runway->longitude() * SGD_DEGREES_TO_RADIANS,
-            runway->latitude() * SGD_DEGREES_TO_RADIANS, 0.0),
-            Point3D(current_aircraft.fdm_state->get_Longitude(),
-            current_aircraft.fdm_state->get_Latitude(), 0.0 ),
-            &course, &distance);
-    distance *= SG_METER_TO_NM;
+    SGGeod acPos(SGGeod::fromDeg(
+        fgGetDouble("/position/longitude-deg"), 
+        fgGetDouble("/position/latitude-deg")));
+    double distance = SGGeodesy::distanceNm(acPos, runway->geod());
+    
     //Get altitude above runway, B
     double alt_nm = get_agl();
     static const SGPropertyNode *startup_units_node = fgGetNode("/sim/startup/units");
index f11573edf7000149c16b4510460be924822375e9..558f39ddbc1339838a3ffe38673ba7d97b636a60 100644 (file)
@@ -26,7 +26,6 @@
 #endif
 
 #include <simgear/math/sg_geodesy.hxx>
-#include <simgear/math/point3d.hxx>
 #include <simgear/math/polar3d.hxx>
 
 #include <Aircraft/controls.hxx>
index f566a384f852fbaf804eb6ae89d72f0de83de89f..81b532b5d78459c295ab0ca024ec3caa23f34209 100644 (file)
@@ -26,7 +26,6 @@
 #endif
 
 #include <simgear/math/sg_geodesy.hxx>
-#include <simgear/math/point3d.hxx>
 #include <simgear/math/polar3d.hxx>
 
 #include <Aircraft/controls.hxx>
index d9b77665a1ce93a8e236ac33906d44e8a38968d1..b263150f3c912c5c6d38e7f8b54a32093300c0a3 100644 (file)
@@ -377,12 +377,10 @@ bool HUD::Runway::boundOutsidePoints(sgdVec3& v, sgdVec3& m)
 
 void HUD::Runway::drawArrow()
 {
-    Point3D ac(0.0), rwy(0.0);
-    ac.setlat(current_aircraft.fdm_state->get_Latitude_deg());
-    ac.setlon(current_aircraft.fdm_state->get_Longitude_deg());
-    rwy.setlat(_runway->latitude());
-    rwy.setlon(_runway->longitude());
-    float theta = GetHeadingFromTo(ac, rwy);
+    SGGeod acPos(SGGeod::fromDeg(
+        fgGetDouble("/position/longitude-deg"), 
+        fgGetDouble("/position/latitude-deg")));
+    float theta = SGGeodesy::courseDeg(acPos, _runway->geod());
     theta -= fgGetDouble("/orientation/heading-deg");
     theta = -theta;
     glMatrixMode(GL_MODELVIEW);
@@ -411,13 +409,10 @@ void HUD::Runway::drawArrow()
 void HUD::Runway::setLineWidth()
 {
     //Calculate the distance from the runway, A
-    double course, distance;
-    calc_gc_course_dist(Point3D(_runway->longitude() * SGD_DEGREES_TO_RADIANS,
-            _runway->latitude() * SGD_DEGREES_TO_RADIANS, 0.0),
-            Point3D(current_aircraft.fdm_state->get_Longitude(),
-            current_aircraft.fdm_state->get_Latitude(), 0.0 ),
-            &course, &distance);
-    distance *= SG_METER_TO_NM;
+    SGGeod acPos(SGGeod::fromDeg(
+        fgGetDouble("/position/longitude-deg"), 
+        fgGetDouble("/position/latitude-deg")));
+    double distance = SGGeodesy::distanceNm(acPos, _runway->geod());
     //Get altitude above runway, B
     double alt_nm = _agl->getDoubleValue();
 
index 0feac829db1cd041d842f25722777627d5859de0..41d55671d0c6f393584603eb3b13eae802ffcda5 100644 (file)
@@ -13,7 +13,6 @@
 
 #include <string>
 
-#include <simgear/math/point3d.hxx>
 #include <simgear/props/props.hxx>
 
 #include <simgear/structure/subsystem_mgr.hxx>
index 03ecca231a12152ee5bfe7b0ed3cda174bc3263c..5d9963b10d8466c577d6e55f4de718ed78dbe002 100644 (file)
@@ -7,11 +7,6 @@
 #ifndef __INSTRUMENTS_DME_HXX
 #define __INSTRUMENTS_DME_HXX 1
 
-#ifndef __cplusplus
-# error This library requires C++
-#endif
-
-#include <simgear/math/point3d.hxx>
 #include <simgear/props/props.hxx>
 #include <simgear/structure/subsystem_mgr.hxx>
 
index 2aa0ef6a87806a24e850178231c9c07114b652d3..7c8873aed438ffd2dc0fec3ab60b6144eb002b11 100755 (executable)
@@ -7,11 +7,6 @@
 #ifndef __INSTRUMENTS_TACAN_HXX
 #define __INSTRUMENTS_TACAN_HXX 1
 
-#ifndef __cplusplus
-# error This library requires C++
-#endif
-
-#include <simgear/math/point3d.hxx>
 #include <simgear/props/props.hxx>
 #include <simgear/structure/subsystem_mgr.hxx>
 
index 2bb9b477eb600b4cdd644a5a7fdb4bcef3ed8f6d..bc24739af70825fa1fee7c71af5bf4bd96c7aabf 100644 (file)
@@ -53,7 +53,6 @@
 #include <simgear/debug/logstream.hxx>
 #include <simgear/structure/exception.hxx>
 #include <simgear/structure/event_mgr.hxx>
-#include <simgear/math/point3d.hxx>
 #include <simgear/math/polar3d.hxx>
 #include <simgear/math/sg_geodesy.hxx>
 #include <simgear/misc/sg_path.hxx>
index c0318761930a25788ddc4b62acfb81700ee7ef7e..f2ffd56c9d57a5fae327aae613bc7e6fc6068f45 100644 (file)
@@ -37,7 +37,6 @@
 
 #include <simgear/debug/logstream.hxx>
 #include <simgear/constants.h>
-#include <simgear/math/point3d.hxx>
 #include <simgear/math/polar3d.hxx>
 #include <simgear/math/sg_geodesy.hxx>
 #include <simgear/scene/model/location.hxx>
index 2ee67051a45803535302a54d519e3d18dc21669c..dcf41dd95334a676cf4c0542e165975fcd4e24f4 100644 (file)
@@ -14,7 +14,6 @@
 
 using std::vector;
 
-#include <simgear/math/point3d.hxx>
 #include <simgear/props/props.hxx>
 
 
index 315558e025021bfbe1aef3897cbb6e3927f61bd0..26ce7135a5b1e7640c7e03e3e4521aad77334120 100644 (file)
@@ -32,7 +32,6 @@
 
 #include <simgear/constants.h>
 #include <simgear/debug/logstream.hxx>
-#include <simgear/math/point3d.hxx>
 #include <simgear/math/polar3d.hxx>
 #include <simgear/math/sg_geodesy.hxx>
 #include <simgear/math/vector.hxx>
index 985abb2a588aa7abf77d70ff28c6518e612f1b66..f8e4f4b684394b5f8dcf7f9bd356047cfe88fb3a 100644 (file)
@@ -25,7 +25,6 @@
 #define _TILEMGR_HXX
 
 #include <simgear/compiler.h>
-#include <simgear/math/point3d.hxx>
 #include <simgear/scene/model/location.hxx>
 
 #include <simgear/bucket/newbucket.hxx>
index ab256eed8599cda03b9cb7a9a873ed584b254eb3..09b13baeadc925b2915bdae9fbd28391480d6e8e 100644 (file)
@@ -38,7 +38,6 @@
 
 #include <simgear/structure/subsystem_mgr.hxx>
 #include <simgear/math/interpolater.hxx>
-#include <simgear/math/point3d.hxx>
 
 
 // Define a structure containing the global lighting parameters