Manual Gearbox
Traditional manual transmission with H-pattern or sequential shifting. Simulates gear engagement, synchronizer behavior, and gear grinding mechanics.
Traditional manual transmission with H-pattern or sequential shifting. Simulates gear engagement, synchronizer behavior, and gear grinding mechanics. Requires a Friction Clutch upstream for gear changes.
Inherited Methods
This device inherits all methods and properties from the Powertrain Base Device.
Instance Methods
| Method | Signature | Description |
|---|---|---|
setGearIndex | device:setGearIndex(index) | Shifts to the specified gear. 0 = Neutral, 1+ = Forward gears, -1 = Reverse. |
setLock | device:setLock(enabled) | Toggles the internal mechanical lock state. |
setGearGrinding | device:setGearGrinding(active, targetGearIndex, maxGrindingTorque) | Manually triggers or stops gear grinding simulation. |
Public API
| Variable | Type | Description |
|---|---|---|
outputPorts | table | Map of active power output ports. |
deviceCategories | table | Categories identifying this as a gearbox type device. |
| Function | Signature | Description |
|---|---|---|
new | (jbeamData) → device | Creates a new manual gearbox instance from JBeam configuration. |
velocityUpdate | (device, dt) | Physics step: calculates input speed from output speed and gear ratio. |
torqueUpdate | (device) | Physics step: transmits torque from input to output through the current gear. |
Usage Example
-- Access the manual gearbox
local gearbox = powertrain.getDevice("gearbox")
-- Shift to 3rd gear
gearbox:setGearIndex(3)
-- Shift to neutral
gearbox:setGearIndex(0)
-- Shift to reverse
gearbox:setGearIndex(-1)See Also
- Friction Clutch — Required clutch for gear changes
- Sequential Gearbox — Race-oriented sequential alternative
- Automatic Gearbox — Automatic transmission
- Powertrain Base Device — Inherited base methods
Linear Actuator
Electric linear actuator that converts rotational motor output to linear motion. Used for adjustable suspension, deployable components, and positioning systems.
Multi-Shaft
Powertrain device that connects multiple rotational shafts together. Distributes torque across several outputs, used for complex drivetrain layouts like multi-axle trucks.