FlightGear next
AIBaseAircraft.cxx
Go to the documentation of this file.
1/*
2 * SPDX-FileName: AIBaseAircraft.cxx
3 * SPDX-FileComment: abstract base class for AI aircraft
4 * SPDX-FileCopyrightText: Written by Stuart Buchanan, started August 2002
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 */
7
8#include "AIBaseAircraft.hxx"
9
10#include <Main/globals.hxx>
11
13 m_gearPos(0.0),
14 m_flapsPos(0.0),
15 m_spoilerPos(0.0),
16 m_speedbrakePos(0.0),
17 m_beaconLight(false),
18 m_cabinLight(false),
19 m_landingLight(false),
20 m_navLight(false),
21 m_strobeLight(false),
22 m_taxiLight(false)
23{
24}
25
27{
29
30 // All gear positions are linked for simplicity
31 tie("gear/gear[0]/position-norm", SGRawValuePointer<double>(&m_gearPos));
32 tie("gear/gear[1]/position-norm", SGRawValuePointer<double>(&m_gearPos));
33 tie("gear/gear[2]/position-norm", SGRawValuePointer<double>(&m_gearPos));
34 tie("gear/gear[3]/position-norm", SGRawValuePointer<double>(&m_gearPos));
35 tie("gear/gear[4]/position-norm", SGRawValuePointer<double>(&m_gearPos));
36 tie("gear/gear[5]/position-norm", SGRawValuePointer<double>(&m_gearPos));
37
38 tie("surface-positions/flap-pos-norm",
39 SGRawValueMethods<FGAIBaseAircraft, double>(*this,
42
43 tie("surface-positions/spoiler-pos-norm",
44 SGRawValueMethods<FGAIBaseAircraft, double>(*this,
47
48 tie("surface-positions/speedbrake-pos-norm",
49 SGRawValueMethods<FGAIBaseAircraft, double>(*this,
52
53 tie("controls/lighting/beacon",
54 SGRawValueMethods<FGAIBaseAircraft, bool>(*this,
57
58 tie("controls/lighting/cabin-lights",
59 SGRawValueMethods<FGAIBaseAircraft, bool>(*this,
62
63 tie("controls/lighting/landing-lights",
64 SGRawValueMethods<FGAIBaseAircraft, bool>(*this,
67
68 tie("controls/lighting/nav-lights",
69 SGRawValueMethods<FGAIBaseAircraft, bool>(*this,
72
73 tie("controls/lighting/strobe",
74 SGRawValueMethods<FGAIBaseAircraft, bool>(*this,
77
78 tie("controls/lighting/taxi-lights",
79 SGRawValueMethods<FGAIBaseAircraft, bool>(*this,
82}
void FlapsPos(double pos)
void CabinLight(bool light)
void bind() override
void LandingLight(bool light)
void NavLight(bool light)
void SpeedBrakePos(double pos)
FGAIBaseAircraft(object_type otype=object_type::otAircraft)
void TaxiLight(bool light)
void StrobeLight(bool light)
void BeaconLight(bool light)
void SpoilerPos(double pos)
FGAIBase(object_type ot, bool enableHot)
Definition AIBase.cxx:146
void tie(const char *aRelPath, const SGRawValue< T > &aRawValue)
Tied-properties helper, record nodes which are tied for easy un-tie-ing.
Definition AIBase.hxx:198
virtual void bind()
Definition AIBase.cxx:713