X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FAIModel%2FAIGroundVehicle.hxx;h=70c06f290d8946acfecae487e8bb8ffee358cf5f;hb=687be046789e2f509ccf93155456c47f3f463e0c;hp=8547e67d07b07e68494fe45fc6bd1d608a7074d5;hpb=2cdc9f64610396059f6f5840c8288ef8c58a10ac;p=flightgear.git diff --git a/src/AIModel/AIGroundVehicle.hxx b/src/AIModel/AIGroundVehicle.hxx index 8547e67d0..70c06f290 100644 --- a/src/AIModel/AIGroundVehicle.hxx +++ b/src/AIModel/AIGroundVehicle.hxx @@ -1,107 +1,101 @@ -// FGAIGroundVehicle - FGAIShip-derived class creates an AI Ground Vehicle -// by adding a ground following utility -// -// Written by Vivian Meazza, started August 2009. -// - vivian.meazza at lineone.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 -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -#ifndef _FG_AIGROUNDVEHICLE_HXX -#define _FG_AIGROUNDVEHICLE_HXX - -#include -#include -#include -#include - -#include "AIShip.hxx" - -#include "AIManager.hxx" -#include "AIBase.hxx" - -class FGAIGroundVehicle : public FGAIShip { -public: - FGAIGroundVehicle(); - virtual ~FGAIGroundVehicle(); - - virtual void readFromScenario(SGPropertyNode* scFileNode); - virtual void bind(); - virtual void unbind(); - virtual const char* getTypeString(void) const { return "groundvehicle"; } - - bool init(bool search_in_AI_path=false); - -private: - - virtual void reinit() { init(); } - virtual void update (double dt); - - void setNoRoll(bool nr); - void setContactX1offset(double x1); - void setContactX2offset(double x2); - void setXOffset(double x); - void setYOffset(double y); - void setZOffset(double z); - - void setPitchCoeff(double pc); - void setElevCoeff(double ec); - void setTowAngleGain(double g); - void setTowAngleLimit(double l); - void setElevation(double _elevation, double dt, double _elevation_coeff); - void setPitch(double _pitch, double dt, double _pitch_coeff); - void setTowAngle(double _relbrg, double dt, double _towangle_coeff); - void setParentName(const string& p); - void setTrainSpeed(double s, double dt, double coeff); - void setParent(); - void setParentNode(); - void AdvanceFP(); - void setTowSpeed(); - void RunGroundVehicle(double dt); - - bool getGroundElev(SGGeod inpos); - bool getPitch(); - - SGVec3d getCartHitchPosAt(const SGVec3d& off) const; - - void calcRangeBearing(double lat, double lon, double lat2, double lon2, - double &range, double &bearing) const; - double calcRelBearingDeg(double bearing, double heading); - - SGGeod _selectedpos; - - bool _solid; // if true ground is solid for FDMs - double _load_resistance; // ground load resistanc N/m^2 - double _frictionFactor; // dimensionless modifier for Coefficient of Friction - double _elevation, _elevation_coeff; - double _tow_angle_gain, _tow_angle_limit; - double _ht_agl_ft; - double _contact_x1_offset, _contact_x2_offset, _contact_z_offset; - double _pitch, _pitch_coeff, _pitch_deg; - double _speed_coeff, _speed_kt; - double _x_offset, _y_offset; - double _range_ft; - double _relbrg; - double _parent_speed, _parent_x_offset, _parent_y_offset, _parent_z_offset; - double _hitch_x_offset_m, _hitch_y_offset_m, _hitch_z_offset_m; - double _dt_count, _next_run, _break_count; - - const SGMaterial* _material; - SGPropertyNode_ptr _selected_ac; - - string _parent; - -}; - -#endif // FG_AIGROUNDVEHICLE_HXX +// FGAIGroundVehicle - FGAIShip-derived class creates an AI Ground Vehicle +// by adding a ground following utility +// +// Written by Vivian Meazza, started August 2009. +// - vivian.meazza at lineone.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 +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +#ifndef _FG_AIGROUNDVEHICLE_HXX +#define _FG_AIGROUNDVEHICLE_HXX + +#include +#include +#include +#include + +#include "AIShip.hxx" + +#include "AIManager.hxx" +#include "AIBase.hxx" + +class FGAIGroundVehicle : public FGAIShip { +public: + FGAIGroundVehicle(); + virtual ~FGAIGroundVehicle(); + + virtual void readFromScenario(SGPropertyNode* scFileNode); + virtual void bind(); + virtual void unbind(); + virtual const char* getTypeString(void) const { return "groundvehicle"; } + + bool init(bool search_in_AI_path=false); + +private: + + virtual void reinit() { init(); } + virtual void update (double dt); + + void setNoRoll(bool nr); + void setContactX1offset(double x1); + void setContactX2offset(double x2); + void setXOffset(double x); + void setYOffset(double y); + void setZOffset(double z); + + void setPitchCoeff(double pc); + void setElevCoeff(double ec); + void setTowAngleGain(double g); + void setTowAngleLimit(double l); + void setElevation(double _elevation, double dt, double _elevation_coeff); + void setPitch(double _pitch, double dt, double _pitch_coeff); + void setTowAngle(double _relbrg, double dt, double _towangle_coeff); + void setTrainSpeed(double s, double dt, double coeff); + void setParent(); + void AdvanceFP(); + void setTowSpeed(); + void RunGroundVehicle(double dt); + + bool getGroundElev(SGGeod inpos); + bool getPitch(); + + SGVec3d getCartHitchPosAt(const SGVec3d& off) const; + + void calcRangeBearing(double lat, double lon, double lat2, double lon2, + double &range, double &bearing) const; + + SGGeod _selectedpos; + + bool _solid; // if true ground is solid for FDMs + double _load_resistance; // ground load resistanc N/m^2 + double _frictionFactor; // dimensionless modifier for Coefficient of Friction + double _elevation, _elevation_coeff; + double _tow_angle_gain, _tow_angle_limit; + double _ht_agl_ft; + double _contact_x1_offset, _contact_x2_offset, _contact_z_offset; + double _pitch, _pitch_coeff, _pitch_deg; + double _speed_coeff, _speed_kt; + double _x_offset, _y_offset; + double _range_ft; + double _relbrg; + double _parent_speed, _parent_x_offset, _parent_y_offset, _parent_z_offset; + double _hitch_x_offset_m, _hitch_y_offset_m, _hitch_z_offset_m; + double _dt_count, _next_run, _break_count; + + const SGMaterial* _material; + +}; + +#endif // FG_AIGROUNDVEHICLE_HXX