Struct Vehicle
Contains core vehicle data and settings needed for vehicle simulation. For vehicle controls check VehicleControl.
Inherited Members
Namespace: Unity.Vehicles
Assembly: com.unity.vehicles.dll
Syntax
public struct Vehicle : IComponentData, IQueryTypeParameter
Fields
BodyCollider
Vehicle physics collider.
Declaration
public BlobAssetReference<Collider> BodyCollider
Field Value
Type | Description |
---|---|
BlobAssetReference<Collider> |
ContactSurfaceNormalAngleThresholdCos
Cosine of angle threshold for collision smoothing between the vehicle and mesh colliders.
If, at a given contact point between the vehicle and a mesh collider, the angle between the contact normal and the mesh surface normal is larger than this threshold and does not exceed 90 degrees minus this threshold, the normal of the corresponding contact will be set to the surface normal, ensuring smooth collisions with the terrain surface.
Declaration
public float ContactSurfaceNormalAngleThresholdCos
Field Value
Type | Description |
---|---|
float |
Dimensions
Dimensions of the vehicle, expressed in m.
Declaration
public float3 Dimensions
Field Value
Type | Description |
---|---|
float3 |
HardTerrainFeatureAngleThresholdCos
Cosine of angle threshold for detecting hard terrain features.
Corresponds to a threshold on the delta angle between the inverted vehicle's velocity at a given contact point and the colliding terrain feature's surface normal. Any surface feature leading to a delta angle that is larger than the threshold will be considered a hard terrain feature and contacts with this feature will not be filtered, ensuring collisions with hard terrain features are retained, enabling accurate collision response.
Declaration
public float HardTerrainFeatureAngleThresholdCos
Field Value
Type | Description |
---|---|
float |
SubstepCount
Number of physics sub-steps. These are additional physics steps that the vehicle will use within one global physics step.
Declaration
public int SubstepCount
Field Value
Type | Description |
---|---|
int |
UseContactFiltering
Contact filtering
Declaration
public bool UseContactFiltering
Field Value
Type | Description |
---|---|
bool |