2008-05-12 10:07:41 +00:00
|
|
|
// FGAIEntity - abstract base class an artificial intelligence entity
|
|
|
|
//
|
|
|
|
// Written by David Luff, started March 2002.
|
|
|
|
//
|
|
|
|
// Copyright (C) 2002 David C. Luff - david.luff@nottingham.ac.uk
|
|
|
|
//
|
|
|
|
// 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_AIEntity_HXX
|
|
|
|
#define _FG_AIEntity_HXX
|
|
|
|
|
2009-03-16 16:37:39 +00:00
|
|
|
#include <simgear/math/SGMath.hxx>
|
2008-05-12 10:07:41 +00:00
|
|
|
#include <simgear/scene/model/placement.hxx>
|
|
|
|
|
|
|
|
/*****************************************************************
|
|
|
|
*
|
|
|
|
* FGAIEntity - this class implements the minimum requirement
|
|
|
|
* for any AI entity - a position, an orientation, an associated
|
|
|
|
* 3D model, and the ability to be moved. It does nothing useful
|
|
|
|
* and all AI entities are expected to be derived from it.
|
|
|
|
*
|
|
|
|
******************************************************************/
|
|
|
|
class FGAIEntity {
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
2009-03-16 16:37:39 +00:00
|
|
|
FGAIEntity();
|
2008-05-12 10:07:41 +00:00
|
|
|
virtual ~FGAIEntity();
|
|
|
|
|
2009-03-16 16:37:39 +00:00
|
|
|
// Set the 3D model to use (Must be called)
|
|
|
|
void SetModel(osg::Node* model);
|
2008-05-12 10:07:41 +00:00
|
|
|
|
|
|
|
// Run the internal calculations
|
|
|
|
virtual void Update(double dt)=0;
|
2009-03-16 16:37:39 +00:00
|
|
|
|
2008-05-12 10:07:41 +00:00
|
|
|
// Send a transmission *TO* the AIEntity.
|
|
|
|
// FIXME int code is a hack - eventually this will receive Alexander's coded messages.
|
|
|
|
virtual void RegisterTransmission(int code)=0;
|
2009-03-16 16:37:39 +00:00
|
|
|
|
|
|
|
const SGGeod& getPos() const
|
|
|
|
{ return _pos; }
|
|
|
|
|
|
|
|
virtual const string& GetCallsign()=0;
|
2008-05-12 10:07:41 +00:00
|
|
|
|
|
|
|
protected:
|
2009-03-16 16:37:39 +00:00
|
|
|
|
|
|
|
SGGeod _pos; // Geodetic position
|
|
|
|
double _hdg; //True heading in degrees
|
2008-05-12 10:07:41 +00:00
|
|
|
double _roll; //degrees
|
|
|
|
double _pitch; //degrees
|
|
|
|
|
|
|
|
SGModelPlacement _aip;
|
2009-03-07 11:29:32 +00:00
|
|
|
double _ground_elevation_m;
|
2009-03-16 16:37:39 +00:00
|
|
|
|
2008-05-12 10:07:41 +00:00
|
|
|
void Transform();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _FG_AIEntity_HXX
|
|
|
|
|