An easing curve is a collection of points that define a curve. The points are arranged by ascending time.
More...
#include <EasingCurve.h>
|
| struct | Point |
| | A single point in the easing curve. Both m_time and m_value are in the range [0, 1]. More...
|
| |
|
| enum class | PointInterpolationMode : AZ::u8 {
LINEAR = 0
, STEP
, CUBIC_IN
, CUBIC_OUT
,
SINE_IN
, SINE_OUT
, CIRCLE_IN
, CIRCLE_OUT
} |
| |
|
|
| AZ_CLASS_ALLOCATOR (EasingCurve, AZ::SystemAllocator, 0) |
| |
|
| AZ_TYPE_INFO (EasingCurve, "{D4B7E91C-DD02-423E-B8BC-699E0DFC249B}") |
| |
|
| EasingCurve (const EasingCurve &)=default |
| |
|
| EasingCurve (EasingCurve &&)=default |
| |
|
EasingCurve & | operator= (const EasingCurve &)=default |
| |
|
EasingCurve & | operator= (EasingCurve &&)=default |
| |
| | EasingCurve (AZStd::initializer_list< Point > points) |
| | Construct an easing curve from a list of points.
|
| |
|
void | SetDefaultValue () |
| | Sets the default value for the easing curve.
|
| |
|
int64_t | GetNumPoints () const |
| | Returns the number of points in the easing curve.
|
| |
| Point | GetPoint (int64_t index) |
| |
| int64_t | UpdatePoint (int64_t index, Point point) |
| | Updates the point at the given index with the provided point data. (The point's index might be changed if it no longer fits in the same position after the update, but the point will still be updated with the new data)
|
| |
| int64_t | AddPoint (Point point) |
| |
| void | RemovePoint (int64_t index) |
| |
|
void | Clear () |
| | Removes all points from the easing curve.
|
| |
| float | Evaluate (float time) const |
| |
| int64_t | GetClosetPoint (float time, float value) |
| |
|
|
static void | Reflect (AZ::ReflectContext *context) |
| |
| static float | Interpolate (const Point &start, const Point &end, float time) |
| |
An easing curve is a collection of points that define a curve. The points are arranged by ascending time.
◆ EasingCurve()
| AzFramework::EasingCurve::EasingCurve |
( |
AZStd::initializer_list< Point > |
points | ) |
|
Construct an easing curve from a list of points.
This constructor will add all points in the given list to the easing curve and then sort them.
◆ AddPoint()
| int64_t AzFramework::EasingCurve::AddPoint |
( |
Point |
point | ) |
|
Adds a new point to the easing curve.
- Parameters
-
| point | The point to be added to the easing curve. |
◆ Evaluate()
| float AzFramework::EasingCurve::Evaluate |
( |
float |
time | ) |
const |
Evaluates the easing curve at the given time and returns the corresponding value.
- Parameters
-
| time | The time at which to evaluate the easing curve. |
- Returns
- The value of the easing curve at the given time.
◆ GetClosetPoint()
| int64_t AzFramework::EasingCurve::GetClosetPoint |
( |
float |
time, |
|
|
float |
value |
|
) |
| |
Finds the point in the curve that is closest to the given time and value.
- Parameters
-
| time | The time to compare against the points in the curve. |
| value | The value to compare against the points in the curve. |
- Returns
- A reference to the point in the curve that is closest to the given time and value.
◆ GetPoint()
| Point AzFramework::EasingCurve::GetPoint |
( |
int64_t |
index | ) |
|
Returns the point at the given index.
- Parameters
-
| index | The index of the point to retrieve. |
- Returns
- The point at the given index.
◆ Interpolate()
| static float AzFramework::EasingCurve::Interpolate |
( |
const Point & |
start, |
|
|
const Point & |
end, |
|
|
float |
time |
|
) |
| |
|
static |
Interpolates between the start and end points based on the given time and the interpolation mode of the end point.
- Parameters
-
| start | The start point of the interpolation. |
| end | The end point of the interpolation. |
| time | The time at which to interpolate between the start and end points. |
- Returns
- The interpolated value between the start and end points at the given time.
◆ RemovePoint()
| void AzFramework::EasingCurve::RemovePoint |
( |
int64_t |
index | ) |
|
Removes the point at the given index from the easing curve.
- Parameters
-
| index | The index of the point to be removed. |
◆ UpdatePoint()
| int64_t AzFramework::EasingCurve::UpdatePoint |
( |
int64_t |
index, |
|
|
Point |
point |
|
) |
| |
Updates the point at the given index with the provided point data. (The point's index might be changed if it no longer fits in the same position after the update, but the point will still be updated with the new data)
- Parameters
-
| index | The index of the point to be updated |
| point | The updated point data to replace the existing point at the specified index |
The documentation for this class was generated from the following file:
- Code/Framework/AzFramework/AzFramework/Math/EasingCurve.h