FlightGear next
AISwiftAircraft.h
Go to the documentation of this file.
1/*
2 * SPDX-FileName: AISwiftAircraft.h
3 * SPDX-FileComment: Derived AIBase class for swift aircraft
4 * SPDX-FileCopyrightText: Written by Lars Toenning <dev@ltoenning.de> started on April 2020
5 * SPDX-FileContributor: Copyright (C) 2020 - swift Project Community / Contributors (http://swift-project.org/)
6 * SPDX-License-Identifier: GPL-2.0-or-later
7 */
8
9#pragma once
10
11#include <string>
12#include <string_view>
13#include <utility>
14
15#include "AIBaseAircraft.hxx"
16
17
19 AircraftTransponder(std::string callsign, int code, bool modeC, bool ident)
20 : callsign(std::move(callsign)), code(code), modeC(modeC), ident(ident)
21 {
22 }
23
24 std::string callsign;
25 int code;
26 bool modeC;
27 bool ident;
28};
29
56
58{
59public:
60 FGAISwiftAircraft(const std::string& callsign, const std::string& modelString);
61 virtual ~FGAISwiftAircraft() = default;
62
63 std::string_view getTypeString() const override { return "swift"; }
64 void update(double dt) override;
65
66 void updatePosition(const SGGeod& position, const SGVec3d& orientation, double groundspeed, bool initPos);
67 double getGroundElevation(const SGGeod& pos) const;
68 void initProps();
69 void setPlaneSurface(const AircraftSurfaces& surfaces);
70 void setPlaneTransponder(const AircraftTransponder& transponder);
71
72private:
73 bool m_initPos = false;
74 // Property Nodes for transponder and parts
75 SGPropertyNode_ptr m_transponderCodeNode;
76 SGPropertyNode_ptr m_transponderCModeNode;
77 SGPropertyNode_ptr m_transponderIdentNode;
78};
FGAIBaseAircraft(object_type otype=object_type::otAircraft)
SGGeod pos
Definition AIBase.hxx:212
void setPlaneSurface(const AircraftSurfaces &surfaces)
void updatePosition(const SGGeod &position, const SGVec3d &orientation, double groundspeed, bool initPos)
void update(double dt) override
std::string_view getTypeString() const override
virtual ~FGAISwiftAircraft()=default
void setPlaneTransponder(const AircraftTransponder &transponder)
FGAISwiftAircraft(const std::string &callsign, const std::string &modelString)
double getGroundElevation(const SGGeod &pos) const
AircraftSurfaces(std::string callsign, double gear, double flaps, double spoilers, double speedBrake, double slats, double wingSweeps, double thrust, double elevator, double rudder, double aileron, bool landingLight, bool taxiLight, bool beaconLight, bool strobeLight, bool navLight, int lightPattern)
std::string callsign
AircraftTransponder(std::string callsign, int code, bool modeC, bool ident)