Component · physics
Vehicle
Four-wheel engine/automatic-gearbox vehicle, using S6's stable defaults.
Fields
halfExtents
vec3Chassis half extents.
default [0.9,0.2,2]m≥ 0.001
mass
f32Chassis mass.
default 1500kg≥ 0.001
wheelRadius
f32All four wheel radii.
default 0.35m≥ 0.001
wheelWidth
f32All four wheel widths.
default 0.2m≥ 0.001
suspensionMin
f32Minimum suspension length.
default 0.2m≥ 0
suspensionMax
f32Maximum suspension length.
default 0.5m≥ 0.001
suspensionFrequency
f32Suspension spring frequency.
default 1.5Hz≥ 0.001
suspensionDamping
f32Suspension damping ratio.
default 0.5≥ 0
maxSteerDeg
f32Front wheel steering lock.
default 30deg0 – 89
engineMaxTorque
f32Engine peak torque; Jolt's gearbox/engine curves supply the remaining defaults.
default 500N*m≥ 0.001
rearWheelDrive
boolRear-wheel drive; false selects front-wheel drive.
default true
layer
u32Chassis collision layer.
default 11 – 15
Usage
Every edit is an undoable command: from the CLI as below, or the same JSON from an agent over MCP. See component.add and property.set.
Add it
ara do component.add -p entity=name:Crate -p component=Vehicle --why "Add Vehicle"Set a field
ara do property.set -p entity=name:Crate -p path=Vehicle.halfExtents -p value=[0.9,0.2,2] --why "Tune Vehicle"In a scene document
{
"Vehicle": {
"halfExtents": [
0.9,
0.2,
2
]
}
}From C#
/// <summary>Increase a vehicle engine torque.</summary>
public static void UseVehicle(Entity entity, in Tick tick)
{
ref var component = ref World.Get<Vehicle>(entity);
component.EngineMaxTorque = 600f;
}From C#
Scripts read and write it with Get<Vehicle>(); see the Vehicle struct.