Runtime data for transmission.
More...
#include <VehicleTransmission.h>
|
ETransmissionMode | mMode = ETransmissionMode::Auto |
| How to switch gears. More...
|
|
Array< float > | mGearRatios { 2.66f, 1.78f, 1.3f, 1.0f, 0.74f } |
| Ratio in rotation rate between engine and gear box, first element is 1st gear, 2nd element 2nd gear etc. More...
|
|
Array< float > | mReverseGearRatios { -2.90f } |
| Ratio in rotation rate between engine and gear box when driving in reverse. More...
|
|
float | mSwitchTime = 0.5f |
| How long it takes to switch gears (s), only used in auto mode. More...
|
|
float | mClutchReleaseTime = 0.3f |
| How long it takes to release the clutch (go to full friction), only used in auto mode. More...
|
|
float | mSwitchLatency = 0.5f |
| How long to wait after releasing the clutch before another switch is attempted (s), only used in auto mode. More...
|
|
float | mShiftUpRPM = 4000.0f |
| If RPM of engine is bigger then this we will shift a gear up, only used in auto mode. More...
|
|
float | mShiftDownRPM = 2000.0f |
| If RPM of engine is smaller then this we will shift a gear down, only used in auto mode. More...
|
|
float | mClutchStrength = 10.0f |
| Strength of the clutch when fully engaged. Total torque a clutch applies is Torque = ClutchStrength * (Velocity Engine - Avg Velocity Wheels At Clutch) (units: k m^2 s^-1) More...
|
|
Runtime data for transmission.
◆ AllowSleep()
bool VehicleTransmission::AllowSleep |
( |
| ) |
const |
|
inline |
Only allow sleeping when the transmission is idle.
◆ GetClutchFriction()
float VehicleTransmission::GetClutchFriction |
( |
| ) |
const |
|
inline |
Value between 0 and 1 indicating how much friction the clutch gives (0 = no friction, 1 = full friction)
◆ GetCurrentGear()
int VehicleTransmission::GetCurrentGear |
( |
| ) |
const |
|
inline |
Current gear, -1 = reverse, 0 = neutral, 1 = 1st gear etc.
◆ GetCurrentRatio()
float VehicleTransmission::GetCurrentRatio |
( |
| ) |
const |
Return the transmission ratio based on the current gear (ratio between engine and differential)
◆ IsSwitchingGear()
bool VehicleTransmission::IsSwitchingGear |
( |
| ) |
const |
|
inline |
If the auto box is currently switching gears.
◆ RestoreState()
void VehicleTransmission::RestoreState |
( |
StateRecorder & |
inStream | ) |
|
◆ SaveState()
void VehicleTransmission::SaveState |
( |
StateRecorder & |
inStream | ) |
const |
◆ Set()
void VehicleTransmission::Set |
( |
int |
inCurrentGear, |
|
|
float |
inClutchFriction |
|
) |
| |
|
inline |
Set input from driver regarding the transmission (only relevant when transmission is set to manual mode)
- Parameters
-
inCurrentGear | Current gear, -1 = reverse, 0 = neutral, 1 = 1st gear etc. |
inClutchFriction | Value between 0 and 1 indicating how much friction the clutch gives (0 = no friction, 1 = full friction) |
◆ Update()
void VehicleTransmission::Update |
( |
float |
inDeltaTime, |
|
|
float |
inCurrentRPM, |
|
|
float |
inForwardInput, |
|
|
bool |
inCanShiftUp |
|
) |
| |
Update the current gear and clutch friction if the transmission is in aut mode
- Parameters
-
inDeltaTime | Time step delta time in s |
inCurrentRPM | Current RPM for engine |
inForwardInput | Hint if the user wants to drive forward (> 0) or backwards (< 0) |
inCanShiftUp | Indicates if we want to allow the transmission to shift up (e.g. pass false if wheels are slipping) |
The documentation for this class was generated from the following files: