Rigs of Rods 2023.09
Soft-body Physics Simulation
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches
AutoPilot.h
Go to the documentation of this file.
1/*
2 This source file is part of Rigs of Rods
3 Copyright 2005-2012 Pierre-Michel Ricordel
4 Copyright 2007-2012 Thomas Fischer
5
6 For more information, see http://www.rigsofrods.org/
7
8 Rigs of Rods is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License version 3, as
10 published by the Free Software Foundation.
11
12 Rigs of Rods is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with Rigs of Rods. If not, see <http://www.gnu.org/licenses/>.
19*/
20
21#pragma once
22
23#include "Application.h"
24#include "RefCountingObject.h"
27
28namespace RoR {
29
32
35
36class Autopilot : public RefCountingObject<Autopilot>
37{
38public:
39 enum
40 {
45 };
46
47 enum
48 {
51 ALT_VS
52 };
53
56
57 Autopilot(int actor_id);
58 void reset();
59 void disconnect();
60 void setInertialReferences(node_t* refl, node_t* refr, node_t* refb, node_t* refc);
61 int toggleHeading(int mode);
62 int toggleAlt(int mode);
63 bool toggleIAS();
64 bool toggleGPWS();
65 int adjHDG(int d);
66 int adjALT(int d);
67 int adjVS(int d);
68 int adjIAS(int d);
69
70 float getAilerons();
71 float getElevator();
72 float getRudder();
73 float getThrottle(float thrtl, float dt);
74
75 void gpws_update(float spawnheight);
76
77 void UpdateIls();
81 int GetHeadingMode() const { return mode_heading; }
82 int GetHeadingValue() const { return heading; }
83 int GetAltMode() const { return mode_alt; }
84 int GetAltValue() const { return alt; }
85 bool GetIasMode() const { return mode_ias; }
86 int GetIasValue() const { return ias; }
87 bool GetGpwsMode() const { return mode_gpws; }
88 int GetVsValue() const { return vs; }
89private:
90
95 int alt;
96 int vs;
97 int ias;
102 float ref_span;
108
116
118};
119
122
123} // namespace RoR
Central state/object manager and communications hub.
Self reference-counting objects, as requred by AngelScript garbage collector.
int toggleHeading(int mode)
float getRudder()
float m_ils_runway_distance
Definition AutoPilot.h:114
void setInertialReferences(node_t *refl, node_t *refr, node_t *refb, node_t *refc)
Definition AutoPilot.cpp:82
int adjALT(int d)
float m_ils_runway_heading
Definition AutoPilot.h:113
int adjIAS(int d)
float getAilerons()
Definition AutoPilot.cpp:91
float last_closest_hdist
Definition AutoPilot.h:115
int GetVsValue() const
Definition AutoPilot.h:88
void gpws_update(float spawnheight)
float GetHorizontalApproachDeviation()
Definition AutoPilot.h:79
node_t * ref_r
Definition AutoPilot.h:99
float last_aileron
Definition AutoPilot.h:104
node_t * ref_c
Definition AutoPilot.h:101
int GetAltValue() const
Definition AutoPilot.h:84
float m_ils_angle_hdev
Definition AutoPilot.h:112
int adjVS(int d)
bool m_vertical_locator_available
Definition AutoPilot.h:109
int GetIasValue() const
Definition AutoPilot.h:86
node_t * ref_b
Definition AutoPilot.h:100
int GetHeadingValue() const
Definition AutoPilot.h:82
bool GetGpwsMode() const
Definition AutoPilot.h:87
bool GetIasMode() const
Definition AutoPilot.h:85
float last_gpws_height
Definition AutoPilot.h:106
int GetAltMode() const
Definition AutoPilot.h:83
bool m_horizontal_locator_available
Definition AutoPilot.h:110
int GetHeadingMode() const
Definition AutoPilot.h:81
float m_ils_angle_vdev
Definition AutoPilot.h:111
float GetVerticalApproachDeviation()
Definition AutoPilot.h:78
float last_elevator
Definition AutoPilot.h:103
float last_pullup_height
Definition AutoPilot.h:107
float getElevator()
bool wantsdisconnect
Definition AutoPilot.h:55
node_t * ref_l
Definition AutoPilot.h:98
int adjHDG(int d)
bool IsIlsAvailable()
Definition AutoPilot.h:80
void disconnect()
Definition AutoPilot.cpp:70
float last_rudder
Definition AutoPilot.h:105
float getThrottle(float thrtl, float dt)
int toggleAlt(int mode)
Physics: A vertex in the softbody structure.
Definition SimData.h:260