Skip to content
CRUSHFORMV1.1.0
GET IT ON FAB

REFERENCECOMPONENTS

UCFVehicleAdapterComponent

MODULECrushformVehicleINCLUDECFVehicleAdapterComponent.hPARENTUActorComponent

Blueprint: Crushform Vehicle Adapter

Puts Crushform on a vehicle without code. Added to any actor, it creates the dents and dirt, the glass, the tyres, the rolling sound and FX, the engine sound, the prop breaking and the impact feedback, and answers their questions about the vehicle: which machine simulates it, where its wheels touch the ground, which meshes are wheels, how its engine runs (the engine events below, which a subclass or a Blueprint overrides). Every machine creates the same components under the same names, so the replicated ones stand for each other. This generic adapter traces the wheels picked in Wheels; an adapter for a vehicle system (UCFChaosVehicleAdapterComponent) reads that system's wheels instead. A tyre that presses onto an obstacle pushes its wheel off it through the adapter, which holds the push on the wheel's mesh until the tyre asks again; a Blueprint that overrides SetCrushformTireWheelOffsets places the wheels itself and turns that push off. A wheel whose parent turns against the car, such as a steering knuckle, gets the wrong push while it turns.

Functions

AUTHORITY · server, every machineLOCAL · this machinePURE · read only
ECFEngineRunState GetEngineRunState() const
PURE

Whether the engine is off, cranking or running. This adapter: off; a vehicle-system adapter or a Blueprint subclass answers.

Category
Crushform|Engine
float GetEngineRPM() const
PURE

Engine speed, rpm. This adapter: 0.

Category
Crushform|Engine
float GetEngineIdleRPM() const
PURE

Idle speed, rpm: a running engine is never heard below it. This adapter: 0.

Category
Crushform|Engine
float GetEngineMaxRPM() const
PURE

The highest engine speed, rpm; 0: no limit. This adapter: 0.

Category
Crushform|Engine
float GetEngineLoad() const
PURE

Throttle, 0..1. This adapter: 0.

Category
Crushform|Engine
void BuildWheelContacts(TArray<FCFWheelContact>& OutContacts)

The frame's wheels, once per frame in the tick. This adapter traces its wheel list; an adapter for a vehicle system overrides it, in C++ or in a Blueprint subclass, as it does the three below.

Category
Crushform|Vehicle
void CollectWheelMeshes(TArray<UMeshComponent*>& OutMeshes) const
PURE

The wheels' meshes: tyres, wheel dirt, and the meshes the body does not deform. This adapter: the meshes of its wheel list.

Category
Crushform|Vehicle
void BuildTireWheels(TArray<FCFTireWheelDesc>& OutWheels) const
PURE

The tyres' wheels, each with its mesh, physics radius, HostIndex, offset now and bAcceptsPush. This adapter: its wheel list, accepting the push unless a Blueprint subclass scripts SetCrushformTireWheelOffsets (AcceptsTirePush).

Category
Crushform|Vehicle
void BuildLoadRatios(TArray<float>& OutRatios) const
PURE

Contact force over nominal load by HostIndex; this adapter has no force model and gives none.

Category
Crushform|Vehicle
void SetWheels(const TArray<FCFAdapterWheelState>& InWheels)

Replaces the wheels picked in Wheels, for wheels made at runtime. Can be called before BeginPlay.

Category
Crushform
void SetBraking(float Amount)

How hard the vehicle brakes, 0..1, on every wheel: the rolling FX throw more while braking.

Category
Crushform
void SetCabinMuffled(bool bMuffled)

Muffles the rolling sound and the engine sound while the listener sits in this vehicle's cabin: the adapter's cabin values when bOverrideCabinMuffling, else the Crushform Wheels settings' for the wheels and the Crushform Engine settings' for the engine.

Category
Crushform
UCFDeformComponent* GetDeform() const
PURE

The deform component that dents the body; null without Dirt And Dents.

Category
Crushform
UCFGlassUnitsComponent* GetGlass() const
PURE

The component that holds the vehicle's glass panes; null unless both Glass and Dirt And Dents are on.

Category
Crushform
UCFTireComponent* GetTires() const
PURE

The tire component; null without Tires.

Category
Crushform
UCFPropContactComponent* GetPropContact() const
PURE

The component that breaks props the vehicle drives into; null without Breaks Props.

Category
Crushform
UCFNetImpactFeedbackComponent* GetImpactFeedback() const
PURE

The body's impact feedback component; null without Impact Feedback.

Category
Crushform
UCFPartImpactFeedbackComponent* GetPartImpactFeedback() const
PURE

The impact feedback component of the hinged parts; null unless both Impact Feedback and Dirt And Dents are on.

Category
Crushform
UCFRollingAudioComponent* GetRollingAudio() const
PURE

The rolling sound component; null without Rolling Sound.

Category
Crushform
UCFRollingFXComponent* GetRollingFX() const
PURE

The rolling effects component; null without Rolling FX.

Category
Crushform
UCFEngineAudioComponent* GetEngineAudio() const
PURE

The engine sound component; null without Engine Sound.

Category
Crushform
FCFDamageZones GetDamageZones() const
PURE

The deform component's Get Damage Zones: how dented each side of the body is, as the server confirmed it. All zero without Dirt And Dents.

Category
Crushform|Damage
FCFDamageValues GetDamageInBox(const FBox& Box) const
PURE

The deform component's Get Damage In Box: the damage in a box of the owner's root space. All zero without Dirt And Dents.

Category
Crushform|Damage
int32 GetWheelGatherCount() const
PUREC++ ONLY

How many times the frame's wheels were built (BuildWheelContacts); tests count it.

