1
0
Fork 0

Kill off many Point3D includes, and a couple of uses in the HUD code.

Requires a SimGear update to get some new SGGeodesy helpers.
This commit is contained in:
jmt 2008-12-26 12:28:05 +00:00
parent 82bfb6a08d
commit 0f4f044a94
22 changed files with 17 additions and 55 deletions

View 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>

View 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>

View 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>

View 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>

View 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>

View 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>

View 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>

View 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>

View 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"

View 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");

View 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>

View 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>

View 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();

View file

@ -13,7 +13,6 @@
#include <string>
#include <simgear/math/point3d.hxx>
#include <simgear/props/props.hxx>
#include <simgear/structure/subsystem_mgr.hxx>

View 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>

View file

@ -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>

View 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>

View 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>

View file

@ -14,7 +14,6 @@
using std::vector;
#include <simgear/math/point3d.hxx>
#include <simgear/props/props.hxx>

View 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>

View 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>

View 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