2004-09-27 14:24:20 +00:00
|
|
|
// FGAIBallistic.hxx - AIBase derived class creates an AI ballistic object
|
2003-11-28 15:48:05 +00:00
|
|
|
//
|
|
|
|
// Written by David Culp, started November 2003.
|
|
|
|
// - 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
|
|
|
|
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
|
|
|
#ifndef _FG_AIBALLISTIC_HXX
|
|
|
|
#define _FG_AIBALLISTIC_HXX
|
|
|
|
|
|
|
|
#include "AIManager.hxx"
|
|
|
|
#include "AIBase.hxx"
|
|
|
|
|
|
|
|
|
|
|
|
class FGAIBallistic : public FGAIBase {
|
2004-09-22 08:47:05 +00:00
|
|
|
|
2003-11-28 15:48:05 +00:00
|
|
|
public:
|
2004-09-22 08:47:05 +00:00
|
|
|
|
2006-02-11 13:16:56 +00:00
|
|
|
FGAIBallistic();
|
2003-11-28 15:48:05 +00:00
|
|
|
~FGAIBallistic();
|
2004-09-22 08:47:05 +00:00
|
|
|
|
2006-02-11 13:16:56 +00:00
|
|
|
void readFromScenario(SGPropertyNode* scFileNode);
|
|
|
|
|
2003-11-28 15:48:05 +00:00
|
|
|
bool init();
|
2003-12-21 20:12:55 +00:00
|
|
|
virtual void bind();
|
|
|
|
virtual void unbind();
|
2003-11-28 15:48:05 +00:00
|
|
|
void update(double dt);
|
|
|
|
|
|
|
|
void setAzimuth( double az );
|
|
|
|
void setElevation( double el );
|
2004-09-22 08:47:05 +00:00
|
|
|
void setRoll( double rl );
|
2004-10-28 08:29:15 +00:00
|
|
|
void setStabilisation( bool val );
|
2004-08-26 16:25:54 +00:00
|
|
|
void setDragArea( double a );
|
2004-08-30 09:11:59 +00:00
|
|
|
void setLife( double seconds );
|
2004-09-05 09:45:34 +00:00
|
|
|
void setBuoyancy( double fpss );
|
2004-09-08 14:02:25 +00:00
|
|
|
void setWind_from_east( double fps );
|
|
|
|
void setWind_from_north( double fps );
|
|
|
|
void setWind( bool val );
|
2004-09-22 08:47:05 +00:00
|
|
|
void setCd( double c );
|
2004-09-27 14:24:20 +00:00
|
|
|
void setMass( double m );
|
2004-09-08 14:02:25 +00:00
|
|
|
|
|
|
|
double _getTime() const;
|
2004-09-22 08:47:05 +00:00
|
|
|
|
2006-02-11 13:16:56 +00:00
|
|
|
virtual const char* getTypeString(void) const { return "ballistic"; }
|
|
|
|
|
2003-11-28 15:48:05 +00:00
|
|
|
private:
|
|
|
|
|
|
|
|
double azimuth; // degrees true
|
|
|
|
double elevation; // degrees
|
2004-09-22 08:47:05 +00:00
|
|
|
double rotation; // degrees
|
2003-11-28 15:48:05 +00:00
|
|
|
double hs; // horizontal speed (fps)
|
2004-10-28 08:29:15 +00:00
|
|
|
bool aero_stabilised; // if true, object will align wit trajectory
|
2004-08-26 16:25:54 +00:00
|
|
|
double drag_area; // equivalent drag area in ft2
|
2004-08-30 09:11:59 +00:00
|
|
|
double life_timer; // seconds
|
2004-09-08 14:02:25 +00:00
|
|
|
double gravity; // fps2
|
|
|
|
double buoyancy; // fps2
|
|
|
|
double wind_from_east; // fps
|
|
|
|
double wind_from_north; // fps
|
|
|
|
bool wind; // if true, local wind will be applied to object
|
2004-09-22 08:47:05 +00:00
|
|
|
double Cd; // drag coefficient
|
2004-09-27 14:24:20 +00:00
|
|
|
double mass; // slugs
|
2004-09-22 08:47:05 +00:00
|
|
|
|
2003-11-28 15:48:05 +00:00
|
|
|
void Run(double dt);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _FG_AIBALLISTIC_HXX
|
2004-09-27 14:24:20 +00:00
|
|
|
|