1
0
Fork 0
flightgear/src/AIModel/AICarrier.hxx

154 lines
4.5 KiB
C++
Raw Normal View History

// FGAICarrier - AIShip-derived class creates an AI aircraft carrier
//
// Written by David Culp, started October 2004.
//
// Copyright (C) 2004 David P. Culp - davidculp2@comcast.net
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 2 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
2006-02-21 01:16:04 +00:00
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ifndef _FG_AICARRIER_HXX
#define _FG_AICARRIER_HXX
#include <string>
#include <list>
Modified Files: configure.ac src/AIModel/AIAircraft.cxx src/AIModel/AIBase.cxx src/AIModel/AIBase.hxx src/AIModel/AICarrier.cxx src/AIModel/AICarrier.hxx src/AIModel/AIManager.cxx src/AIModel/AIManager.hxx src/ATC/AIEntity.cxx src/ATC/AIEntity.hxx src/ATC/AIMgr.cxx src/ATC/AIMgr.hxx src/ATC/ATCdisplay.cxx src/ATC/ATCdisplay.hxx src/Cockpit/cockpit.cxx src/Cockpit/cockpit.hxx src/Cockpit/hud.cxx src/Cockpit/hud.hxx src/Cockpit/hud_rwy.cxx src/Cockpit/panel.cxx src/Cockpit/panel.hxx src/Cockpit/built_in/FGMagRibbon.cxx src/Cockpit/built_in/FGMagRibbon.hxx src/FDM/flight.cxx src/FDM/groundcache.cxx src/FDM/groundcache.hxx src/GUI/gui_funcs.cxx src/Input/input.cxx src/Instrumentation/od_gauge.cxx src/Instrumentation/od_gauge.hxx src/Instrumentation/render_area_2d.cxx src/Instrumentation/render_area_2d.hxx src/Instrumentation/wxradar.cxx src/Instrumentation/wxradar.hxx src/Instrumentation/HUD/HUD.cxx src/Instrumentation/HUD/HUD.hxx src/Instrumentation/HUD/HUD_runway.cxx src/Main/Makefile.am src/Main/main.cxx src/Main/renderer.cxx src/Main/renderer.hxx src/Main/viewmgr.cxx src/Model/acmodel.cxx src/Model/acmodel.hxx src/Model/model_panel.cxx src/Model/model_panel.hxx src/Model/modelmgr.cxx src/Model/modelmgr.hxx src/Model/panelnode.cxx src/Model/panelnode.hxx src/Navaids/awynet.cxx src/Scenery/Makefile.am src/Scenery/hitlist.cxx src/Scenery/hitlist.hxx src/Scenery/newcache.cxx src/Scenery/scenery.cxx src/Scenery/scenery.hxx src/Scenery/tileentry.cxx src/Scenery/tileentry.hxx src/Scenery/tilemgr.cxx src/Scripting/NasalSys.cxx src/Scripting/NasalSys.hxx src/Time/light.cxx Big BLOB on the way to OSG.
2006-10-29 19:30:21 +00:00
#include <simgear/compiler.h>
using std::string;
using std::list;
#include "AIShip.hxx"
#include "AIManager.hxx"
#include "AIBase.hxx"
class FGAIManager;
class FGAICarrier;
class FGAICarrier : public FGAIShip {
public:
FGAICarrier();
virtual ~FGAICarrier();
virtual void readFromScenario(SGPropertyNode* scFileNode);
void setSign(const string& );
void setTACANChannelID(const string &);
virtual void bind();
virtual void unbind();
void UpdateWind ( double dt );
void setWind_from_east( double fps );
void setWind_from_north( double fps );
void setMaxLat( double deg );
void setMinLat( double deg );
void setMaxLong( double deg );
void setMinLong( double deg );
2009-05-04 14:16:00 +00:00
void setMPControl( bool c );
void setAIControl( bool c );
void TurnToLaunch();
2009-05-04 14:16:00 +00:00
void TurnToRecover();
void TurnToBase();
void ReturnToBox();
bool OutsideBox();
bool init(bool search_in_AI_path=false);
virtual const char* getTypeString(void) const { return "carrier"; }
bool getParkPosition(const string& id, SGGeod& geodPos,
double& hdng, SGVec3d& uvw);
private:
/// Is sufficient to be private, stores a possible position to place an
/// aircraft on start
struct ParkPosition {
ParkPosition(const ParkPosition& pp)
: name(pp.name), offset(pp.offset), heading_deg(pp.heading_deg)
{}
ParkPosition(const string& n, const SGVec3d& off = SGVec3d(), double heading = 0)
: name(n), offset(off), heading_deg(heading)
{}
string name;
SGVec3d offset;
double heading_deg;
};
void update(double dt);
double wind_from_east; // fps
double wind_from_north; // fps
double rel_wind_speed_kts;
double rel_wind_from_deg;
2009-05-04 14:16:00 +00:00
list<ParkPosition> ppositions; // List of positions where an aircraft can start.
string sign; // The sign of this carrier.
// these describe the flols
SGVec3d flols_off;
double dist; // the distance of the eyepoint from the flols
double angle;
int source; // the flols light which is visible at the moment
bool wave_off_lights;
2009-05-04 14:16:00 +00:00
bool in_to_wind;
// these are for maneuvering the carrier
2006-06-15 08:29:43 +00:00
SGGeod mOpBoxPos;
double wind_speed_from_north_kts ;
double wind_speed_from_east_kts ;
double wind_speed_kts; //true wind speed
double wind_from_deg; //true wind direction
double rel_wind;
double max_lat, min_lat, max_long, min_long;
double base_course, base_speed;
bool turn_to_launch_hdg;
2009-05-04 14:16:00 +00:00
bool turn_to_recovery_hdg;
bool turn_to_base_course;
bool returning; // set if the carrier is returning to an operating box
bool InToWind(); // set if the carrier is in to wind
2009-12-09 06:44:50 +00:00
bool MPControl, AIControl;
SGPropertyNode_ptr _longitude_node;
SGPropertyNode_ptr _latitude_node;
SGPropertyNode_ptr _altitude_node;
SGPropertyNode_ptr _surface_wind_from_deg_node;
SGPropertyNode_ptr _surface_wind_speed_node;
SGPropertyNode_ptr _launchbar_state_node;
// this is for tacan
string TACAN_channel_id;
// these are for moving the elevators
void UpdateElevator( double dt, double transition_time);
double pos_norm, raw_pos_norm;
double transition_time, time_constant;
bool elevators;
// these are for moving the jet blast deflectors
void UpdateJBD( double dt, double jbd_transition_time);
double jbd_pos_norm, raw_jbd_pos_norm;
double jbd_transition_time, jbd_time_constant;
bool jbd;
};
#endif // _FG_AICARRIER_HXX