Rigs of Rods 2026.01
Soft-body Physics Simulation
Loading...
Searching...
No Matches
EngineClass.h
Go to the documentation of this file.
1
2namespace Script2Game {
3
17{
18public:
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();
54 float getRPM();
55 float getSmoke();
56 float getTorque();
57 float getTurboPSI();
58 SimGearboxMode getAutoMode();
59 int getGear();
61 bool isRunning();
62 bool hasContact();
67 float getEnginePower(float rpm);
73 float getWheelSpin();
75
81 bool isShifting();
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);
102 void offStart();
103 void startEngine();
104 void stopEngine();
106
113 void setGear(int v);
114 void setGearRange(int v);
115 void shift(int val);
116 void shiftTo(int val);
118
119};
120
123
124} //namespace Script2Game
Binding of RoR::EngineSim; A land vehicle engine + transmission.
Definition EngineClass.h:17
float getClutchTime() const
Time (in seconds) the clutch takes to apply ('engoption' attr #5)
float getGearRatio(int pos)
-1=R, 0=N, 1... ('engine' attrs #5[R],#6[N],#7[1]...)
float getMaxIdleMixture() const
Maximum throttle to maintain the idle RPM ('engoption' attr #9)
void autoShiftSet(autoswitch mode)
float getIdleRPM() const
('engoption' attr #8)
void stopEngine()
stall engine
void setClutch(float clutch)
bool hasContact()
Ignition.
void shift(int val)
Changes gear by a relative offset. Plays sounds.
void setManualClutch(float val)
void offStart()
Quick start of vehicle engine.
float getEngineInertia() const
('engoption' attr #1)
void setHydroPump(float work)
float getBrakingTorque() const
void setGearRange(int v)
low level gear changing (bypasses shifting logic)
void setGear(int v)
low level gear changing (bypasses shifting logic)
float getShiftDownRPM() const
Shift down RPM ('engine' attr #1)
void setAutoMode(SimGearboxMode mode)
float getAccToHoldRPM()
estimate required throttle input to hold the current rpm
SimGearboxMode getAutoMode()
void pushNetworkState(float engine_rpm, float acc, float clutch, int gear, bool running, bool contact, char auto_mode, char auto_select=-1)
void setRPM(float rpm)
float getDiffRatio() const
Global gear ratio ('engine' attr #4)
float getShiftUpRPM() const
Shift up RPM ('engine' attr #2)
int getNumGearsRanges() const
void startEngine()
Quick engine start. Plays sounds.
char getEngineType() const
't' = truck (default), 'c' = car, 'e' = electric car ('engoption' attr #2)
void toggleContact()
Ignition.
float getPostShiftTime() const
Time (in seconds) until full torque is transferred ('engoption' attr #6)
float getShiftTime() const
Time (in seconds) that it takes to shift ('engoption' attr #4)
void shiftTo(int val)
Changes gear to given value. Plays sounds.
void setAcc(float val)
float getMinIdleMixture() const
Minimum throttle to maintain the idle RPM ('engoption' attr #10)
void setTCaseRatio(float ratio)
Set current transfer case gear (reduction) ratio.
void autoSetAcc(float val)
float getEnginePower(float rpm)
float getStallRMP() const
('engoption' attr #7)
void setWheelSpin(float rpm)
float getWheelSpin()
Current wheel RPM.
float getClutchForce() const
('engoption' attr #3)
float getEngineTorque() const
Torque in N/m ('engine' attr #3)
Pseudo-namespace; it doesn't exist in code or script runtime, only in this documentation.
autoswitch
Binding of RoR::autoswitch, used with Script2Game::EngineClass.
Definition autoswitch.h:20