Table of Contents

Class RallyCarComponent

Namespace
LibreRally.Vehicle
Assembly
LibreRally.dll

Core component for rally vehicle simulation, handling engine, transmission, steering, and tyre dynamics.

[ComponentCategory("LibreRally")]
public sealed class RallyCarComponent : SyncScript, IIdentifiable, ICollectorHolder
Inheritance
SyncScript
RallyCarComponent
Implements
IIdentifiable
ICollectorHolder
Inherited Members

Fields

PsiToBar

PSI to bar conversion factor.

public const float PsiToBar = 0.0689476

Field Value

float

Properties

AbsActive

Whether ABS is actively reducing brake pressure.

public bool AbsActive { get; }

Property Value

bool

AbsApplyRate

How quickly ABS removes brake torque once lock-up is detected (1/s).

public float AbsApplyRate { get; set; }

Property Value

float

AbsEnabled

Whether the active vehicle definition equips ABS.

public bool AbsEnabled { get; set; }

Property Value

bool

AbsMinBrakeTorqueScale

Minimum fraction of service-brake torque ABS still allows when a wheel is close to locking.

public float AbsMinBrakeTorqueScale { get; set; }

Property Value

float

AbsMinimumSpeedKmh

ABS stays inactive at parking speeds to avoid chatter right at a stop.

public float AbsMinimumSpeedKmh { get; set; }

Property Value

float

AbsReleaseRate

How quickly ABS restores brake torque after wheel speed recovers (1/s).

public float AbsReleaseRate { get; set; }

Property Value

float

AbsSlipRatioTarget

Target braking slip-ratio magnitude taken from the active JBeam brake definition.

public float AbsSlipRatioTarget { get; set; }

Property Value

float

AbsSlipRatioWindow

Slip-ratio window above the ABS target over which brake torque ramps down to the minimum scale.

public float AbsSlipRatioWindow { get; set; }

Property Value

float

AirRegulatorTemperature

Thermostat target temperature (°C) — the engine's normal operating temperature.

public float AirRegulatorTemperature { get; set; }

Property Value

float

AutoClutchLaunchRpm

Auto-clutch launch hold RPM used to let the engine build torque from a stop.

public float AutoClutchLaunchRpm { get; set; }

Property Value

float

AutoClutchMinTorqueScale

Minimum fraction of engine torque the automatic clutch still transmits while limiting excessive grounded wheelspin.

public float AutoClutchMinTorqueScale { get; set; }

Property Value

float

AutoClutchWheelspinWindowRpm

Equivalent engine-RPM window of excess driven-wheel spin over which the automatic clutch reduces transmitted torque to stop a full-throttle launch becoming a sustained burnout.

public float AutoClutchWheelspinWindowRpm { get; set; }

Property Value

float

BrakeInput

Filtered combined brake input (0–1).

public float BrakeInput { get; }

Property Value

float

BrakeMotorForce

Brake motor force — how hard wheels resist rotation when braking.

public float BrakeMotorForce { get; set; }

Property Value

float

BreakWheels

Gets or sets the list of entities representing wheels that have brakes applied.

public List<Entity> BreakWheels { get; set; }

Property Value

List<Entity>

BurnEfficiencyThrottle

Burn efficiency throttle axis (0–1). Pair with BurnEfficiencyValues.

public float[] BurnEfficiencyThrottle { get; set; }

Property Value

float[]

BurnEfficiencyValues

Burn efficiency values (0–1) corresponding to each throttle point.

public float[] BurnEfficiencyValues { get; set; }

Property Value

float[]

CarBody

Gets or sets the entity representing the car's main chassis body.

public Entity CarBody { get; set; }

Property Value

Entity

ChassisYawAssist

Minimal parking-speed yaw helper. It only tops up initial rotation until tyre forces and suspension load transfer take over.

public float ChassisYawAssist { get; set; }

Property Value

float

CurrentGear

Currently selected gear (0 = reverse, 1 = first, etc.).

public int CurrentGear { get; }

Property Value

int

DriveInput

Combined drive demand (throttle - brake).

public float DriveInput { get; }

Property Value

float

DriveRatio

Total drive ratio from engine to wheel (including gear and final drive).

public float DriveRatio { get; }

Property Value

float

DriveWheels

Gets or sets the list of entities representing wheels that are driven by the engine.

public List<Entity> DriveWheels { get; set; }

Property Value

List<Entity>

DrivelineRpm

Effective driveline RPM before final drive.

public float DrivelineRpm { get; }

Property Value

float

DrivenWheelSlipRatio

Current maximum slip ratio across all driven wheels.