Properties

ECFAuthorityModel Authority = ECFAuthorityModel::Server

Which machine simulates the vehicle and judges its hits.

Default
ECFAuthorityModel::Server
Category
Crushform
TObjectPtr<UCFProfile> DeformProfile

Dents and dirt of the body; empty: the project's default (Project Settings -> Plugins -> Crushform).

Category
Crushform
TObjectPtr<UCFTireProfile> TireProfile

The tyres; empty: the project's default (Project Settings -> Plugins -> Crushform Tire).

Category
Crushform
bool bDirtAndDents = true

The body dents and gets dirty (UCFDeformComponent); the glass panes and the wheels' dirt need it.

Default
true
Category
Crushform|Features
bool bGlass = true

Glass panes (UCFGlassComponent) on the vehicle crack and break; needs Dirt And Dents, which finds the panes.

Default
true
Category
Crushform|Features
bool bTires = true

The tyres deform on the wheel meshes (UCFTireComponent).

Default
true
Category
Crushform|Features
bool bRollingSound = true

Each wheel plays its surface's rolling sound (UCFRollingAudioComponent); presentation only, silent on a dedicated server.

Default
true
Category
Crushform|Features
bool bRollingFX = true

Each wheel shows its surface's rolling effect (UCFRollingFXComponent); presentation only, none on a dedicated server.

Default
true
Category
Crushform|Features
bool bEngineSound = true

The engine plays its sound (UCFEngineAudioComponent) from the engine events below; presentation only, silent on a dedicated server.

Default
true
Category
Crushform|Features
bool bImpactFeedback = true

Hits play impact sounds and effects on every machine (UCFNetImpactFeedbackComponent); with Dirt And Dents the hinged parts' hits and slams play too, on each machine from its own physics (UCFPartImpactFeedbackComponent).

Default
true
Category
Crushform|Features
bool bBreaksProps = true

The vehicle breaks the breakable props it drives into (UCFPropContactComponent).

Default
true
Category
Crushform|Features
TArray<FCFAdapterWheel> Wheels

The wheels this generic adapter traces; an adapter for a vehicle system reads that system's wheels and ignores this.

Category
Crushform|Wheels
TEnumAsByte<ECollisionChannel> GroundChannel = ECC_Visibility

The channel the wheels trace the ground on.

Default
ECC_Visibility
Category
Crushform|Wheels
float GroundProbeMargin = 2.f

A tyre this far above the ground still touches it, cm: the trace starts at the hub, not at the tread.

Default
2.f
Category
Crushform|Wheels
FGameplayTag ImpactEventTag

What the impact feedback plays on a crash: the plugin's Crushform.Impact.Vehicle.Crash by default; empty: no impact sound.

Category
Crushform|Impact
float ImpactImpulsePerKgForFullIntensity = 600.f

The velocity change of a hit that plays at full strength, cm/s; read when the adapter makes its impact feedback. Same default as UCFImpactFeedbackComponent.

Default
600.f
Category
Crushform|Impact
float ImpactMinImpulsePerKg = 50.f

The velocity change below which a hit plays nothing, cm/s; read when the adapter makes its impact feedback. Same default as UCFImpactFeedbackComponent.

Default
50.f
Category
Crushform|Impact
float PropContactMinSpeedCmS = 50.f

Below this speed the vehicle breaks no props, cm/s; read when the adapter makes its prop contact. Same default as UCFPropContactComponent.

Default
50.f
Category
Crushform|Props
bool bOverrideRollingSoundTuning = false

The rolling sound of this vehicle uses Rolling Sound Tuning instead of the Crushform Wheels settings' Tuning; read when the adapter makes its rolling sound.

Default
false
Category
Crushform|Rolling Sound
FCFRollingAudioTuning RollingSoundTuning
Category
Crushform|Rolling Sound
bool bOverrideCabinMuffling = false

Set Cabin Muffled uses this vehicle's Cabin Volume Scale and Cabin Low Pass Frequency instead of the Crushform Wheels and Crushform Engine settings'. It muffles the rolling sound and the engine sound alike.

Default
false
Category
Crushform|Cabin
float CabinVolumeScale = 0.8f
Default
0.8f
Category
Crushform|Cabin
float CabinLowPassFrequency = 3000.f
Default
3000.f
Category
Crushform|Cabin
bool bOverrideRollingFXTuning = false

The rolling FX of this vehicle use Rolling FX Tuning instead of the Crushform Wheels settings' FX Tuning; read when the adapter makes its rolling FX.

Default
false
Category
Crushform|Rolling FX
FCFRollingFXTuning RollingFXTuning
Category
Crushform|Rolling FX
TObjectPtr<UCFEngineSoundProfile> EngineSoundProfile

The engine's sound; empty: the project's default (Project Settings -> Plugins -> Crushform Engine). Read when the adapter makes its engine sound.

Category
Crushform|Engine Sound
FVector EngineSoundOffset = FVector::ZeroVector

Where the engine sound plays, relative to the owner's root; read when the adapter makes its engine sound.

Default
FVector::ZeroVector
Category
Crushform|Engine Sound
float RamAllowanceMps = 15.f

With the Owning Client authority model: how much faster, m/s, than the vehicle's recent peak speed a client-reported hit may be before the server rejects it.

Default
15.f
Category
Crushform

Events

FCFOnDamageChangedDynamicDelegate OnDamageChanged
(const FCFDamageZones& Zones)

The deform component's On Damage Changed, handed on: the adapter makes that component itself when it registers, so a Blueprint binds the event here. Never fires without Dirt And Dents.

Category
Crushform|Damage