Requires a SimGear update to get some new SGGeodesy helpers.
# include <config.h>
#endif
-#include <simgear/math/point3d.hxx>
#include <simgear/route/waypoint.hxx>
#include <Main/fg_props.hxx>
#include <Main/globals.hxx>
# 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>
#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>
# include <config.h>
#endif
-#include <simgear/math/point3d.hxx>
#include <Main/fg_props.hxx>
#include <Main/globals.hxx>
#include <Scenery/scenery.hxx>
# include <config.h>
#endif
-#include <simgear/math/point3d.hxx>
#include <Main/fg_props.hxx>
#include <Main/globals.hxx>
#include <Scenery/scenery.hxx>
# include <config.h>
#endif
-#include <simgear/math/point3d.hxx>
#include <Main/fg_props.hxx>
#include <Main/globals.hxx>
#include <Scenery/scenery.hxx>
#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>
#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>
#ifndef _FG_AI_PLANE_HXX
#define _FG_AI_PLANE_HXX
-#include <simgear/math/point3d.hxx>
-
#include "AIEntity.hxx"
#include "ATC.hxx"
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);
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");
#endif
#include <simgear/math/sg_geodesy.hxx>
-#include <simgear/math/point3d.hxx>
#include <simgear/math/polar3d.hxx>
#include <Aircraft/controls.hxx>
#endif
#include <simgear/math/sg_geodesy.hxx>
-#include <simgear/math/point3d.hxx>
#include <simgear/math/polar3d.hxx>
#include <Aircraft/controls.hxx>
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);
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();
#include <string>
-#include <simgear/math/point3d.hxx>
#include <simgear/props/props.hxx>
#include <simgear/structure/subsystem_mgr.hxx>
#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>
#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>
#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>
#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>
using std::vector;
-#include <simgear/math/point3d.hxx>
#include <simgear/props/props.hxx>
#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>
#define _TILEMGR_HXX
#include <simgear/compiler.h>
-#include <simgear/math/point3d.hxx>
#include <simgear/scene/model/location.hxx>
#include <simgear/bucket/newbucket.hxx>
#include <simgear/structure/subsystem_mgr.hxx>
#include <simgear/math/interpolater.hxx>
-#include <simgear/math/point3d.hxx>
// Define a structure containing the global lighting parameters