Rigs of Rods 2026.01
Soft-body Physics Simulation
Loading...
Searching...
No Matches
Script2Game::EngineClass Class Reference

Description

Binding of RoR::EngineSim; A land vehicle engine + transmission.

Note
Obtain the object using BeamClass::getEngine().

Definition at line 16 of file EngineClass.h.

Public Member Functions

Definition; keyword 'engine'
float getShiftDownRPM () const
 
float getShiftUpRPM () const
 
float getEngineTorque () const
 
float getDiffRatio () const
 
float getGearRatio (int pos)
 
int getNumGears () const
 
int getNumGearsRanges () const
 
Definition, Keyword 'engoption'
float getEngineInertia () const
 
char getEngineType () const
 
bool isElectric () const
 
bool hasAir () const
 
bool hasTurbo () const
 
float getClutchForce () const
 
float getShiftTime () const
 
float getClutchTime () const
 
float getPostShiftTime () const
 
float getStallRMP () const
 
float getIdleRPM () const
 
float getMaxIdleMixture () const
 
float getMinIdleMixture () const
 
float getBrakingTorque () const
 
General state getters
float getAcc ()
 
float getClutch ()
 
float getCrankFactor ()
 
float getRPM ()
 
float getSmoke ()
 
float getTorque ()
 
float getTurboPSI ()
 
SimGearboxMode getAutoMode ()
 
int getGear ()
 
int getGearRange ()
 
bool isRunning ()
 
bool hasContact ()
 
float getEngineTorque ()
 
float getInputShaftRPM ()
 
float getDriveRatio ()
 
float getEnginePower ()
 
float getEnginePower (float rpm)
 
float getTurboPower ()
 
float getIdleMixture ()
 
float getPrimeMixture ()
 
autoswitch getAutoShift ()
 
float getAccToHoldRPM ()
 
float getWheelSpin ()
 
Shifting diagnostic
float getPostShiftClock ()
 
float getShiftClock ()
 
bool isPostShifting ()
 
bool isShifting ()
 
int getShifTargetGear ()
 
float getAutoShiftBehavior ()
 
int getUpshiftDelayCounter ()
 
int getKickdownDelayCounter ()
 
General state changes
void pushNetworkState (float engine_rpm, float acc, float clutch, int gear, bool running, bool contact, char auto_mode, char auto_select=-1)
 
void setAcc (float val)
 
void autoSetAcc (float val)
 
void setClutch (float clutch)
 
void setRPM (float rpm)
 
void setWheelSpin (float rpm)
 
void setAutoMode (SimGearboxMode mode)
 
void setPrime (bool p)
 
void setHydroPump (float work)
 
void setManualClutch (float val)
 
void setTCaseRatio (float ratio)
 
void toggleContact ()
 
void offStart ()
 
void startEngine ()
 
void stopEngine ()
 
Shifting
void toggleAutoMode ()
 
void autoShiftDown ()
 
void autoShiftSet (autoswitch mode)
 
void autoShiftUp ()
 
void setGear (int v)
 
void setGearRange (int v)
 
void shift (int val)
 
void shiftTo (int val)
 

Member Function Documentation

◆ autoSetAcc()

void Script2Game::EngineClass::autoSetAcc ( float  val)

◆ autoShiftDown()

void Script2Game::EngineClass::autoShiftDown ( )

◆ autoShiftSet()

void Script2Game::EngineClass::autoShiftSet ( autoswitch  mode)

◆ autoShiftUp()

void Script2Game::EngineClass::autoShiftUp ( )

◆ getAcc()

float Script2Game::EngineClass::getAcc ( )

◆ getAccToHoldRPM()

float Script2Game::EngineClass::getAccToHoldRPM ( )

estimate required throttle input to hold the current rpm

◆ getAutoMode()

SimGearboxMode Script2Game::EngineClass::getAutoMode ( )

◆ getAutoShift()

autoswitch Script2Game::EngineClass::getAutoShift ( )

◆ getAutoShiftBehavior()

float Script2Game::EngineClass::getAutoShiftBehavior ( )

◆ getBrakingTorque()

float Script2Game::EngineClass::getBrakingTorque ( ) const

◆ getClutch()

float Script2Game::EngineClass::getClutch ( )

◆ getClutchForce()

float Script2Game::EngineClass::getClutchForce ( ) const

