]> git.mxchange.org Git - flightgear.git/blob - src/Model/acmodel.hxx
Support explicit aircraft interior models.
[flightgear.git] / src / Model / acmodel.hxx
1 // acmodel.hxx - manage a 3D aircraft model.
2 // Written by David Megginson, started 2002.
3 //
4 // This file is in the Public Domain, and comes with no warranty.
5
6 #ifndef __ACMODEL_HXX
7 #define __ACMODEL_HXX 1
8
9 #include <osg/ref_ptr>
10 #include <osg/Group>
11 #include <osg/Switch>
12
13 #include <memory>
14 #include <simgear/structure/subsystem_mgr.hxx>  // for SGSubsystem
15
16
17 // Don't pull in the headers, since we don't need them here.
18 class SGModelPlacement;
19 class FGFX;
20
21 class FGAircraftModel : public SGSubsystem
22 {
23 public:
24
25   FGAircraftModel ();
26   virtual ~FGAircraftModel ();
27
28   virtual void init ();
29   virtual void reinit ();
30   virtual void bind ();
31   virtual void unbind ();
32   virtual void update (double dt);
33   virtual SGModelPlacement * get3DModel() { return _aircraft.get(); }
34   virtual SGVec3d& getVelocity() { return _velocity; }
35
36 private:
37   void deinit ();
38   
39     std::auto_ptr<SGModelPlacement> _aircraft;
40     std::auto_ptr<SGModelPlacement> _interior;
41     
42   SGVec3d _velocity;
43   SGSharedPtr<FGFX>  _fx;
44
45   SGPropertyNode_ptr _speed_n;
46   SGPropertyNode_ptr _speed_e;
47   SGPropertyNode_ptr _speed_d;
48 };
49
50 #endif // __ACMODEL_HXX