]> git.mxchange.org Git - flightgear.git/blob - src/ATC/AIEntity.hxx
Moved some of the low level scene graph construction code over to simgear.
[flightgear.git] / src / ATC / 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., 675 Mass Ave, Cambridge, MA 02139, USA.
20
21 #ifndef _FG_AIEntity_HXX
22 #define _FG_AIEntity_HXX
23
24 #include <plib/sg.h>
25 #include <plib/ssg.h>
26
27 #include <simgear/math/point3d.hxx>
28 #include <simgear/scene/model/model.hxx>
29 #include <simgear/scene/model/placement.hxx>
30
31
32 /*****************************************************************
33 *
34 *  FGAIEntity - this class implements the minimum requirement
35 *  for any AI entity - a position, an orientation, an associated
36 *  3D model, and the ability to be moved.  It does nothing useful
37 *  and all AI entities are expected to be derived from it.
38 *
39 ******************************************************************/
40 class FGAIEntity {
41
42 public:
43
44     virtual ~FGAIEntity();
45
46     // Run the internal calculations
47     virtual void Update(double dt);
48         
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);
52
53 protected:
54
55     Point3D pos;        // WGS84 lat & lon in degrees, elev above sea-level in meters
56     double hdg;         //True heading in degrees
57     double roll;        //degrees
58     double pitch;       //degrees
59
60     char* model_path;   //Path to the 3D model
61     SGModelPlacement aip;
62
63     void Transform();
64 };
65
66 #endif  // _FG_AIEntity_HXX
67