public float DrivenWheelSlipRatio { get; }

Property Value

float

Dynamics

Vehicle dynamics system computing tyre forces, load transfer, differentials, and anti-roll bar effects. Created during Start() and updated each frame.

public VehicleDynamicsSystem? Dynamics { get; set; }

Property Value

VehicleDynamicsSystem

EngineBlockAirCoolingEfficiency

Air cooling efficiency coefficient from JBeam.

public float EngineBlockAirCoolingEfficiency { get; set; }

Property Value

float

EngineBlockTempDamageThreshold

Engine block temperature at which damage begins (°C).

public float EngineBlockTempDamageThreshold { get; set; }

Property Value

float

EngineBrakeTorque

Engine braking torque applied when throttle is lifted (N·m).

public float EngineBrakeTorque { get; set; }

Property Value

float

EngineDynamicFriction

Friction term proportional to engine angular velocity (N·m per rad/s).

public float EngineDynamicFriction { get; set; }

Property Value

float

EngineFriction

Constant engine friction torque (N·m).

public float EngineFriction { get; set; }

Property Value

float

EngineInertia

Engine + flywheel rotational inertia (kg·m²). Governs rev-response speed.

public float EngineInertia { get; set; }

Property Value

float

EngineRpm

Current engine RPM.

public float EngineRpm { get; }

Property Value

float

EngineTemp

Current engine block temperature (°C). Settles at the air-regulator setpoint.

public float EngineTemp { get; }

Property Value

float

FinalDrive

Final drive (differential) ratio.

public float FinalDrive { get; set; }

Property Value

float

ForwardSpeedMs

Forward velocity in m/s.

public float ForwardSpeedMs { get; }

Property Value

float

FrontCamberGainPerMeter

Front camber gain in bump/rebound (rad/m). Negative values add negative camber in bump.

public float FrontCamberGainPerMeter { get; set; }

Property Value

float

FrontStaticCamberRadians

Static front-axle camber angle (rad), sourced from JBeam alignment settings.

public float FrontStaticCamberRadians { get; set; }

Property Value

float

FuelCapacityLiters

Fuel tank capacity (litres). Zero when no tank is defined.

public float FuelCapacityLiters { get; set; }

Property Value

float

FuelLiters

Remaining fuel (litres).

public float FuelLiters { get; }

Property Value

float

GearRatios

Forward gear ratios indexed 1–N (index 0 = reverse).

public float[] GearRatios { get; set; }

Property Value

float[]

HandbrakeEngaged

Whether the handbrake is currently engaged.

public bool HandbrakeEngaged { get; }

Property Value

bool

HandbrakeForceMultiplier

Extra rear brake force multiplier for the handbrake so it can lock the rear axle.

public float HandbrakeForceMultiplier { get; set; }

Property Value

float

HasTurbo

Whether this engine has a turbocharger.

public bool HasTurbo { get; set; }

Property Value

bool

IdleRpm

Idle RPM (minimum engine speed).

public float IdleRpm { get; set; }

Property Value

float

LateralGrip

Legacy grip tuning value, now used as the soft-body tyre model's low-speed damping gain.

public float LateralGrip { get; set; }

Property Value

float

LateralSpeedMs

Lateral velocity in m/s (slip speed).

public float LateralSpeedMs { get; }

Property Value

float

MaxRpm

Max engine RPM (redline).

public float MaxRpm { get; set; }

Property Value

float

MaxSteerAngle

Maximum steering wheel lock angle (radians). ~0.52 rad ≈ 30°.

public float MaxSteerAngle { get; set; }

Property Value

float

OilPressure

Current oil pressure (bar). Correlates with RPM and oil volume.

public float OilPressure { get; }

Property Value

float

OilTemp

Current oil temperature (°C). Lags slightly behind engine block temp.

public float OilTemp { get; }

Property Value

float

OilVolumeLiters

Engine oil volume (litres) from JBeam. Used for thermal mass calculation.

public float OilVolumeLiters { get; set; }

Property Value

float

PlayerInputEnabled

Allows UI systems to temporarily block player input without pausing physics.

public bool PlayerInputEnabled { get; set; }

Property Value

bool

RearCamberGainPerMeter

Rear camber gain in bump/rebound (rad/m). Negative values add negative camber in bump.

public float RearCamberGainPerMeter { get; set; }

Property Value

float

RearStaticCamberRadians

Static rear-axle camber angle (rad), sourced from JBeam alignment settings.

public float RearStaticCamberRadians { get; set; }

Property Value

float

ReverseEngageSpeedKmh

Vehicle speed below which holding brake can select reverse gear.

