Ara
Download

Search or run a command

Jump to a section or open an Ara link.

Component · physics

Vehicle

Four-wheel engine/automatic-gearbox vehicle, using S6's stable defaults.

Fields

halfExtents

vec3
Chassis half extents.
default [0.9,0.2,2]m≥ 0.001

mass

f32
Chassis mass.
default 1500kg≥ 0.001

wheelRadius

f32
All four wheel radii.
default 0.35m≥ 0.001

wheelWidth

f32
All four wheel widths.
default 0.2m≥ 0.001

suspensionMin

f32
Minimum suspension length.
default 0.2m≥ 0

suspensionMax

f32
Maximum suspension length.
default 0.5m≥ 0.001

suspensionFrequency

f32
Suspension spring frequency.
default 1.5Hz≥ 0.001

suspensionDamping

f32
Suspension damping ratio.
default 0.5≥ 0

maxSteerDeg

f32
Front wheel steering lock.
default 30deg0 – 89

engineMaxTorque

f32
Engine peak torque; Jolt's gearbox/engine curves supply the remaining defaults.
default 500N*m≥ 0.001

rearWheelDrive

bool
Rear-wheel drive; false selects front-wheel drive.
default true

layer

u32
Chassis 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.