('engoption' attr #3)

◆ getClutchTime()

float Script2Game::EngineClass::getClutchTime ( ) const

Time (in seconds) the clutch takes to apply ('engoption' attr #5)

◆ getCrankFactor()

float Script2Game::EngineClass::getCrankFactor ( )

◆ getDiffRatio()

float Script2Game::EngineClass::getDiffRatio ( ) const

Global gear ratio ('engine' attr #4)

◆ getDriveRatio()

float Script2Game::EngineClass::getDriveRatio ( )

◆ getEngineInertia()

float Script2Game::EngineClass::getEngineInertia ( ) const

('engoption' attr #1)

◆ getEnginePower() [1/2]

float Script2Game::EngineClass::getEnginePower ( )

◆ getEnginePower() [2/2]

float Script2Game::EngineClass::getEnginePower ( float  rpm)

◆ getEngineTorque() [1/2]

float Script2Game::EngineClass::getEngineTorque ( )

◆ getEngineTorque() [2/2]

float Script2Game::EngineClass::getEngineTorque ( ) const

Torque in N/m ('engine' attr #3)

◆ getEngineType()

char Script2Game::EngineClass::getEngineType ( ) const

't' = truck (default), 'c' = car, 'e' = electric car ('engoption' attr #2)

◆ getGear()

int Script2Game::EngineClass::getGear ( )

◆ getGearRange()

int Script2Game::EngineClass::getGearRange ( )

◆ getGearRatio()

float Script2Game::EngineClass::getGearRatio ( int  pos)

-1=R, 0=N, 1... ('engine' attrs #5[R],#6[N],#7[1]...)

◆ getIdleMixture()

float Script2Game::EngineClass::getIdleMixture ( )

◆ getIdleRPM()

float Script2Game::EngineClass::getIdleRPM ( ) const

('engoption' attr #8)

◆ getInputShaftRPM()

float Script2Game::EngineClass::getInputShaftRPM ( )

◆ getKickdownDelayCounter()

int Script2Game::EngineClass::getKickdownDelayCounter ( )

◆ getMaxIdleMixture()

float Script2Game::EngineClass::getMaxIdleMixture ( ) const

Maximum throttle to maintain the idle RPM ('engoption' attr #9)

◆ getMinIdleMixture()

float Script2Game::EngineClass::getMinIdleMixture ( ) const

Minimum throttle to maintain the idle RPM ('engoption' attr #10)

◆ getNumGears()

int Script2Game::EngineClass::getNumGears ( ) const

◆ getNumGearsRanges()

int Script2Game::EngineClass::getNumGearsRanges ( ) const

◆ getPostShiftClock()

float Script2Game::EngineClass::getPostShiftClock ( )

◆ getPostShiftTime()

float Script2Game::EngineClass::getPostShiftTime ( ) const

Time (in seconds) until full torque is transferred ('engoption' attr #6)

◆ getPrimeMixture()

float Script2Game::EngineClass::getPrimeMixture ( )

◆ getRPM()

float Script2Game::EngineClass::getRPM ( )

◆ getShifTargetGear()

int Script2Game::EngineClass::getShifTargetGear ( )

◆ getShiftClock()

float Script2Game::EngineClass::getShiftClock ( )

◆ getShiftDownRPM()

float Script2Game::EngineClass::getShiftDownRPM ( ) const

Shift down RPM ('engine' attr #1)

◆ getShiftTime()

float Script2Game::EngineClass::getShiftTime ( ) const

Time (in seconds) that it takes to shift ('engoption' attr #4)

◆ getShiftUpRPM()

float Script2Game::EngineClass::getShiftUpRPM ( ) const

Shift up RPM ('engine' attr #2)

◆ getSmoke()

float Script2Game::EngineClass::getSmoke ( )

◆ getStallRMP()

float Script2Game::EngineClass::getStallRMP ( ) const

('engoption' attr #7)

◆ getTorque()

float Script2Game::EngineClass::getTorque ( )

◆ getTurboPower()

float Script2Game::EngineClass::getTurboPower ( )

◆ getTurboPSI()

float Script2Game::EngineClass::getTurboPSI ( )

◆ getUpshiftDelayCounter()

int Script2Game::EngineClass::getUpshiftDelayCounter ( )

◆ getWheelSpin()

float Script2Game::EngineClass::getWheelSpin ( )

Current wheel RPM.

◆ hasAir()

bool Script2Game::EngineClass::hasAir ( ) const

◆ hasContact()

bool Script2Game::EngineClass::hasContact ( )

Ignition.

◆ hasTurbo()

bool Script2Game::EngineClass::hasTurbo ( ) const

◆ isElectric()

bool Script2Game::EngineClass::isElectric ( ) const

◆ isPostShifting()

bool Script2Game::EngineClass::isPostShifting ( )

◆ isRunning()

bool Script2Game::EngineClass::isRunning ( )

◆ isShifting()

bool Script2Game::EngineClass::isShifting ( )

◆ offStart()

void Script2Game::EngineClass::offStart ( )

Quick start of vehicle engine.

◆ pushNetworkState()

void Script2Game::EngineClass::pushNetworkState ( float  engine_rpm,
float  acc,
float  clutch,
int  gear,
bool  running,
bool  contact,
char  auto_mode,
char  auto_select = -1 
)

◆ setAcc()

void Script2Game::EngineClass::setAcc ( float  val)

◆ setAutoMode()

void Script2Game::EngineClass::setAutoMode ( SimGearboxMode  mode)

◆ setClutch()

void Script2Game::EngineClass::setClutch ( float  clutch)

◆ setGear()

void Script2Game::EngineClass::setGear ( int  v)

low level gear changing (bypasses shifting logic)

◆ setGearRange()

void Script2Game::EngineClass::setGearRange ( int  v)

low level gear changing (bypasses shifting logic)

◆ setHydroPump()

void Script2Game::EngineClass::setHydroPump ( float  work)

◆ setManualClutch()

void Script2Game::EngineClass::setManualClutch ( float  val)

◆ setPrime()

void Script2Game::EngineClass::setPrime ( bool  p)

◆ setRPM()

void Script2Game::EngineClass::setRPM ( float  rpm)

◆ setTCaseRatio()

void Script2Game::EngineClass::setTCaseRatio ( float  ratio)

Set current transfer case gear (reduction) ratio.

◆ setWheelSpin()

void Script2Game::EngineClass::setWheelSpin ( float  rpm)

◆ shift()

void Script2Game::EngineClass::shift ( int  val)

Changes gear by a relative offset. Plays sounds.

◆ shiftTo()

void Script2Game::EngineClass::shiftTo ( int  val)

Changes gear to given value. Plays sounds.

◆ startEngine()

void Script2Game::EngineClass::startEngine ( )

Quick engine start. Plays sounds.

◆ stopEngine()

void Script2Game::EngineClass::stopEngine ( )

stall engine

◆ toggleAutoMode()

void Script2Game::EngineClass::toggleAutoMode ( )

◆ toggleContact()

void Script2Game::EngineClass::toggleContact ( )

Ignition.


The documentation for this class was generated from the following file: