#include <simgear/math/polar3d.hxx>
#include <simgear/math/sg_geodesy.hxx>
#include <simgear/misc/sg_path.hxx>
+#include <simgear/scene/material/matlib.hxx>
#ifdef FG_USE_CLOUDS_3D
# include <simgear/sky/clouds3d/SkySceneLoader.hpp>
# include <simgear/sky/clouds3d/SkyUtil.hpp>
#include <FDM/ExternalNet/ExternalNet.hxx>
#include <FDM/ExternalPipe/ExternalPipe.hxx>
#include <FDM/JSBSim/JSBSim.hxx>
-#include <FDM/LaRCsim.hxx>
+#include <FDM/LaRCsim/LaRCsim.hxx>
#include <FDM/MagicCarpet.hxx>
#include <FDM/UFO.hxx>
#include <FDM/NullFDM.hxx>
#include <Include/general.hxx>
#include <Input/input.hxx>
#include <Instrumentation/instrument_mgr.hxx>
-// #include <Joystick/joystick.hxx>
-#include <Objects/matlib.hxx>
#include <Model/acmodel.hxx>
#include <Navaids/fixlist.hxx>
#include <Navaids/ilslist.hxx>
#include <Scripting/scriptmgr.hxx>
#endif
#include <Sound/fg_fx.hxx>
-#include <Sound/soundmgr.hxx>
#include <Systems/system_mgr.hxx>
#include <Time/FGEventMgr.hxx>
#include <Time/light.hxx>
SG_USING_STD(string);
+
+class Sound;
+
extern const char *default_root;
#ifdef FG_USE_CLOUDS_3D
bool fgInitPosition() {
bool set_pos = false;
- // Default to starting on the ground unless one of the other
- // conditions implies an in-air start.
- fgSetBool("/sim/presets/onground", true);
-
// If glideslope is specified, then calculate offset-distance or
// altitude relative to glide slope if either of those was not
// specified.
- fgSetDistOrAltFromGlideSlope();
+ if ( fgGetDouble("/sim/presets/glideslope-deg") > 0.1 ) {
+ fgSetDistOrAltFromGlideSlope();
+ }
+
+ // Select ground or air start depending on if an altitude is
+ // specified (this choice can be refined later based on other
+ // input.)
+ if ( fgGetDouble("/sim/presets/altitude-ft") > -9990.0 ) {
+ fgSetBool("/sim/presets/onground", false);
+ } else {
+ fgSetBool("/sim/presets/onground", true);
+ }
// If we have an explicit, in-range lon/lat, don't change it, just use it.
// If not, check for an airport-id and use that.
if ( !set_pos && !vor.empty() ) {
// a VOR is requested
if ( fgSetPosFromNAV( vor, vor_freq ) ) {
- if ( fgGetDouble("/sim/presets/altitude-ft") > -9990.0 ) {
- fgSetBool("/sim/presets/onground", false);
- } else {
- fgSetBool("/sim/presets/onground", true);
- }
set_pos = true;
}
}
if ( !set_pos && !ndb.empty() ) {
// an NDB is requested
if ( fgSetPosFromNAV( ndb, ndb_freq ) ) {
- if ( fgGetDouble("/sim/presets/altitude-ft") > -9990.0 ) {
- fgSetBool("/sim/presets/onground", false);
- } else {
- fgSetBool("/sim/presets/onground", true);
- }
set_pos = true;
}
}
if ( !set_pos && !fix.empty() ) {
// a Fix is requested
if ( fgSetPosFromFix( fix ) ) {
- if ( fgGetDouble("/sim/presets/altitude-ft") > -9990.0 ) {
- fgSetBool("/sim/presets/onground", false);
- } else {
- fgSetBool("/sim/presets/onground", true);
- }
set_pos = true;
}
}
SGPath mpath( globals->get_fg_root() );
mpath.append( "materials.xml" );
- if ( ! material_lib.load( mpath.str() ) ) {
+ if ( ! globals->get_matlib()->load(globals->get_fg_root(), mpath.str()) ) {
SG_LOG( SG_GENERAL, SG_ALERT, "Error loading material lib!" );
exit(-1);
}
// Initialize the sound subsystem.
////////////////////////////////////////////////////////////////////
- globals->set_soundmgr(new FGSoundMgr);
+ globals->set_soundmgr(new SGSoundMgr);
globals->get_soundmgr()->init();
globals->get_soundmgr()->bind();