Struct VehicleControlData
Additional functionality for the Vehicle. Powertrain, drivetrain, steering and in general everything related to controling the vehicle movement and behavior.
Inherited Members
Namespace: Unity.Vehicles
Assembly: com.unity.vehicles.dll
Syntax
[Serializable]
public struct VehicleControlData : IComponentData, IQueryTypeParameter
Fields
AeroDownforceCoefficient
Aerodynamic downforce coefficient (Cl).
Declaration
public float AeroDownforceCoefficient
Field Value
Type | Description |
---|---|
float |
AeroDownforceImpulse
Total downforce impulse for the physics step.
Declaration
public float3 AeroDownforceImpulse
Field Value
Type | Description |
---|---|
float3 |
AeroDownforceOffset
Aero downforce application point offset from the vehicle center of mass.
Declaration
public float3 AeroDownforceOffset
Field Value
Type | Description |
---|---|
float3 |
AeroDownforcePosition
Position at which the downforce is applied.
Declaration
public float3 AeroDownforcePosition
Field Value
Type | Description |
---|---|
float3 |
AeroDragCoefficient
Coefficient of drag (Cd).
Declaration
public float AeroDragCoefficient
Field Value
Type | Description |
---|---|
float |
AeroDragImpulse
Total aerodynamic drag inpulse for the physics step.
Declaration
public float3 AeroDragImpulse
Field Value
Type | Description |
---|---|
float3 |
AeroDragOffset
Aero force application point offset from the vehicle center of mass.
Declaration
public float3 AeroDragOffset
Field Value
Type | Description |
---|---|
float3 |
AeroDragPosition
World position at which the aerodynamic srag is applied at. Determined by the vehicle center of mass and the drag offset value.
Declaration
public float3 AeroDragPosition
Field Value
Type | Description |
---|---|
float3 |
BrakePosition
Processed brake input. This value might correspond to the RawThrottleInput or RawBrakeInput, depending on the SwapThrottleAndBrakeInReverse value and the direction of the travel of the vehicle.
Declaration
public float BrakePosition
Field Value
Type | Description |
---|---|
float |
EngineAngularInertia
Angular inertia of the engine. Higher value will result in an engine that takes longer time to spin up/down.
Declaration
public float EngineAngularInertia
Field Value
Type | Description |
---|---|
float |
EngineAngularVelocity
Engine angular velocity in rad/s.
Declaration
public float EngineAngularVelocity
Field Value
Type | Description |
---|---|
float |
EngineAngularVelocityCalculation
Determines how the engine angular velocity is calculated from the wheel angular velocities. Maximum is recommended for vehicles with different wheel sizes. Minimum - only the slowest spinning driven wheel is taken into the account. Average - average of all the driven wheels. Maximum - only the fastest spinning driven wheel is taken into the account.
Declaration
public VehicleControlAuthoring.EngineAngularVelocityCalculationType EngineAngularVelocityCalculation
Field Value
Type | Description |
---|---|
VehicleControlAuthoring.EngineAngularVelocityCalculationType |
EngineBrakingIntensity
The amount of negative torque created by the engine due to the losses, expressed as a percentage of the maximum engine torque. Engine braking is only applied when there is not throttle input.
Declaration
public float EngineBrakingIntensity
Field Value
Type | Description |
---|---|
float |
EngineIdleAngularVelocity
Engine angular velocity at idle. Expressed in rad/s.
Declaration
public float EngineIdleAngularVelocity
Field Value
Type | Description |
---|---|
float |
EngineIsRunning
Is the engine running?
Declaration
public bool EngineIsRunning
Field Value
Type | Description |
---|---|
bool |
EngineMaxAngularVelocity
Maximum engine angular velocity at which it can generate torque. Expressed in rad/s.
Declaration
public float EngineMaxAngularVelocity
Field Value
Type | Description |
---|---|
float |
EngineMaxTorque
Maximum torque the engine can produce. The final torque value also depends on the EngineTorqueCurve.
Declaration
public float EngineMaxTorque
Field Value
Type | Description |
---|---|
float |
EngineStartOnThrottle
Should the engine be automatically started on throttle input?
Declaration
public bool EngineStartOnThrottle
Field Value
Type | Description |
---|---|
bool |
EngineTorque
Engine torque in N/m.
Declaration
public float EngineTorque
Field Value
Type | Description |
---|---|
float |
EngineTorqueCurve
Normalized torque curve representing engine angular velocity on the X axis and the torque on the Y axis.
Declaration
public BlobAssetReference<SampledCurve> EngineTorqueCurve
Field Value
Type | Description |
---|---|
BlobAssetReference<SampledCurve> |
MaxBrakeTorque
Maximum brake torque that can be applied to a wheel. Final wheel brake torque also depends on the brake coefficient for that wheel.
Declaration
public float MaxBrakeTorque
Field Value
Type | Description |
---|---|
float |
RelativeForwardSpeed
Speed relative to the surface the vehicle is on. Only surfaces with Rigidbody on them are taken into account.
Declaration
public float RelativeForwardSpeed
Field Value
Type | Description |
---|---|
float |
SteerSpeed
The speed of change of the steering angle.
Declaration
public float SteerSpeed
Field Value
Type | Description |
---|---|
float |
SteeringPosition
Processed steering input, with smoothing applied.
Declaration
public float SteeringPosition
Field Value
Type | Description |
---|---|
float |
SteeringSensitivityHighSpeed
The percentage of steering input at high speeds (SteeringSensitivitySpeedReference).
Declaration
public float SteeringSensitivityHighSpeed
Field Value
Type | Description |
---|---|
float |
SteeringSensitivityLowSpeed
The percentage of steering input at low speeds.
Declaration
public float SteeringSensitivityLowSpeed
Field Value
Type | Description |
---|---|
float |
SteeringSensitivitySpeedReference
The speed at which the SteeringSensitivityHighSpeed is in full effect. The steering sensitivity is lerped between the SteeringSensitivityLowSpeed and SteeringSensitivityHighSpeed from 0 to this value.
Declaration
public float SteeringSensitivitySpeedReference
Field Value
Type | Description |
---|---|
float |
SwapThrottleAndBrakeInReverse
Should the throttle and brake input be swapped when going in reverse? Usually true with the automatic transmission.
Declaration
public bool SwapThrottleAndBrakeInReverse
Field Value
Type | Description |
---|---|
bool |
ThrottlePosition
Processed throttle input. This value might correspond to the RawThrottleInput or RawBrakeInput, depending on the SwapThrottleAndBrakeInReverse value and the direction of the travel of the vehicle.
Declaration
public float ThrottlePosition
Field Value
Type | Description |
---|---|
float |
TransmissionCurrentGear
The gear the transmission is currently in.
Declaration
public int TransmissionCurrentGear
Field Value
Type | Description |
---|---|
int |
TransmissionCurrentGearRatio
Current total gear ratio. Equals to the gear ratio of the currently selected gear multiplied the final gear ratio.
Declaration
public float TransmissionCurrentGearRatio
Field Value
Type | Description |
---|---|
float |
TransmissionFinalGearRatio
A multiplier by which the forward and reverse gear ratios are multiplied. Commonly also called differential (diff) gear ratio.
Declaration
public float TransmissionFinalGearRatio
Field Value
Type | Description |
---|---|
float |
TransmissionForwardGearRatios
List of the gear ratios for forward gears. The list starts with the 1st gear (D1). The values should be in a descending order since the higher the gear, the lower the gear ratio.
Declaration
public FixedList128Bytes<float> TransmissionForwardGearRatios
Field Value
Type | Description |
---|---|
FixedList128Bytes<float> |
TransmissionIsAutomatic
Is the transmission automatic? Automatic transmission requires no user input for changing gears.
Declaration
public bool TransmissionIsAutomatic
Field Value
Type | Description |
---|---|
bool |
TransmissionReverseGearRatios
List of the gear ratios for the reverse gears. The list starts with the 1st reverse gear (R1). The values should be in a descending order.
Declaration
public FixedList128Bytes<float> TransmissionReverseGearRatios
Field Value
Type | Description |
---|---|
FixedList128Bytes<float> |
TransmissionShiftDownAngularVelocity
The angular velocity at which the automatic transmission will shift into a lower gear.
Declaration
public float TransmissionShiftDownAngularVelocity
Field Value
Type | Description |
---|---|
float |
TransmissionShiftUpAngularVelocity
The angular velocity at which the automatic transmission will shift into a higher gear.
Declaration
public float TransmissionShiftUpAngularVelocity
Field Value
Type | Description |
---|---|
float |
WheelAngularVelocityLimit
Wheel speed limiter, with braking applied once the set speed is exceeded. Set to 0 to deactivate.
Declaration
public float WheelAngularVelocityLimit
Field Value
Type | Description |
---|---|
float |
WheelSpeed
Speed of the vehicle calculated from the wheel angular velocity and radius. Which wheel or wheels are taken into account when calculating this speed depends on the EngineAngularVelocityCalculation.
Declaration
public float WheelSpeed
Field Value
Type | Description |
---|---|
float |