float FModulatorContinuousParams::GetValue(const FActiveSound& ActiveSound) const { float ParamFloat = 0.f; if (!ActiveSound.GetFloatParameter(ParameterName, ParamFloat)) { ParamFloat = Default; } if(ParamMode == MPM_Direct) { return ParamFloat; } else if(ParamMode == MPM_Abs) { ParamFloat = FMath::Abs(ParamFloat); } float Gradient; if(MaxInput <= MinInput) { Gradient = 0.f; } else { Gradient = (MaxOutput - MinOutput)/(MaxInput - MinInput); } const float ClampedParam = FMath::Clamp(ParamFloat, MinInput, MaxInput); return MinOutput + ((ClampedParam - MinInput) * Gradient); }
float USoundNodeParamCrossFade::GetCurrentDistance(FAudioDevice* AudioDevice, FActiveSound& ActiveSound, const FSoundParseParameters& ParseParams) const { float ParamValue = 0.0f; ActiveSound.GetFloatParameter(ParamName, ParamValue); return ParamValue; }