Search Results for

    Show / Hide Table of Contents

    Class Curve

    An animation spline represented by a set of keyframes, each representing an endpoint of a curve.

    Inheritance
    CurveBase
    Curve
    Inherited Members
    CurveBase::_default
    Curve
    CurveBase::CurveBase()
    CurveBase::CurveBase(const T& defaultValue)
    CurveBase::Evaluate(const KeyFrameData& data, T& result, float time, bool loop=true)
    CurveBase::EvaluateFirstDerivative(const KeyFrameData& data, T& result, float time, bool loop=true)
    CurveBase::EvaluateKey(const KeyFrameData& data, KeyFrame& result, float time, bool loop=true)
    CurveBase::FindKeys(const KeyFrameData& data, float time, int32& leftKey, int32& rightKey)
    CurveBase::GetDefaultValue()
    Curve
    Curve
    CurveBase::~CurveBase()
    Assembly: FlaxEngine.dll
    File: Engine/Animations/Curve.h
    Syntax
    public class Curve<T, KeyFrame> : public CurveBase
    Type Parameters
    T

    KeyFrame

    Constructors

    ~Curve()

    Finalizes an instance of the Curve class.

    Declaration
    public ~Curve()

    Curve()

    Initializes a new instance of the Curve class.

    Declaration
    public Curve()

    Curve(const KeyFrameCollection& keyframes)

    Initializes a new instance of the Curve class.

    Declaration
    public Curve(const KeyFrameCollection& keyframes)
    Parameters
    KeyFrameCollection keyframes

    The keyframes to initialize the curve with.

    Curve(const T& defaultValue)

    Initializes a new instance of the Curve class.

    Declaration
    public Curve(const T& defaultValue)
    Parameters
    T defaultValue

    The default keyframe value.

    operator Span<byte>()

    Declaration
    public operator Span<byte>()

    Methods

    Clear()

    Clears this keyframes collection.

    Declaration
    public void Clear()
    Returns
    void

    Evaluate(T& result, float time, bool loop=true)

    Evaluates the animation curve value at the specified time.

    Declaration
    public void Evaluate(T& result, float time, bool loop=true) const
    Parameters
    T result

    The interpolated value from the curve at provided time.

    float time

    The time to evaluate the curve at.

    bool loop

    If true the curve will loop when it goes past the end or beginning. Otherwise the curve value will be clamped.

    EvaluateFirstDerivative(T& result, float time, bool loop=true)

    Evaluates the first derivative of the animation curve at the specified time (aka velocity).

    Declaration
    public void EvaluateFirstDerivative(T& result, float time, bool loop=true) const
    Parameters
    T result

    The calculated first derivative from the curve at provided time.

    float time

    The time to evaluate the curve at.

    bool loop

    If true the curve will loop when it goes past the end or beginning. Otherwise the curve value will be clamped.

    EvaluateKey(KeyFrame& result, float time, bool loop=true)

    Evaluates the animation curve key at the specified time.

    Declaration
    public void EvaluateKey(KeyFrame& result, float time, bool loop=true) const
    Parameters
    KeyFrame result

    The interpolated key from the curve at provided time.

    float time

    The time to evaluate the curve at.

    bool loop

    If true the curve will loop when it goes past the end or beginning. Otherwise the curve value will be clamped.

    GetKeyframes()

    Gets the keyframes collection (for read-only).

    Declaration
    public KeyFrameCollection GetKeyframes() const
    Returns
    KeyFrameCollection

    GetLength()

    Gets the length of the animation curve, from time zero to last keyframe.

    Declaration
    public float GetLength() const
    Returns
    float

    GetMemoryUsage()

    Declaration
    public uint64 GetMemoryUsage() const
    Returns
    uint64

    IsEmpty()

    Determines whether this curve is empty (has no keyframes).

    Declaration
    public bool IsEmpty() const
    Returns
    bool

    operator[](int32 index)

    Declaration
    public KeyFrame operator[](int32 index)
    Parameters
    int32 index

    Returns
    KeyFrame

    operator=(const Span<byte>& raw)

    Declaration
    public Curve operator=(const Span<byte>& raw)
    Parameters
    Span<byte> raw

    Returns
    Curve

    operator==(const Curve& other)

    Declaration
    public bool operator==(const Curve& other) const
    Parameters
    Curve other

    Returns
    bool

    Resize(int32 count)

    Resizes the keyframes collection specified amount. Drops the data.

    Declaration
    public KeyFrame* Resize(int32 count)
    Parameters
    int32 count

    The count.

    Returns
    KeyFrame

    The keyframes memory pointer.

    SetKeyframes(const KeyFrameCollection& keyframes)

    Sets the keyframes collection.

    Declaration
    public void SetKeyframes(const KeyFrameCollection& keyframes)
    Parameters
    KeyFrameCollection keyframes

    The keyframes collection to assign.

    TransformTime(float timeScale, float timeOffset)

    Applies the linear transformation (scale and offset) to the keyframes time values.

    Declaration
    public void TransformTime(float timeScale, float timeOffset)
    Parameters
    float timeScale

    The time scale.

    float timeOffset

    The time offset.

    Trim(float start, float end)

    Trims the curve keyframes to the specified time range.

    Declaration
    public void Trim(float start, float end)
    Parameters
    float start

    The time start.

    float end

    The time end.

    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2012-2024 Wojciech Figat