Sequential Gearbox
High-performance sequential transmission for rapid gear changes. Supports dog-ring engagement, flat-shift capability, and gear whine audio simulation.
High-performance sequential transmission for rapid, sequential gear changes. Supports dog-ring engagement, flat-shift capability, and detailed gear whine audio simulation. Typically used in race cars and high-performance applications.
Inherited Methods
This device inherits all methods and properties from the Powertrain Base Device.
Instance Methods
| Method | Signature | Description |
|---|---|---|
setGearIndex | (device, index) | Shifts to the specified gear index with sequential logic and synchronization. |
setLock | (device, enabled) | Toggles the mechanical lock between input and output. |
onBreak | (device) | Handles structural failure of the transmission. |
Public API
| Variable | Type | Description |
|---|---|---|
outputPorts | table | Map of active power output ports. |
deviceCategories | table | Categories identifying this as a gearbox type device. |
gearRatio | number | Currently applied reduction ratio. |
gearIndex | number | Currently engaged gear index. |
targetGearIndex | number | Gear index targeted for a deferred shift. |
isBroken | boolean | Failure status of the transmission. |
maxGearIndex | number | Highest available gear index. |
minGearIndex | number | Lowest gear index (typically -1 for reverse). |
gearCount | number | Total number of forward gears. |
friction | number | Base internal resistance. |
lockCoef | number | Degree of mechanical engagement (0 to 1). |
| Function | Signature | Description |
|---|---|---|
new | (jbeamData) → device | Creates a new sequential gearbox instance from JBeam configuration. |
velocityUpdate | (device, dt) | Physics step: speed transmission through the gear set. |
torqueUpdate | (device) | Physics step: torque transmission from input to output. |
Usage Example
-- Access the sequential gearbox
local gearbox = powertrain.getDevice("gearbox")
-- Shift up
gearbox:setGearIndex(gearbox.gearIndex + 1)
-- Shift down
gearbox:setGearIndex(gearbox.gearIndex - 1)
-- Check current gear
local currentGear = gearbox.gearIndexSee Also
- Manual Gearbox — H-pattern manual transmission
- DCT Gearbox — Dual-clutch rapid shifting
- Friction Clutch — Clutch device
- Powertrain Base Device — Inherited base methods
Range Box
Transfer case providing high and low range gear selections for 4WD vehicles. Multiplies the gear ratios for off-road crawling or highway driving.
Shaft
Simple rotational connection between powertrain components. Transmits torque and speed with configurable friction and inertia. Used for driveshafts, half-shafts, and axles.