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
TurboProp.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
25#include "AeroEngine.h"
26#include "SimData.h"
27
28#include <Ogre.h>
29
30namespace RoR {
31
34
37
38class Turboprop: public AeroEngine
39{
40public:
41
43 float pitch;
46
48 ActorPtr a,
49 const char* propname,
50 NodeNum_t nr,
51 NodeNum_t nb,
52 NodeNum_t np1,
53 NodeNum_t np2,
54 NodeNum_t np3,
55 NodeNum_t np4,
56 NodeNum_t tqn,
57 float power,
58 Ogre::String const& propfoilname,
59 bool disable_smoke,
60 bool ispiston,
61 float fpitch
62 );
63 virtual ~Turboprop() override;
64
65 void updateForces(float dt, int doUpdate);
66
67 void setThrottle(float val);
68
69 float getThrottle();
70
71 void reset();
72
73 void toggleReverse();
74 void setReverse(bool val);
75 bool getReverse() { return reverse; };
76
77 void flipStart();
78
79 float getRPM() { return rpm; };
80 float getRPMpc() { return rpm / 10.0f; };
81 void setRPM(float _rpm);
82 float getpropwash() { return propwash; };
83 Ogre::Vector3 getAxis() { return axis; };
84 bool isFailed() { return failed; };
86 bool getIgnition() { return ignition; };
87 void setIgnition(bool val) { ignition = val; };
88 int getNoderef() { return noderef; };
89 NodeNum_t GetFrontNode() const override { return RoR::NODENUM_INVALID; }; // turboprops have no front node
90 NodeNum_t GetBackNode() const override { return nodeback; };
91 bool getWarmup() { return warmup; };
92 float getRadius() { return radius; };
93 float getMaxPower() const { return fullpower; };
94
95 // Visuals
96 void updateVisuals(RoR::GfxActor* gfx_actor) override;
97 void setVisible(bool visible) override;
98
99private:
100
103 float fullpower;
104 float proparea;
106 float timer;
107 float lastflip;
114 float regspeed;
115 Ogre::ParticleSystem* smokePS;
116 Ogre::SceneNode* smokeNode;
117 float twistmap[5];
118 double rotenergy;
120
122 bool warmup;
124 float radius;
125 bool failed;
127 float rpm;
128 float throtle;
129 char debug[256];
130 float propwash;
131 Ogre::Vector3 axis;
135
136 // Attachment
142};
143
146
147} // namespace RoR
Central state/object manager and communications hub.
Core data structures for simulation; Everything affected by by either physics, network or user intera...
Represents an airfoil http://en.wikipedia.org/wiki/Airfoil.
Definition Airfoil.h:32
NodeNum_t torquenode
Definition TurboProp.h:141
float fixed_pitch
Definition TurboProp.h:119
void setIgnition(bool val)
Definition TurboProp.h:87
Ogre::SceneNode * smokeNode
Definition TurboProp.h:116
float max_torque
Definition TurboProp.h:45
bool isFailed()
Definition TurboProp.h:84
Airfoil * airfoil
Definition TurboProp.h:102
float getpropwash()
Definition TurboProp.h:82
NodeNum_t nodep[4]
Definition TurboProp.h:140
NodeNum_t noderef
Definition TurboProp.h:139
float twistmap[5]
Definition TurboProp.h:117
Ogre::Vector3 axis
Definition TurboProp.h:131
void setReverse(bool val)
Ogre::ParticleSystem * smokePS
Definition TurboProp.h:115
bool getWarmup()
Definition TurboProp.h:91
NodeNum_t GetFrontNode() const override
Definition TurboProp.h:89
float getThrottle()
AeroEngineType getType()
Definition TurboProp.h:85
void toggleReverse()
char debug[256]
Definition TurboProp.h:129
virtual ~Turboprop() override
void updateForces(float dt, int doUpdate)
double rotenergy
Definition TurboProp.h:118
bool getReverse()
Definition TurboProp.h:75
float getRPM()
Definition TurboProp.h:79
float indicated_torque
Definition TurboProp.h:44
float maxrevpitch
Definition TurboProp.h:113
bool getIgnition()
Definition TurboProp.h:86
void setVisible(bool visible) override
float fullpower
in kW
Definition TurboProp.h:103
NodeNum_t GetBackNode() const override
Definition TurboProp.h:90
Ogre::Vector3 getAxis()
Definition TurboProp.h:83
void setThrottle(float val)
float warmupstart
Definition TurboProp.h:108
NodeNum_t nodeback
Definition TurboProp.h:138
float getMaxPower() const
Definition TurboProp.h:93
float getRadius()
Definition TurboProp.h:92
ActorPtr m_actor
Definition TurboProp.h:137
void updateVisuals(RoR::GfxActor *gfx_actor) override
void setRPM(float _rpm)
int getNoderef()
Definition TurboProp.h:88
float getRPMpc()
Definition TurboProp.h:80
AeroEngineType
Definition SimData.h:249
static const NodeNum_t NODENUM_INVALID
uint16_t NodeNum_t
Node position within Actor::ar_nodes; use RoR::NODENUM_INVALID as empty value.