RigsofRods
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 
13 {
17  TWO,
18  ONE,
20 };
21 
27 {
28 public:
29 
32  float getShiftDownRPM() const;
33  float getShiftUpRPM() const;
34  float getEngineTorque() const;
35  float getDiffRatio() const;
36  float getGearRatio(int pos);
37  int getNumGears() const;
38  int getNumGearsRanges() const;
40 
43  float getEngineInertia() const;
44  char getEngineType() const;
45  bool isElectric() const;
46  bool hasAir() const;
47  bool hasTurbo() const;
48  float getClutchForce() const;
49  float getShiftTime() const;
50  float getClutchTime() const;
51  float getPostShiftTime() const;
52  float getStallRMP() const;
53  float getIdleRPM() const;
54  float getMaxIdleMixture() const;
55  float getMinIdleMixture() const;
56  float getBrakingTorque() const;
58 
61  float getAcc();
62  float getClutch();
63  float getCrankFactor();
64  float getRPM();
65  float getSmoke();
66  float getTorque();
67  float getTurboPSI();
69  int getGear();
70  int getGearRange();
71  bool isRunning();
72  bool hasContact();
73  float getEngineTorque();
74  float getInputShaftRPM();
75  float getDriveRatio();
76  float getEnginePower();
77  float getEnginePower(float rpm);
78  float getTurboPower();
79  float getIdleMixture();
80  float getPrimeMixture();
82  float getAccToHoldRPM();
83  float getWheelSpin();
84 
88  float getPostShiftClock();
89  float getShiftClock();
90  bool isPostShifting();
91  bool isShifting();
92  int getShifTargetGear();
93  float getAutoShiftBehavior();
97 
100  void pushNetworkState(float engine_rpm, float acc, float clutch, int gear, bool running, bool contact, char auto_mode, char auto_select = -1);
101  void setAcc(float val);
102  void autoSetAcc(float val);
103  void setClutch(float clutch);
104  void setRPM(float rpm);
105  void setWheelSpin(float rpm);
106  void setAutoMode(SimGearboxMode mode);
107  void setPrime(bool p);
108  void setHydroPump(float work);
109  void setManualClutch(float val);
110  void setTCaseRatio(float ratio);
111  void toggleContact();
112  void offStart();
113  void startEngine();
114  void stopEngine();
115 
119  void toggleAutoMode();
120  void autoShiftDown();
121  void autoShiftSet(autoswitch mode);
122  void autoShiftUp();
123  void setGear(int v);
124  void setGearRange(int v);
125  void shift(int val);
126  void shiftTo(int val);
127 
129 };
130 
133 
134 } //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::TWO
@ TWO
Definition: EngineClass.h:17
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: BeamClass.h:2
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:197
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::ONE
@ ONE
Definition: EngineClass.h:18
Script2Game::MANUALMODE
@ MANUALMODE
Definition: EngineClass.h:19
Script2Game::autoswitch
autoswitch
Definition: EngineClass.h:12
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::DRIVE
@ DRIVE
Definition: EngineClass.h:16
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::REAR
@ REAR
Definition: EngineClass.h:14
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::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:26
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::NEUTRAL
@ NEUTRAL
Definition: EngineClass.h:15
Script2Game::EngineSimClass::setGearRange
void setGearRange(int v)
low level gear changing (bypasses shifting logic)