Engine²
Open-source game engine written in C++.
Loading...
Searching...
No Matches
Physics::Component::GearboxSettings Struct Reference

Gearbox configuration for vehicle transmission. More...

#include <Vehicle.hpp>

Public Attributes

TransmissionMode mode = TransmissionMode::Auto
 Transmission mode (auto or manual shifting).
std::vector< float > forwardGearRatios = {2.66f, 1.78f, 1.3f, 1.0f, 0.74f}
std::vector< float > reverseGearRatios = {-2.90f}
int currentGear = 1
 Current gear (-1 = reverse, 0 = neutral, 1 = first forward, etc.).
float switchTime = 0.5f
 How long it takes to switch gears (s) - only used in auto mode.
float clutchReleaseTime = 0.3f
 How long it takes to release the clutch (go to full friction) - only used in auto mode.
float switchLatency = 0.5f
 How long to wait after releasing clutch before another switch is attempted (s) - only used in auto mode.
float shiftUpRPM = 4000.0f
 If RPM of engine is bigger than this, shift a gear up - only used in auto mode.
float shiftDownRPM = 2000.0f
 If RPM of engine is smaller than this, shift a gear down - only used in auto mode.
float clutchStrength = 10.0f
float clutchFriction = 1.0f
 Current clutch friction (0 = no friction, 1 = full friction) - for manual mode.

Detailed Description

Gearbox configuration for vehicle transmission.

Member Data Documentation

◆ clutchFriction

float Physics::Component::GearboxSettings::clutchFriction = 1.0f

Current clutch friction (0 = no friction, 1 = full friction) - for manual mode.

◆ clutchReleaseTime

float Physics::Component::GearboxSettings::clutchReleaseTime = 0.3f

How long it takes to release the clutch (go to full friction) - only used in auto mode.

◆ clutchStrength

float Physics::Component::GearboxSettings::clutchStrength = 10.0f

Strength of the clutch when fully engaged Total torque = ClutchStrength * (Velocity Engine - Avg Velocity Wheels At Clutch) Units: kg * m^2 * s^-1

◆ currentGear

int Physics::Component::GearboxSettings::currentGear = 1

Current gear (-1 = reverse, 0 = neutral, 1 = first forward, etc.).

◆ forwardGearRatios

std::vector<float> Physics::Component::GearboxSettings::forwardGearRatios = {2.66f, 1.78f, 1.3f, 1.0f, 0.74f}

Forward gear ratios (rotation rate between engine and gearbox) Index 0 = 1st gear, 1 = 2nd gear, etc.

◆ mode

TransmissionMode Physics::Component::GearboxSettings::mode = TransmissionMode::Auto

Transmission mode (auto or manual shifting).

◆ reverseGearRatios

std::vector<float> Physics::Component::GearboxSettings::reverseGearRatios = {-2.90f}

Reverse gear ratios (rotation rate between engine and gearbox when in reverse) Typically negative values. Index 0 = 1st reverse gear, etc.

◆ shiftDownRPM

float Physics::Component::GearboxSettings::shiftDownRPM = 2000.0f

If RPM of engine is smaller than this, shift a gear down - only used in auto mode.

◆ shiftUpRPM

float Physics::Component::GearboxSettings::shiftUpRPM = 4000.0f

If RPM of engine is bigger than this, shift a gear up - only used in auto mode.

◆ switchLatency

float Physics::Component::GearboxSettings::switchLatency = 0.5f

How long to wait after releasing clutch before another switch is attempted (s) - only used in auto mode.

◆ switchTime

float Physics::Component::GearboxSettings::switchTime = 0.5f

How long it takes to switch gears (s) - only used in auto mode.


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