]> git.mxchange.org Git - flightgear.git/blob - src/ATCDCL/AIEntity.hxx
Port over remaining Point3D usage to the more type and unit safe SG* classes.
[flightgear.git] / src / ATCDCL / AIEntity.hxx
1 // FGAIEntity - abstract base class an artificial intelligence entity
2 //
3 // Written by David Luff, started March 2002.
4 //
5 // Copyright (C) 2002  David C. Luff - david.luff@nottingham.ac.uk
6 //
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.
11 //
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.
16 //
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.
20
21 #ifndef _FG_AIEntity_HXX
22 #define _FG_AIEntity_HXX
23
24 #include <simgear/math/SGMath.hxx>
25 #include <simgear/scene/model/placement.hxx>
26
27 /*****************************************************************
28 *
29 *  FGAIEntity - this class implements the minimum requirement
30 *  for any AI entity - a position, an orientation, an associated
31 *  3D model, and the ability to be moved.  It does nothing useful
32 *  and all AI entities are expected to be derived from it.
33 *
34 ******************************************************************/
35 class FGAIEntity {
36
37 public:
38
39     FGAIEntity();
40     virtual ~FGAIEntity();
41         
42     // Set the 3D model to use (Must be called)
43     void SetModel(osg::Node* model);
44
45     // Run the internal calculations
46     virtual void Update(double dt)=0;
47     
48     // Send a transmission *TO* the AIEntity.
49     // FIXME int code is a hack - eventually this will receive Alexander's coded messages.
50     virtual void RegisterTransmission(int code)=0;
51     
52     const SGGeod& getPos() const
53     { return _pos; }
54     
55     virtual const string& GetCallsign()=0;
56         
57 protected:
58     
59     SGGeod _pos;        // Geodetic position
60     double _hdg;        //True heading in degrees
61     double _roll;       //degrees
62     double _pitch;      //degrees
63
64     SGModelPlacement _aip;
65     double _ground_elevation_m;
66     
67     void Transform();
68 };
69
70 #endif  // _FG_AIEntity_HXX
71