![]() |
RigsofRods
Soft-body Physics Simulation
|
A land vehicle engine + transmission. More...
#include <EngineSim.h>
Public Types | |
enum | autoswitch { REAR, NEUTRAL, DRIVE, TWO, ONE, MANUALMODE } |
enum | turbomode { OLD, NEW } |
Public Member Functions | |
EngineSim (float min_rpm, float max_rpm, float torque, std::vector< float > gears, float dratio, ActorPtr actor) | |
~EngineSim () | |
void | PushNetworkState (float engine_rpm, float acc, float clutch, int gear, bool running, bool contact, char auto_mode, char auto_select=-1) |
Sets current engine state;. More... | |
void | SetEngineOptions (float einertia, char etype, float eclutch, float ctime, float stime, float pstime, float irpm, float srpm, float maximix, float minimix, float ebraking) |
Sets engine options. More... | |
void | SetTurboOptions (int type, float tinertiaFactor, int nturbos, float param1, float param2, float param3, float param4, float param5, float param6, float param7, float param8, float param9, float param10, float param11) |
Sets turbo options. More... | |
void | SetAcceleration (float val) |
void | SetAutoMode (RoR::SimGearboxMode mode) |
void | SetClutch (float clutch) |
float | GetAcceleration () |
float | GetClutch () |
float | GetClutchForce () |
float | GetCrankFactor () |
float | GetSmoke () |
float | GetTorque () |
float | GetTurboPsi () |
RoR::SimGearboxMode | GetAutoShiftMode () |
void | SetEngineRpm (float rpm) |
Set current engine RPM. More... | |
void | SetEnginePriming (bool p) |
Set current engine prime. More... | |
void | SetHydroPumpWork (float work) |
Set current hydro pump work. More... | |
void | SetWheelSpin (float rpm) |
Set current wheel spinning speed. More... | |
void | SetTCaseRatio (float ratio) |
Set current transfer case gear (reduction) ratio. More... | |
void | ToggleAutoShiftMode () |
void | OffStart () |
Quick start of vehicle engine. More... | |
void | StartEngine () |
Quick engine start. Plays sounds. More... | |
int | GetGear () |
low level gear changing More... | |
int | GetGearRange () |
low level gear changing More... | |
void | SetGear (int v) |
low level gear changing More... | |
void | SetGearRange (int v) |
low level gear changing More... | |
void | StopEngine () |
stall engine More... | |
float | GetAccToHoldRPM () |
estimate required throttle input to hold the current rpm More... | |
bool | HasTurbo () const |
bool | isRunning () const |
int | GetAutoMode () const |
char | GetEngineType () const |
float | getIdleRPM () const |
float | getMaxRPM () const |
float | getMinRPM () const |
int | getNumGears () const |
int | getNumGearsRanges () const |
TorqueCurve * | getTorqueCurve () |
float | GetEngineRpm () const |
float | GetEngineTorque () const |
float | GetInputShaftRpm () |
float | GetDriveRatio () |
float | GetEngineInertia () |
float | getEnginePower () |
float | getEnginePower (float rpm) |
float | getTurboPower () |
float | getIdleMixture () |
float | getPrimeMixture () |
int | getAutoShift () |
void | autoSetAcc (float val) |
void | autoShiftDown () |
void | autoShiftSet (int mode) |
void | autoShiftUp () |
void | setManualClutch (float val) |
void | shift (int val) |
Changes gear by a relative offset. Plays sounds. More... | |
void | shiftTo (int val) |
Changes gear to given value. Plays sounds. More... | |
void | updateShifts () |
Changes gears. Plays sounds. More... | |
void | UpdateEngineSim (float dt, int doUpdate) |
void | UpdateEngineAudio () |
void | UpdateInputEvents (float dt) |
void | toggleContact () |
bool | hasContact () const |
Private Types | |
enum | shiftmodes { AUTOMATIC, SEMIAUTO, MANUAL, MANUAL_STICK, MANUAL_RANGES } |
Friends | |
class | ActorSpawner |
A land vehicle engine + transmission.
Definition at line 35 of file EngineSim.h.
Enumerator | |
---|---|
REAR | |
NEUTRAL | |
DRIVE | |
TWO | |
ONE | |
MANUALMODE |
Definition at line 129 of file EngineSim.h.
|
private |
Enumerator | |
---|---|
AUTOMATIC | |
SEMIAUTO | |
MANUAL | |
MANUAL_STICK | |
MANUAL_RANGES |
Definition at line 147 of file EngineSim.h.
Enumerator | |
---|---|
OLD | |
NEW |
Definition at line 139 of file EngineSim.h.
EngineSim::EngineSim | ( | float | min_rpm, |
float | max_rpm, | ||
float | torque, | ||
std::vector< float > | gears, | ||
float | dratio, | ||
ActorPtr | actor | ||
) |
Definition at line 37 of file EngineSim.cpp.
EngineSim::~EngineSim | ( | ) |
Definition at line 122 of file EngineSim.cpp.
void EngineSim::autoSetAcc | ( | float | val | ) |
Definition at line 1078 of file EngineSim.cpp.
void EngineSim::autoShiftDown | ( | ) |
Definition at line 1174 of file EngineSim.cpp.
void EngineSim::autoShiftSet | ( | int | mode | ) |
Definition at line 1157 of file EngineSim.cpp.
void EngineSim::autoShiftUp | ( | ) |
Definition at line 1165 of file EngineSim.cpp.
float EngineSim::GetAcceleration | ( | ) |
float EngineSim::GetAccToHoldRPM | ( | ) |
estimate required throttle input to hold the current rpm
Definition at line 1072 of file EngineSim.cpp.
|
inline |
Definition at line 94 of file EngineSim.h.
int EngineSim::getAutoShift | ( | ) |
RoR::SimGearboxMode EngineSim::GetAutoShiftMode | ( | ) |
float EngineSim::GetClutch | ( | ) |
float EngineSim::GetClutchForce | ( | ) |
Definition at line 980 of file EngineSim.cpp.
float EngineSim::GetCrankFactor | ( | ) |
|
inline |
Definition at line 105 of file EngineSim.h.
|
inline |
|
inline |
Definition at line 107 of file EngineSim.h.
float EngineSim::getEnginePower | ( | float | rpm | ) |
|
inline |
|
inline |
Definition at line 103 of file EngineSim.h.
|
inline |
Definition at line 95 of file EngineSim.h.
int EngineSim::GetGear | ( | ) |
low level gear changing
Definition at line 1041 of file EngineSim.cpp.
int EngineSim::GetGearRange | ( | ) |
low level gear changing
Definition at line 1052 of file EngineSim.cpp.
float EngineSim::getIdleMixture | ( | ) |
|
inline |
Definition at line 96 of file EngineSim.h.
|
inline |
Definition at line 104 of file EngineSim.h.
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 100 of file EngineSim.h.
float EngineSim::getPrimeMixture | ( | ) |
Definition at line 1242 of file EngineSim.cpp.
float EngineSim::GetSmoke | ( | ) |
Definition at line 903 of file EngineSim.cpp.
float EngineSim::GetTorque | ( | ) |
|
inline |
float EngineSim::getTurboPower | ( | ) |
Definition at line 1198 of file EngineSim.cpp.
float EngineSim::GetTurboPsi | ( | ) |
|
inline |
|
inline |
|
inline |
void EngineSim::OffStart | ( | ) |
Quick start of vehicle engine.
Definition at line 1016 of file EngineSim.cpp.
void EngineSim::PushNetworkState | ( | float | engine_rpm, |
float | acc, | ||
float | clutch, | ||
int | gear, | ||
bool | running, | ||
bool | contact, | ||
char | auto_mode, | ||
char | auto_select = -1 |
||
) |
Sets current engine state;.
gear | Current gear {-1 = reverse, 0 = neutral, 1...21 = forward} |
Definition at line 885 of file EngineSim.cpp.
void EngineSim::SetAcceleration | ( | float | val | ) |
void EngineSim::SetAutoMode | ( | RoR::SimGearboxMode | mode | ) |
void EngineSim::SetClutch | ( | float | clutch | ) |
void EngineSim::SetEngineOptions | ( | float | einertia, |
char | etype, | ||
float | eclutch, | ||
float | ctime, | ||
float | stime, | ||
float | pstime, | ||
float | irpm, | ||
float | srpm, | ||
float | maximix, | ||
float | minimix, | ||
float | ebraking | ||
) |
Sets engine options.
einertia | Engine inertia |
etype | Engine type {'t' = truck (default), 'c' = car} |
eclutch | |
ctime | Clutch time |
stime | Shift time |
pstime | Post-shift time |
irpm | Idle RPM |
srpm | Stall RPM |
maximix | Max. idle mixture |
minimix | Min. idle mixture |
Definition at line 197 of file EngineSim.cpp.
void EngineSim::SetEnginePriming | ( | bool | p | ) |
Set current engine prime.
Definition at line 923 of file EngineSim.cpp.
void EngineSim::SetEngineRpm | ( | float | rpm | ) |
Set current engine RPM.
Definition at line 918 of file EngineSim.cpp.
void EngineSim::SetGear | ( | int | v | ) |
low level gear changing
Definition at line 1047 of file EngineSim.cpp.
void EngineSim::SetGearRange | ( | int | v | ) |
low level gear changing
Definition at line 1057 of file EngineSim.cpp.
void EngineSim::SetHydroPumpWork | ( | float | work | ) |
Set current hydro pump work.
Definition at line 928 of file EngineSim.cpp.
void EngineSim::setManualClutch | ( | float | val | ) |
void EngineSim::SetTCaseRatio | ( | float | ratio | ) |
Set current transfer case gear (reduction) ratio.
Definition at line 938 of file EngineSim.cpp.
void EngineSim::SetTurboOptions | ( | int | type, |
float | tinertiaFactor, | ||
int | nturbos, | ||
float | param1, | ||
float | param2, | ||
float | param3, | ||
float | param4, | ||
float | param5, | ||
float | param6, | ||
float | param7, | ||
float | param8, | ||
float | param9, | ||
float | param10, | ||
float | param11 | ||
) |
Sets turbo options.
tinertiatinertiaFactor | Turbo inertia factor |
nturbos | Number of turbos |
additionalTorque | Torque that will be added to the engine at max turbo rpm |
Definition at line 129 of file EngineSim.cpp.
void EngineSim::SetWheelSpin | ( | float | rpm | ) |
Set current wheel spinning speed.
Definition at line 933 of file EngineSim.cpp.
void EngineSim::shift | ( | int | val | ) |
Changes gear by a relative offset. Plays sounds.
Definition at line 1087 of file EngineSim.cpp.
void EngineSim::shiftTo | ( | int | val | ) |
Changes gear to given value. Plays sounds.
Definition at line 1111 of file EngineSim.cpp.
void EngineSim::StartEngine | ( | ) |
Quick engine start. Plays sounds.
Definition at line 998 of file EngineSim.cpp.
void EngineSim::StopEngine | ( | ) |
stall engine
Definition at line 1062 of file EngineSim.cpp.
void EngineSim::ToggleAutoShiftMode | ( | ) |
void EngineSim::toggleContact | ( | ) |
void EngineSim::UpdateEngineAudio | ( | ) |
Definition at line 791 of file EngineSim.cpp.
void EngineSim::UpdateEngineSim | ( | float | dt, |
int | doUpdate | ||
) |
void EngineSim::UpdateInputEvents | ( | float | dt | ) |
Definition at line 1263 of file EngineSim.cpp.
void EngineSim::updateShifts | ( | ) |
Changes gears. Plays sounds.
Definition at line 1116 of file EngineSim.cpp.
|
friend |
Definition at line 37 of file EngineSim.h.
|
private |
Definition at line 223 of file EngineSim.h.
|
private |
Definition at line 157 of file EngineSim.h.
|
private |
Definition at line 197 of file EngineSim.h.
|
private |
Definition at line 244 of file EngineSim.h.
|
private |
Definition at line 246 of file EngineSim.h.
|
private |
Definition at line 245 of file EngineSim.h.
|
private |
Definition at line 215 of file EngineSim.h.
|
private |
Transmission mode (.
Definition at line 213 of file EngineSim.h.
|
private |
Definition at line 214 of file EngineSim.h.
|
private |
Definition at line 224 of file EngineSim.h.
|
private |
Engine attribute.
Definition at line 180 of file EngineSim.h.
|
private |
Clutch attribute.
Definition at line 168 of file EngineSim.h.
|
private |
Clutch attribute.
Definition at line 169 of file EngineSim.h.
|
private |
Ignition switch is in ON/RUN position.
Definition at line 200 of file EngineSim.h.
|
private |
Engine.
Definition at line 181 of file EngineSim.h.
|
private |
Definition at line 170 of file EngineSim.h.
|
private |
Definition at line 171 of file EngineSim.h.
|
private |
Engine.
Definition at line 182 of file EngineSim.h.
|
private |
Engine.
Definition at line 183 of file EngineSim.h.
|
private |
Gears; Current gear {-1 = reverse, 0 = neutral, 1...21 = forward}.
Definition at line 162 of file EngineSim.h.
|
private |
Gears.
Definition at line 163 of file EngineSim.h.
|
private |
Definition at line 229 of file EngineSim.h.
|
private |
Gears; measured wheel revolutions.
Definition at line 161 of file EngineSim.h.
|
private |
Engine.
Definition at line 184 of file EngineSim.h.
|
private |
Definition at line 233 of file EngineSim.h.
|
private |
Engine attribute.
Definition at line 175 of file EngineSim.h.
|
private |
Engine attribute.
Definition at line 176 of file EngineSim.h.
|
private |
Engine attribute.
Definition at line 193 of file EngineSim.h.
|
private |
Engine attribute.
Definition at line 190 of file EngineSim.h.
|
private |
Engine attribute.
Definition at line 174 of file EngineSim.h.
|
private |
Engine.
Definition at line 195 of file EngineSim.h.
|
private |
Engine state.
Definition at line 178 of file EngineSim.h.
|
private |
Engine attribute.
Definition at line 191 of file EngineSim.h.
|
private |
Engine attribute.
Definition at line 192 of file EngineSim.h.
|
private |
Engine attribute.
Definition at line 194 of file EngineSim.h.
|
private |
Engine attribute.
Definition at line 186 of file EngineSim.h.
|
private |
Engine attribute.
Definition at line 177 of file EngineSim.h.
|
private |
Engine attribute {'t' = truck (default), 'c' = car}.
Definition at line 179 of file EngineSim.h.
|
private |
Definition at line 216 of file EngineSim.h.
|
private |
Gears.
Definition at line 165 of file EngineSim.h.
|
private |
Definition at line 218 of file EngineSim.h.
|
private |
Engine.
Definition at line 187 of file EngineSim.h.
|
private |
Definition at line 221 of file EngineSim.h.
|
private |
Engine attribute.
Definition at line 189 of file EngineSim.h.
|
private |
Definition at line 232 of file EngineSim.h.
|
private |
Definition at line 237 of file EngineSim.h.
|
private |
Engine attribute.
Definition at line 188 of file EngineSim.h.
|
private |
Definition at line 239 of file EngineSim.h.
|
private |
Gears.
Definition at line 164 of file EngineSim.h.
|
private |
Definition at line 231 of file EngineSim.h.
|
private |
Definition at line 217 of file EngineSim.h.
|
private |
Definition at line 205 of file EngineSim.h.
|
private |
Shift attribute.
Definition at line 204 of file EngineSim.h.
|
private |
Definition at line 208 of file EngineSim.h.
|
private |
Gears; estimated wheel revolutions based on current vehicle speed along the longi. axis.
Definition at line 160 of file EngineSim.h.
|
private |
Definition at line 222 of file EngineSim.h.
|
private |
Definition at line 219 of file EngineSim.h.
|
private |
Definition at line 207 of file EngineSim.h.
|
private |
Shift attribute.
Definition at line 206 of file EngineSim.h.
|
private |
Definition at line 210 of file EngineSim.h.
|
private |
Definition at line 209 of file EngineSim.h.
|
private |
Ignition switch is in START position.
Definition at line 201 of file EngineSim.h.
|
private |
Engine.
Definition at line 185 of file EngineSim.h.
|
private |
Definition at line 196 of file EngineSim.h.
|
private |
Definition at line 236 of file EngineSim.h.
|
private |
Definition at line 234 of file EngineSim.h.
|
private |
Definition at line 240 of file EngineSim.h.
|
private |
Definition at line 243 of file EngineSim.h.
|
private |
Definition at line 235 of file EngineSim.h.
|
private |
Definition at line 238 of file EngineSim.h.
|
private |
Definition at line 230 of file EngineSim.h.
|
private |
Definition at line 228 of file EngineSim.h.
|
private |
Definition at line 242 of file EngineSim.h.
|
private |
Definition at line 241 of file EngineSim.h.
|
private |
Definition at line 220 of file EngineSim.h.