1 // FGAIEntity - abstract base class an artificial intelligence entity
3 // Written by David Luff, started March 2002.
5 // Copyright (C) 2002 David C. Luff - david.luff@nottingham.ac.uk
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // General Public License for more details.
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 #ifndef _FG_AIEntity_HXX
22 #define _FG_AIEntity_HXX
24 #include <simgear/math/point3d.hxx>
25 #include <simgear/scene/model/placement.hxx>
28 /*****************************************************************
30 * FGAIEntity - this class implements the minimum requirement
31 * for any AI entity - a position, an orientation, an associated
32 * 3D model, and the ability to be moved. It does nothing useful
33 * and all AI entities are expected to be derived from it.
35 ******************************************************************/
41 virtual ~FGAIEntity();
43 // Set the 3D model to use (Must be called)
44 void SetModel(osg::Node* model);
46 // Run the internal calculations
47 virtual void Update(double dt)=0;
49 // Send a transmission *TO* the AIEntity.
50 // FIXME int code is a hack - eventually this will receive Alexander's coded messages.
51 virtual void RegisterTransmission(int code)=0;
53 inline const Point3D& GetPos() const { return(_pos); }
55 virtual const string& GetCallsign()=0;
59 Point3D _pos; // WGS84 lat & lon in degrees, elev above sea-level in meters
60 double _hdg; //True heading in degrees
61 double _roll; //degrees
62 double _pitch; //degrees
64 char* _model_path; //Path to the 3D model
65 osg::ref_ptr<osg::Node> _model; // Pointer to the model
66 SGModelPlacement _aip;
71 #endif // _FG_AIEntity_HXX