RigsofRods  2023.09
Soft-body Physics Simulation
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
EngineClass.h
Go to the documentation of this file.
1 
2 namespace Script2Game {
3 
17 {
18 public:
19 
22  float getShiftDownRPM() const;
23  float getShiftUpRPM() const;
24  float getEngineTorque() const;
25  float getDiffRatio() const;
26  float getGearRatio(int pos);
27  int getNumGears() const;
28  int getNumGearsRanges() const;
30 
33  float getEngineInertia() const;
34  char getEngineType() const;
35  bool isElectric() const;
36  bool hasAir() const;
37  bool hasTurbo() const;
38  float getClutchForce() const;
39  float getShiftTime() const;
40  float getClutchTime() const;
41  float getPostShiftTime() const;
42  float getStallRMP() const;
43  float getIdleRPM() const;
44  float getMaxIdleMixture() const;
45  float getMinIdleMixture() const;
46  float getBrakingTorque() const;
48 
51  float getAcc();
52  float getClutch();
53  float getCrankFactor();
54  float getRPM();
55  float getSmoke();
56  float getTorque();
57  float getTurboPSI();
59  int getGear();
60  int getGearRange();
61  bool isRunning();
62  bool hasContact();
63  float getEngineTorque();
64  float getInputShaftRPM();
65  float getDriveRatio();
66  float getEnginePower();
67  float getEnginePower(float rpm);
68  float getTurboPower();
69  float getIdleMixture();
70  float getPrimeMixture();
72  float getAccToHoldRPM();
73  float getWheelSpin();
74 
78  float getPostShiftClock();
79  float getShiftClock();
80  bool isPostShifting();
81  bool isShifting();
82  int getShifTargetGear();
83  float getAutoShiftBehavior();
87 
90  void pushNetworkState(float engine_rpm, float acc, float clutch, int gear, bool running, bool contact, char auto_mode, char auto_select = -1);
91  void setAcc(float val);
92  void autoSetAcc(float val);
93  void setClutch(float clutch);
94  void setRPM(float rpm);
95  void setWheelSpin(float rpm);
96  void setAutoMode(SimGearboxMode mode);
97  void setPrime(bool p);
98  void setHydroPump(float work);
99  void setManualClutch(float val);
100  void setTCaseRatio(float ratio);
101  void toggleContact();
102  void offStart();
103  void startEngine();
104  void stopEngine();
105 
109  void toggleAutoMode();
110  void autoShiftDown();
111  void autoShiftSet(autoswitch mode);
112  void autoShiftUp();
113  void setGear(int v);
114  void setGearRange(int v);
115  void shift(int val);
116  void shiftTo(int val);
117 
119 };
120 
123 
124 } //namespace Script2Game
Script2Game::EngineSimClass::getPostShiftClock
float getPostShiftClock()
Script2Game::EngineSimClass::getEnginePower
float getEnginePower()
Script2Game::EngineSimClass::getShifTargetGear
int getShifTargetGear()
Script2Game::EngineSimClass::getClutchTime
float getClutchTime() const
Time (in seconds) the clutch takes to apply ('engoption' attr #5)
Script2Game::EngineSimClass::getAccToHoldRPM
float getAccToHoldRPM()
estimate required throttle input to hold the current rpm
Script2Game::EngineSimClass::autoShiftDown
void autoShiftDown()
Script2Game::EngineSimClass::getTorque
float getTorque()
Script2Game::EngineSimClass::startEngine
void startEngine()
Quick engine start. Plays sounds.
Script2Game::EngineSimClass::getNumGears
int getNumGears() const
Script2Game::EngineSimClass::getShiftClock
float getShiftClock()
Script2Game::EngineSimClass::autoSetAcc
void autoSetAcc(float val)
Script2Game::EngineSimClass::offStart
void offStart()
Quick start of vehicle engine.
Script2Game::EngineSimClass::isRunning
bool isRunning()
Script2Game::EngineSimClass::setAutoMode
void setAutoMode(SimGearboxMode mode)
Script2Game::EngineSimClass::pushNetworkState
void pushNetworkState(float engine_rpm, float acc, float clutch, int gear, bool running, bool contact, char auto_mode, char auto_select=-1)
Script2Game::EngineSimClass::shiftTo
void shiftTo(int val)
Changes gear to given value. Plays sounds.
Script2Game::EngineSimClass::setWheelSpin
void setWheelSpin(float rpm)
Script2Game::EngineSimClass::getWheelSpin
float getWheelSpin()
Current wheel RPM.
Script2Game::EngineSimClass::getIdleRPM
float getIdleRPM() const
('engoption' attr #8)
Script2Game::EngineSimClass::isPostShifting
bool isPostShifting()
Script2Game::EngineSimClass::getDiffRatio
float getDiffRatio() const
Global gear ratio ('engine' attr #4)
Script2Game::EngineSimClass::hasTurbo
bool hasTurbo() const
Script2Game::EngineSimClass::getGearRatio
float getGearRatio(int pos)
-1=R, 0=N, 1... ('engine' attrs #5[R],#6[N],#7[1]...)
Script2Game::EngineSimClass::getPrimeMixture
float getPrimeMixture()
Script2Game
Pseudo-namespace; it doesn't exist in code or script runtime, only in this documentation.
Definition: AngelImGui_enums.h:7
Script2Game::EngineSimClass::setRPM
void setRPM(float rpm)
Script2Game::EngineSimClass::toggleContact
void toggleContact()
Ignition.
Script2Game::EngineSimClass::getAutoShiftBehavior
float getAutoShiftBehavior()
Script2Game::EngineSimClass::isShifting
bool isShifting()
Script2Game::EngineSimClass::getClutch
float getClutch()
Script2Game::EngineSimClass::getClutchForce
float getClutchForce() const
('engoption' attr #3)
RoR::SimGearboxMode
SimGearboxMode
Definition: Application.h:338
Script2Game::EngineSimClass::setClutch
void setClutch(float clutch)
Script2Game::EngineSimClass::getShiftTime
float getShiftTime() const
Time (in seconds) that it takes to shift ('engoption' attr #4)
Script2Game::EngineSimClass::getEngineTorque
float getEngineTorque() const
Torque in N/m ('engine' attr #3)
Script2Game::EngineSimClass::getTurboPower
float getTurboPower()
Script2Game::EngineSimClass::autoShiftSet
void autoShiftSet(autoswitch mode)
Script2Game::EngineSimClass::hasContact
bool hasContact()
Ignition.
Script2Game::EngineSimClass::getMinIdleMixture
float getMinIdleMixture() const
Minimum throttle to maintain the idle RPM ('engoption' attr #10)
Script2Game::EngineSimClass::getPostShiftTime
float getPostShiftTime() const
Time (in seconds) until full torque is transferred ('engoption' attr #6)
Script2Game::EngineSimClass::hasAir
bool hasAir() const
Script2Game::EngineSimClass::getShiftDownRPM
float getShiftDownRPM() const
Shift down RPM ('engine' attr #1)
Script2Game::EngineSimClass::setAcc
void setAcc(float val)
Script2Game::EngineSimClass::getAutoShift
autoswitch getAutoShift()
Script2Game::EngineSimClass::getIdleMixture
float getIdleMixture()
Script2Game::EngineSimClass::getAcc
float getAcc()
Script2Game::EngineSimClass::shift
void shift(int val)
Changes gear by a relative offset. Plays sounds.
Script2Game::EngineSimClass::getEngineInertia
float getEngineInertia() const
('engoption' attr #1)
Script2Game::EngineSimClass::getStallRMP
float getStallRMP() const
('engoption' attr #7)
Script2Game::EngineSimClass::setTCaseRatio
void setTCaseRatio(float ratio)
Set current transfer case gear (reduction) ratio.
Script2Game::EngineSimClass::setManualClutch
void setManualClutch(float val)
Script2Game::EngineSimClass::getAutoMode
SimGearboxMode getAutoMode()
Script2Game::EngineSimClass::getGearRange
int getGearRange()
Script2Game::EngineSimClass::getTurboPSI
float getTurboPSI()
Script2Game::autoswitch
autoswitch
Binding of RoR::autoswitch, used with Script2Game::EngineClass.
Definition: autoswitch.h:19
Script2Game::EngineSimClass::getEngineType
char getEngineType() const
't' = truck (default), 'c' = car, 'e' = electric car ('engoption' attr #2)
Script2Game::EngineSimClass::getDriveRatio
float getDriveRatio()
Script2Game::EngineSimClass::setGear
void setGear(int v)
low level gear changing (bypasses shifting logic)
Script2Game::EngineSimClass::setHydroPump
void setHydroPump(float work)
Script2Game::EngineSimClass::toggleAutoMode
void toggleAutoMode()
Script2Game::EngineSimClass::getShiftUpRPM
float getShiftUpRPM() const
Shift up RPM ('engine' attr #2)
Script2Game::EngineSimClass::getKickdownDelayCounter
int getKickdownDelayCounter()
Script2Game::EngineSimClass
Binding of RoR::EngineSim; A land vehicle engine + transmission.
Definition: EngineClass.h:16
Script2Game::EngineSimClass::getRPM
float getRPM()
Script2Game::EngineSimClass::getUpshiftDelayCounter
int getUpshiftDelayCounter()
Script2Game::EngineSimClass::getCrankFactor
float getCrankFactor()
Script2Game::EngineSimClass::setPrime
void setPrime(bool p)
Script2Game::EngineSimClass::stopEngine
void stopEngine()
stall engine
Script2Game::EngineSimClass::getGear
int getGear()
Script2Game::EngineSimClass::autoShiftUp
void autoShiftUp()
Script2Game::EngineSimClass::getSmoke
float getSmoke()
Script2Game::EngineSimClass::getNumGearsRanges
int getNumGearsRanges() const
Script2Game::EngineSimClass::isElectric
bool isElectric() const
Script2Game::EngineSimClass::getInputShaftRPM
float getInputShaftRPM()
Script2Game::EngineSimClass::getMaxIdleMixture
float getMaxIdleMixture() const
Maximum throttle to maintain the idle RPM ('engoption' attr #9)
Script2Game::EngineSimClass::getBrakingTorque
float getBrakingTorque() const
Script2Game::EngineSimClass::setGearRange
void setGearRange(int v)
low level gear changing (bypasses shifting logic)