void initializeFlightPlan();
FGAIFlightPlan* GetFlightPlan() const { return fp; };
void ProcessFlightPlan( double dt, time_t now );
- time_t checkForArrivalTime(const string& wptName);
+ time_t checkForArrivalTime(const std::string& wptName);
void AccelTo(double speed);
void PitchTo(double angle);
#include <Environment/gravity.hxx>
using namespace simgear;
+using std::string;
const double FGAIBallistic::slugs_to_kgs = 14.5939029372;
const double FGAIBallistic::slugs_to_lbs = 32.1740485564;
_ht_agl_ft = pos.getElevationFt() - _elevation_m * SG_METER_TO_FEET;
if (material) {
- const vector<string>& names = material->get_names();
+ const std::vector<string>& names = material->get_names();
_solid = material->get_solid();
_load_resistance = material->get_load_resistance();
_frictionFactor = material->get_friction_factor();
#include "AIManager.hxx"
#include "AIBase.hxx"
-using std::vector;
-using std::list;
-
class FGAIBallistic : public FGAIBase {
public:
void setCollision(bool c);
void setExpiry(bool e);
void setImpact(bool i);
- void setImpactReportNode(const string&);
+ void setImpactReportNode(const std::string&);
void setContentsNode(const SGPropertyNode_ptr);
void setFuseRange(double f);
- void setSMPath(const string&);
+ void setSMPath(const std::string&);
void setSubID(int i);
- void setSubmodel(const string&);
+ void setSubmodel(const std::string&);
void setExternalForce( bool f );
- void setForcePath(const string&);
- void setContentsPath(const string&);
+ void setForcePath(const std::string&);
+ void setContentsPath(const std::string&);
void setForceStabilisation( bool val );
void setGroundOffset(double g);
void setLoadOffset(double l);
bool _slave_load_to_ac;// if true, object will be slaved to the parent ac pos
double _contents_lb; // contents of the object
double _weight_lb; // weight of the object (no contents if appropriate) (lbs)
- string _mat_name;
+ std::string _mat_name;
bool _report_collision; // if true a collision point with AI Objects is calculated
bool _report_impact; // if true an impact point on the terrain is calculated
double _dt_count;
double _next_run;
- string _submodel;
- string _force_path;
- string _contents_path;
+ std::string _submodel;
+ std::string _force_path;
+ std::string _contents_path;
void handle_collision();
void handle_expiry();
const double FGAIBase::e = 2.71828183;
const double FGAIBase::lbs_to_slugs = 0.031080950172; //conversion factor
+using std::string;
using namespace simgear;
+class FGAIModelData : public simgear::SGModelData {
+public:
+ FGAIModelData(SGPropertyNode *root = NULL)
+ : _nasal( new FGNasalModelDataProxy(root) ),
+ _ready(false),
+ _initialized(false)
+ {
+ }
+
+
+ ~FGAIModelData()
+ {
+ }
+
+ /** osg callback, thread-safe */
+ void modelLoaded(const std::string& path, SGPropertyNode *prop, osg::Node *n)
+ {
+ // WARNING: Called in a separate OSG thread! Only use thread-safe stuff here...
+ if (_ready)
+ return;
+
+ _fxpath = prop->getStringValue("sound/path");
+ _nasal->modelLoaded(path, prop, n);
+
+ _ready = true;
+
+ }
+
+ /** init hook to be called after model is loaded.
+ * Not thread-safe. Call from main thread only. */
+ void init(void) { _initialized = true; }
+
+ bool needInitilization(void) { return _ready && !_initialized;}
+ bool isInitialized(void) { return _initialized;}
+ inline std::string& get_sound_path() { return _fxpath;}
+
+private:
+ std::auto_ptr<FGNasalModelDataProxy> _nasal;
+ std::string _fxpath;
+ bool _ready;
+ bool _initialized;
+};
+
FGAIBase::FGAIBase(object_type ot, bool enableHot) :
_max_speed(300),
_name(""),
}
-FGAIModelData::FGAIModelData(SGPropertyNode *root)
- : _nasal( new FGNasalModelDataProxy(root) ),
- _ready(false),
- _initialized(false)
-{
-}
-FGAIModelData::~FGAIModelData()
-{
- delete _nasal;
- _nasal = NULL;
-}
-
-void FGAIModelData::modelLoaded(const string& path, SGPropertyNode *prop, osg::Node *n)
-{
- // WARNING: Called in a separate OSG thread! Only use thread-safe stuff here...
- if (_ready)
- return;
-
- _fxpath = prop->getStringValue("sound/path");
- _nasal->modelLoaded(path, prop, n);
-
- _ready = true;
-}
#include <string>
+#include <osg/LOD>
+
#include <simgear/constants.h>
#include <simgear/scene/model/placement.hxx>
-#include <simgear/scene/model/modellib.hxx>
#include <simgear/misc/sg_path.hxx>
#include <simgear/structure/SGSharedPtr.hxx>
#include <simgear/structure/SGReferenced.hxx>
#include <Main/fg_props.hxx>
-
-using std::string;
-
namespace simgear {
class BVHMaterial;
}
class FGAIManager;
class FGAIFlightPlan;
class FGFX;
-class FGNasalModelDataProxy;
class FGAIModelData; // defined below
void updateLOD();
void setManager(FGAIManager* mgr, SGPropertyNode* p);
void setPath( const char* model );
- void setSMPath( const string& p );
- void setCallSign(const string& );
+ void setSMPath( const std::string& p );
+ void setCallSign(const std::string& );
void setSpeed( double speed_KTAS );
void setAltitude( double altitude_ft );
void setAltitudeAGL( double altitude_agl_ft );
void setImpactLat( double lat );
void setImpactLon( double lon );
void setImpactElev( double e );
- void setParentName(const string& p);
- void setName(const string& n);
+ void setParentName(const std::string& p);
+ void setName(const std::string& n);
void setMaxSpeed(double kts);
void calcRangeBearing(double lat, double lon, double lat2, double lon2,
bool getGroundElevationM(const SGGeod& pos, double& elev,
const simgear::BVHMaterial** material) const;
- double _elevation_m;
double _getCartPosX() const;
double _getCartPosY() const;
double _getCartPosZ() const;
+
+protected:
+ double _elevation_m;
+
double _x_offset;
double _y_offset;
double _z_offset;
-
+
double _pitch_offset;
double _roll_offset;
double _yaw_offset;
-
+
double _max_speed;
-
- string _path;
- string _callsign;
- string _submodel;
+
+ std::string _path;
+ std::string _callsign;
+ std::string _submodel;
std::string _name;
- string _parent;
-
-protected:
+ std::string _parent;
+
/**
* Tied-properties helper, record nodes which are tied for easy un-tie-ing
*/
double rotation; // value used by radar display instrument
double ht_diff; // value used by radar display instrument
- string model_path; //Path to the 3D model
+ std::string model_path; //Path to the 3D model
SGModelPlacement aip;
bool delete_me;
static bool _isNight();
- string & getCallSign();
+ std::string & getCallSign();
};
inline void FGAIBase::setManager(FGAIManager* mgr, SGPropertyNode* p) {
model_path.append(model);
}
-inline void FGAIBase::setSMPath(const string& p) {
+inline void FGAIBase::setSMPath(const std::string& p) {
_path = p;
}
pos.setLatitudeDeg( latitude );
}
-inline void FGAIBase::setCallSign(const string& s) {
+inline void FGAIBase::setCallSign(const std::string& s) {
_callsign = s;
}
-inline string& FGAIBase::getCallSign() {
+inline std::string& FGAIBase::getCallSign() {
return _callsign;
}
_yaw_offset = y;
}
-inline void FGAIBase::setParentName(const string& p) {
+inline void FGAIBase::setParentName(const std::string& p) {
_parent = p;
}
-inline void FGAIBase::setName(const string& n) {
+inline void FGAIBase::setName(const std::string& n) {
_name = n;
}
}
-class FGAIModelData : public simgear::SGModelData {
-public:
- FGAIModelData(SGPropertyNode *root = 0);
- ~FGAIModelData();
-
- /** osg callback, thread-safe */
- void modelLoaded(const string& path, SGPropertyNode *prop, osg::Node *n);
-
- /** init hook to be called after model is loaded.
- * Not thread-safe. Call from main thread only. */
- void init(void) { _initialized = true; }
-
- bool needInitilization(void) { return _ready && !_initialized;}
- bool isInitialized(void) { return _initialized;}
- inline std::string& get_sound_path() { return _fxpath;}
-
-private:
- FGNasalModelDataProxy *_nasal;
- std::string _fxpath;
- bool _ready;
- bool _initialized;
-};
-
#endif // _FG_AIBASE_HXX
#include "AIAircraft.hxx"
using std::cerr;
+using std::string;
FGAIWaypoint::FGAIWaypoint() {
speed = 0;
#include <FDM/LaRCsim/basic_aero.h>
#include <Navaids/navrecord.hxx>
+using std::string;
/* FGAIFlightPlan::create()
* dynamically create a flight plan for AI traffic, based on data provided by the
#include "performancedata.hxx"
using std::iostream;
+using std::string;
/*
void FGAIFlightPlan::evaluateRoutePart(double deplat,
#include "AIAircraft.hxx"
#include "performancedata.hxx"
+using std::string;
// TODO: Use James Turner's createOnGround functions.
bool FGAIFlightPlan::createPushBack(FGAIAircraft *ac,
#include "AIGroundVehicle.hxx"
+using std::string;
+
FGAIGroundVehicle::FGAIGroundVehicle() :
FGAIShip(otGroundVehicle),
#include "AIMultiplayer.hxx"
+using std::string;
// #define SG_DEBUG SG_ALERT
#include "AIShip.hxx"
+using std::string;
FGAIShip::FGAIShip(object_type ot) :
// allow HOT to be enabled
void YawTo(double angle);
void ClimbTo(double altitude);
void TurnTo(double heading);
- void setCurrName(const string&);
- void setNextName(const string&);
- void setPrevName(const string&);
+ void setCurrName(const std::string&);
+ void setNextName(const std::string&);
+ void setPrevName(const std::string&);
void setLeadAngleGain(double g);
void setLeadAngleLimit(double l);
void setLeadAngleProp(double p);
void setServiceable(bool s);
void Run(double dt);
- void setStartTime(const string&);
- void setUntilTime(const string&);
+ void setStartTime(const std::string&);
+ void setUntilTime(const std::string&);
//void setWPPos();
void setWPAlt();
void setXTrackError();
double getRange(double lat, double lon, double lat2, double lon2) const;
double getCourse(double lat, double lon, double lat2, double lon2) const;
double getDaySeconds();
- double processTimeString(const string& time);
+ double processTimeString(const std::string& time);
bool initFlightPlan();
bool advanceFlightPlan (double elapsed_sec, double day_sec);
double _xtrack_error;
double _curr_alt, _prev_alt;
- string _prev_name, _curr_name, _next_name;
- string _path;
- string _start_time, _until_time;
+ std::string _prev_name, _curr_name, _next_name;
+ std::string _path;
+ std::string _start_time, _until_time;
bool _repeat;
bool _fp_init;
#include "AITanker.hxx"
+using std::string;
+
FGAITanker::FGAITanker(FGAISchedule* ref): FGAIAircraft(ref){
}
virtual const char* getTypeString(void) const { return "tanker"; }
- void setTACANChannelID(const string& id);
+ void setTACANChannelID(const std::string& id);
private:
- string TACAN_channel_id; // The TACAN channel of this tanker
+ std::string TACAN_channel_id; // The TACAN channel of this tanker
bool contact; // set if this tanker is within fuelling range
virtual void Run(double dt);
using std::cout;
using std::endl;
+using std::string;
+using std::vector;
const double FGSubmodelMgr::lbs_to_slugs = 0.031080950172;
#include "atc_mgr.hxx"
+using std::string;
+
FGATCManager::FGATCManager() {
controller = 0;
prevController = 0;
#include <AIModel/AIManager.hxx>
using std::endl;
+using std::string;
namespace flightgear
{