28 void SaveBinaryState(
StreamOut &inStream)
const;
31 void RestoreBinaryState(
StreamIn &inStream);
36 float mSwitchTime = 0.5f;
37 float mClutchReleaseTime = 0.3f;
38 float mSwitchLatency = 0.5f;
39 float mShiftUpRPM = 4000.0f;
40 float mShiftDownRPM = 2000.0f;
41 float mClutchStrength = 10.0f;
51 void Set(
int inCurrentGear,
float inClutchFriction) { mCurrentGear = inCurrentGear; mClutchFriction = inClutchFriction; }
58 void Update(
float inDeltaTime,
float inCurrentRPM,
float inForwardInput,
bool inCanShiftUp);
70 float GetCurrentRatio()
const;
73 bool AllowSleep()
const {
return mGearSwitchTimeLeft <= 0.0f && mClutchReleaseTimeLeft <= 0.0f && mGearSwitchLatencyTimeLeft <= 0.0f; }
81 float mClutchFriction = 1.0f;
82 float mGearSwitchTimeLeft = 0.0f;
83 float mClutchReleaseTimeLeft = 0.0f;
84 float mGearSwitchLatencyTimeLeft = 0.0f;
std::uint8_t uint8
Definition: Core.h:440
#define JPH_EXPORT
Definition: Core.h:227
#define JPH_NAMESPACE_END
Definition: Core.h:367
#define JPH_NAMESPACE_BEGIN
Definition: Core.h:361
std::vector< T, STLAllocator< T > > Array
Definition: STLAllocator.h:81
#define JPH_DECLARE_SERIALIZABLE_NON_VIRTUAL(linkage, class_name)
Definition: SerializableObject.h:71
ETransmissionMode
How gears are shifted.
Definition: VehicleTransmission.h:16
@ Auto
Automatically shift gear up and down.
@ Manual
Manual gear shift (call SetTransmissionInput)
Definition: StateRecorder.h:48
Simple binary input stream.
Definition: StreamIn.h:13
Simple binary output stream.
Definition: StreamOut.h:13
Runtime data for transmission.
Definition: VehicleTransmission.h:46
bool AllowSleep() const
Only allow sleeping when the transmission is idle.
Definition: VehicleTransmission.h:73
int GetCurrentGear() const
Current gear, -1 = reverse, 0 = neutral, 1 = 1st gear etc.
Definition: VehicleTransmission.h:61
float GetClutchFriction() const
Value between 0 and 1 indicating how much friction the clutch gives (0 = no friction,...
Definition: VehicleTransmission.h:64
void Set(int inCurrentGear, float inClutchFriction)
Definition: VehicleTransmission.h:51
bool IsSwitchingGear() const
If the auto box is currently switching gears.
Definition: VehicleTransmission.h:67
Configuration for the transmission of a vehicle (gear box)
Definition: VehicleTransmission.h:23