public float ReverseEngageSpeedKmh { get; set; }

Property Value

float

ServiceBrakeInput

Filtered service brake input (0–1).

public float ServiceBrakeInput { get; }

Property Value

float

ShiftDownRpm

RPM to downshift at (auto-transmission).

public float ShiftDownRpm { get; set; }

Property Value

float

ShiftSlipAllowanceRpm

Maximum extra RPM that driven-wheel slip may contribute above road-speed RPM for shifting and torque coupling.

public float ShiftSlipAllowanceRpm { get; set; }

Property Value

float

ShiftUpRpm

RPM to upshift at (auto-transmission).

public float ShiftUpRpm { get; set; }

Property Value

float

SpeedKmh

Current vehicle speed in km/h.

public float SpeedKmh { get; }

Property Value

float

StartingFuelLiters

Initial fuel load (litres), resolved from JBeam startingFuelCapacity.

public float StartingFuelLiters { get; set; }

Property Value

float

SteerRate

Angular rate at which front wheels steer (rad/s).

public float SteerRate { get; set; }

Property Value

float

SteerWheels

Gets or sets the list of entities representing wheels that can be steered.

public List<Entity> SteerWheels { get; set; }

Property Value

List<Entity>

SteeringInput

Filtered steering input (-1 to 1).

public float SteeringInput { get; }

Property Value

float

SteeringRack

Current steering rack position (radians).

public float SteeringRack { get; }

Property Value

float

ThrottleInput

Filtered throttle input (0–1).

public float ThrottleInput { get; }

Property Value

float

TorqueCurveNm

Torque (N·m at crank) corresponding to each RPM in TorqueCurveRpm.

public float[] TorqueCurveNm { get; set; }

Property Value

float[]

TorqueCurveRpm

RPM axis of the engine torque curve.

public float[] TorqueCurveRpm { get; set; }

Property Value

float[]

TractionControlActive

Whether traction control is actively reducing torque.

public bool TractionControlActive { get; }

Property Value

bool

TractionControlApplyRate

How quickly TCS removes torque once excess driven-wheel slip is detected (1/s).

public float TractionControlApplyRate { get; set; }

Property Value

float

TractionControlEnabled

Enables engine-side traction control based on driven-wheel wheelspin.

public bool TractionControlEnabled { get; set; }

Property Value

bool

TractionControlMinTorqueScale

Minimum fraction of engine torque that TCS still allows through when fully active.

public float TractionControlMinTorqueScale { get; set; }

Property Value

float

TractionControlMinimumSpeedKmh

TCS stays inactive right at crawl speed where slip-ratio estimates are numerically noisy.

public float TractionControlMinimumSpeedKmh { get; set; }

Property Value

float

TractionControlReleaseRate

How quickly TCS restores torque after wheel slip recovers (1/s).

public float TractionControlReleaseRate { get; set; }

Property Value

float

TractionControlSlipRatioTarget

Driven-wheel slip ratio target sourced from the active BeamNG traction-control definition.

public float TractionControlSlipRatioTarget { get; set; }

Property Value

float

TractionControlSlipRatioWindow

Slip-ratio window above the TCS target over which torque reduction reaches the minimum scale.

public float TractionControlSlipRatioWindow { get; set; }

Property Value

float

TractionControlTorqueScale

Current torque scale factor applied by traction control (0–1).

public float TractionControlTorqueScale { get; }

Property Value

float

TractionLossDetected

Whether significant wheel slip is detected on any wheel.

public bool TractionLossDetected { get; }

Property Value

bool

TractionLossSlipThreshold

Driven-wheel slip ratio above which the HUD traction warning lamp turns on.

public float TractionLossSlipThreshold { get; set; }

Property Value

float

TurboBoostBar

Current turbo boost pressure (bar). Zero when no turbo is present.

public float TurboBoostBar { get; }

Property Value

float

TurboMaxBoostPsi

Maximum turbo boost pressure in PSI (from wastegate setting).

public float TurboMaxBoostPsi { get; set; }

Property Value

float

WheelRadius

Wheel radius used to convert speed to spin rate (m).

public float WheelRadius { get; set; }

Property Value

float

Wheels

Gets or sets the list of entities representing all wheels on the vehicle.

public List<Entity> Wheels { get; set; }

Property Value

List<Entity>

YawRateRad

Yaw rate in radians per second.

public float YawRateRad { get; }

Property Value

float

Methods

Start()

Initializes runtime drivetrain, thermal, and wheel-surface state for the loaded rally car.

public override void Start()

Update()

Advances the rally car simulation, input handling, and telemetry for the current frame.

public override void Update()