FlightGear next
acmodel.hxx
Go to the documentation of this file.
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#include <simgear/math/SGVec3.hxx>
16
17
18// Don't pull in the headers, since we don't need them here.
19class SGModelPlacement;
20class FGFX;
21
22class FGAircraftModel : public SGSubsystem
23{
24public:
26 virtual ~FGAircraftModel ();
27
28 // Subsystem API.
29 void bind() override;
30 void init() override;
31 void reinit() override;
32 void shutdown() override;
33 void unbind() override;
34 void update(double dt) override;
35
36 // Subsystem identification.
37 static const char* staticSubsystemClassId() { return "aircraft-model"; }
38
39 virtual SGModelPlacement * get3DModel() { return _aircraft.get(); }
40 virtual SGVec3d& getVelocity() { return _velocity; }
41
42private:
43 void deinit ();
44
45 std::unique_ptr<SGModelPlacement> _aircraft;
46 std::unique_ptr<SGModelPlacement> _interior;
47
48 SGVec3d _velocity;
49 SGSharedPtr<FGFX> _fx;
50
51 SGPropertyNode_ptr _speed_n;
52 SGPropertyNode_ptr _speed_e;
53 SGPropertyNode_ptr _speed_d;
54};
55
56#endif // __ACMODEL_HXX
void reinit() override
Definition acmodel.cxx:228
virtual ~FGAircraftModel()
Definition acmodel.cxx:62
virtual SGVec3d & getVelocity()
Definition acmodel.hxx:40
void update(double dt) override
Definition acmodel.cxx:273
void shutdown() override
Definition acmodel.cxx:238
void bind() override
Definition acmodel.cxx:259
static const char * staticSubsystemClassId()
Definition acmodel.hxx:37
virtual SGModelPlacement * get3DModel()
Definition acmodel.hxx:39
void init() override
Definition acmodel.cxx:146
void unbind() override
Definition acmodel.cxx:267
Generator for FlightGear model sound effects.
Definition fg_fx.hxx:48