Skip to content
CRUSHFORMV1.1.0
GET IT ON FAB

REFERENCECOMPONENTS

UCFRollingAudioComponent

MODULECrushformWheelINCLUDECFRollingAudioComponent.hPARENTUSceneComponent

Per-wheel tyre rolling sound. Every wheel has a voice that follows the surface under it and crossfades between two sound slots; each slot is played by its own UAudioComponent on the wheel's AttachTo (socket AttachSocket) or, without one, under this component at the wheel's contact point. The wheels and the surface come from the owner's wheel host (ICFWheelHost), a surface's sound from its row in UCFSettings::Surfaces, and the tuning from UCFWheelSettings unless bOverrideTuning, so a body needs no setup beyond owning this component. Presentation only: idle on a dedicated server and writes no physics.

Functions

AUTHORITY · server, every machineLOCAL · this machinePURE · read only
bool IsActiveForNetMode(ENetMode NetMode)
C++ ONLY

False only for a dedicated server, which has no listener to hear a tyre.

void SetCrushformHost(UObject* NewHost)
C++ ONLY

Sets who answers ICFWheelHost for the owner; null means the registry's host for the owner. Call before BeginPlay: a later call is refused.

UObject* GetCrushformHost() const
PUREC++ ONLY

The explicit host, else UCFHostRegistry::FindHost(Owner, UCFWheelHost).

void SetCabinMuffling(bool bInMuffled, float InVolumeScale, float InLowPassFrequency)
LOCAL

Muffles the rolling sound for a listener inside the cab. InVolumeScale multiplies the volume while muffled, InLowPassFrequency is the cutoff in Hz. Local to this machine. The volume follows on the next tick; the low-pass filter applies at once.

Category
Crushform|Rolling Sound
bool IsCabinMuffled() const
PURE

Whether the rolling sound is muffled for a listener inside the cab.

Category
Crushform|Rolling Sound
const FCFRollingAudioTuning& GetTuning() const
PUREC++ ONLY

The tuning in use: OverrideTuning when bOverrideTuning, else UCFWheelSettings::Tuning; read in BeginPlay.

float GetCabinVolumeScale() const
PUREC++ ONLY

The volume scale and low-pass frequency SetCabinMuffling last gave.

float GetCabinLowPassFrequency() const
PUREC++ ONLY

The low-pass cutoff in Hz that SetCabinMuffling last gave.

const TArray<FCFRollingVoice>& GetVoices() const
PUREC++ ONLY

One voice per wheel, indexed by WheelIndex: grows to the largest index the host has reported.

UAudioComponent* GetVoiceAudio(int32 WheelIndex, int32 Slot) const
PUREC++ ONLY

The audio component playing one slot (0 or 1) of one wheel's voice; nullptr until that slot first has something to play.

void SetAudibilityOverrideForTest(TOptional<bool> InOverride)
C++ ONLY

Tests only. An unset override restores the real check; a set one answers the listener-in-range question.

void SetWheelSpeedOverrideForTest(TOptional<float> InSpeedKPH)
C++ ONLY

Tests only. An unset override restores the real wheel speed; a set one is the speed (km/h) of every wheel.

Properties

bool bOverrideTuning = false

Uses this component's Override Tuning instead of UCFWheelSettings::Tuning. Read in BeginPlay.

Default
false
Category
Crushform|Rolling Sound
FCFRollingAudioTuning OverrideTuning

The tuning used when Override Tuning is on.

Category
Crushform|Rolling Sound