lat_node(fgGetNode("/position/latitude-deg", true)),
alt_node(fgGetNode("/position/altitude-ft", true)),
need_update(true),
+ nav1_freq(0.0),
+ nav1_alt_freq(0.0),
nav1_radial(0.0),
+ nav2_freq(0.0),
+ nav2_alt_freq(0.0),
nav2_radial(0.0),
dme_freq(0.0),
dme_dist(0.0),
dme_prev_dist(0.0),
dme_spd(0.0),
- dme_ete(0.0)
+ dme_ete(0.0),
+ adf_freq(0.0),
+ adf_alt_freq(0.0)
{
SGPath path( globals->get_fg_root() );
SGPath term = path;
// Should already be inlcluded by gl.h if needed by your platform so
// we shouldn't include this here.
// #include <GL/glext.h>
-PFNGLPOINTPARAMETERFEXTPROC glPointParameterfEXT = 0;
-PFNGLPOINTPARAMETERFVEXTPROC glPointParameterfvEXT = 0;
+// PFNGLPOINTPARAMETERFEXTPROC glPointParameterfEXT = 0;
+// PFNGLPOINTPARAMETERFVEXTPROC glPointParameterfvEXT = 0;
float default_attenuation[3] = {1.0, 0.0, 0.0};
//Required for using GL_extensions
void fgLoadDCS (void);
// Main entry point; catch any exceptions that have made it this far.
int main ( int argc, char **argv ) {
- // FIXME: add other, more specific
- // exceptions.
- try {
- mainLoop(argc, argv);
- } catch (sg_throwable &t) {
- SG_LOG(SG_GENERAL, SG_ALERT,
- "Fatal error: " << t.getFormattedMessage()
- << "\n (received from " << t.getOrigin() << ')');
- exit(1);
- }
+
+#ifdef _MSC_VER
+ // Christian, we should document what this does
+ _control87( _EM_INEXACT, _MCW_EM );
+#endif
+
+ // FIXME: add other, more specific
+ // exceptions.
+ try {
+ mainLoop(argc, argv);
+ } catch (sg_throwable &t) {
+ SG_LOG(SG_GENERAL, SG_ALERT,
+ "Fatal error: " << t.getFormattedMessage()
+ << "\n (received from " << t.getOrigin() << ')');
+ exit(1);
+ }
+
+ return 0;
}
SG_LOG( SG_TERRAIN, SG_ALERT, "Cannot open file: " << modelpath.str() );
} else {
while ( ! in1.eof() ) {
- in1 >> skipws;
+ in1 >> ::skipws;
if ( in1.get( c ) && c == '#' ) {
in1 >> skipeol;
} else {
#endif
#include <simgear/debug/logstream.hxx>
+#include <simgear/constants.h>
#include "viewer.hxx"
goal_view_offset(0.0)
{
sgSetVec3( pilot_offset, 0.0, 0.0, 0.0 );
+ sgdZeroVec3(geod_view_pos);
+ sgdZeroVec3(abs_view_pos);
+ sea_level_radius = SG_EQUATORIAL_RADIUS_M;
+ //a reasonable guess for init, so that the math doesn't blow up
}
operator >> ( istream& in, FGILS& i )
{
double f;
- in >> i.ilstype >> i.ilstypename >> i.aptcode >> i.rwyno
+ in >> i.ilstype;
+
+ if ( i.ilstype == '[' )
+ return in;
+
+ in >> i.ilstypename >> i.aptcode >> i.rwyno
>> f >> i.locident >> i.locheading >> i.loclat >> i.loclon
>> i.gselev >> i.gsangle >> i.gslat >> i.gslon
>> i.dmelat >> i.dmelon
first_time = false;
}
- in >> n.type >> n.lat >> n.lon >> n.elev >> f >> n.range
+ in >> n.type;
+
+ if ( n.type == '[' )
+ return in >> skipeol;
+
+ in >> n.lat >> n.lon >> n.elev >> f >> n.range
>> c >> n.ident >> magvar_s;
n.freq = (int)(f*100.0 + 0.5);
sgdXformPnt3( tri[1], leaf->getVertex( i2 ), m );
sgdXformPnt3( tri[2], leaf->getVertex( i3 ), m );
+ //avoid division by zero when two points are the same
+ if ( sgdEqualVec3(tri[0], tri[1]) ||
+ sgdEqualVec3(tri[1], tri[2]) ||
+ sgdEqualVec3(tri[2], tri[0]) ) {
+ continue;
+ }
+
sgdVec4 plane;
sgdMakePlane( plane, tri[0], tri[1], tri[2] );