UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
AudioLinearCurve.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "Containers/Array.h"
6#include "Math/Vector2D.h"
7
8namespace Audio
9{
10 // A simple curve class that takes FVector2D points
11 // Required to decouple from Engine module
13 {
14 public:
15 FLinearCurve() = default;
18
19 virtual ~FLinearCurve() = default;
20
21 // Sets curve array
24
25 // Clears the points array
27
28 // Returns the number of points in the curve
29 int32 Num() const { return Points.Num(); }
30
31 // Adds individual points
34
35 // Retrieves curve array
37
38 // Evaluates the curve with the given domain.
39 // Returns false if the curve was incapable of evaluation (i.e. empty).
40 // Will clamp the output to the values of the domain
41 SIGNALPROCESSING_API bool Eval(float InDomain, float& OutValue) const;
42
43 private:
44
45 // Will sort the curve according to increasing domain values
46 SIGNALPROCESSING_API void Sort();
47 TArray<FVector2D> Points;
48 };
49}
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
Definition AudioLinearCurve.h:13
SIGNALPROCESSING_API void ClearPoints()
Definition AudioLinearCurve.cpp:32
SIGNALPROCESSING_API bool Eval(float InDomain, float &OutValue) const
Definition AudioLinearCurve.cpp:59
SIGNALPROCESSING_API void SetCurvePoints(const TArray< FVector2D > &InPoints)
Definition AudioLinearCurve.cpp:20
virtual ~FLinearCurve()=default
int32 Num() const
Definition AudioLinearCurve.h:29
SIGNALPROCESSING_API const TArray< FVector2D > & GetCurvePoints() const
Definition AudioLinearCurve.cpp:49
SIGNALPROCESSING_API void AddPoint(const FVector2D &InPoint)
Definition AudioLinearCurve.cpp:37
FLinearCurve()=default
SIGNALPROCESSING_API void AddPoints(const TArray< FVector2D > &InPoints)
Definition AudioLinearCurve.cpp:43
Definition Array.h:670
NO_LOGGING.
Definition AudioMixerPlatformAndroid.cpp:53