REFERENCECOMPONENTS
UCFEngineAudioComponent
Blueprint: Crushform Engine Audio
An engine's sound: the loops of a UCFEngineSoundProfile crossfaded and pitched by the engine speed, louder under load, with a starter while the engine cranks, a rise when it starts, a fade and a shutdown sound when it stops. The engine comes from the owner's ICFEngineHost (the explicit host, else UCFHostRegistry::FindHost), read once a frame. Each sound plays from its own UAudioComponent under this one, so this component goes where the engine is. Transitions follow the host's state every frame, not an event, so an engine that started or stopped out of earshot is heard as it is when the listener comes back. Presentation only: idle on a dedicated server.
Functions
False only for a dedicated server, which has no listener to hear an engine.
Sets who answers ICFEngineHost for the owner; null means the registry's host for the owner. Call before BeginPlay: a later call, or an object that does not implement ICFEngineHost, is refused with a log line.
The explicit host, else UCFHostRegistry::FindHost(Owner, UCFEngineHost).
Muffles the engine for a listener inside the cab (UCFVehicleAdapterComponent::SetCabinMuffled calls this when the listener enters or leaves). InVolumeScale is clamped to 0..1 and multiplies the volume while muffled; InLowPassFrequency is the cutoff in Hz. The volume follows on the next tick; the low-pass filter applies at once.
- Category
- Crushform|Engine Sound
Whether the engine is muffled for a listener inside the cab.
- Category
- Crushform|Engine Sound
The volume scale and low-pass frequency SetCabinMuffling last gave.
The low-pass cutoff in Hz that SetCabinMuffling last gave.
The profile in use: Profile, else UCFEngineSettings::DefaultProfile. Null before BeginPlay and while the sound is off.
The loops in play order: the profile's layers that have a sound, sorted by RPM.
The recorded engine speed of a loop in play order, RPM; 0 for an index out of range.
The audio component playing one loop; nullptr until that loop is first heard or for an index out of range.
The starter's and the shutdown's audio components; nullptr until first played.
Whether the starter sound is meant to play: the engine cranks and the profile has one.
How many times the shutdown sound was started.
The heard engine speed, RPM.
The heard load, 0..1.
How far the loops have risen: 0 silent, 1 running.
Tests only. An unset override restores the real check; a set one answers the listener-in-range question.
Properties
The engine's sound; empty: Project Settings > Plugins > Crushform Engine > Default Profile. Read in BeginPlay.
- Category
- Crushform|Engine Sound