Search Results for

    Show / Hide Table of Contents

    Class BezierCurve<T>

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

    Inheritance
    System.Object
    CurveBase<T>
    BezierCurve<T>
    Inherited Members
    CurveBase<T>._accessor
    CurveBase<T>.WrapTime(Single, Single, Single, Boolean)
    CurveBase<T>.MarshalKeyframes<Keyframe>(Keyframe[])
    CurveBase<T>.MarshalKeyframes<Keyframe>(Byte[])
    Namespace: FlaxEngine
    Assembly: FlaxEngine.CSharp.dll
    Syntax
    public class BezierCurve<T> : CurveBase<T> where T : new()
    Type Parameters
    T

    The animated value type.

    Constructors

    BezierCurve()

    Initializes a new instance of the BezierCurve<T> class.

    Declaration
    public BezierCurve()

    BezierCurve(BezierCurve<T>.Keyframe[])

    Initializes a new instance of the BezierCurve<T> class.

    Declaration
    public BezierCurve(params BezierCurve<T>.Keyframe[] keyframes)
    Parameters
    BezierCurve.Keyframe<>[] keyframes

    The keyframes.

    BezierCurve(IEnumerable<BezierCurve<T>.Keyframe>)

    Initializes a new instance of the BezierCurve<T> class.

    Declaration
    public BezierCurve(IEnumerable<BezierCurve<T>.Keyframe> keyframes)
    Parameters
    System.Collections.Generic.IEnumerable<BezierCurve.Keyframe<>> keyframes

    The keyframes.

    Fields

    Keyframes

    The keyframes collection. Can be directly modified but ensure to sort it after editing so keyframes are organized by ascending time value.

    Declaration
    [Serialize]
    public BezierCurve<T>.Keyframe[] Keyframes
    Field Value
    BezierCurve.Keyframe<>[]

    Methods

    Evaluate(out T, Single, Boolean)

    Evaluates the animation curve value at the specified time.

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

    The interpolated value from the curve at provided time.

    System.Single time

    The time to evaluate the curve at.

    System.Boolean loop

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

    Overrides
    FlaxEngine.CurveBase<T>.Evaluate(T, System.Single, System.Boolean)

    EvaluateKey(out BezierCurve<T>.Keyframe, Single, Boolean)

    Evaluates the animation curve key at the specified time.

    Declaration
    public void EvaluateKey(out BezierCurve<T>.Keyframe result, float time, bool loop = true)
    Parameters
    BezierCurve.Keyframe<> result

    The interpolated key from the curve at provided time.

    System.Single time

    The time to evaluate the curve at.

    System.Boolean loop

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

    FindKeys(Single, out Int32, out Int32)

    Returns a pair of keys that can be used for interpolating to field the value at the provided time.

    Declaration
    public override void FindKeys(float time, out int leftKey, out int rightKey)
    Parameters
    System.Single time

    The time for which to find the relevant keys from. It is expected to be clamped to a valid range within the curve.

    System.Int32 leftKey

    The index of the key to interpolate from.

    System.Int32 rightKey

    The index of the key to interpolate to.

    Overrides
    FlaxEngine.CurveBase<T>.FindKeys(System.Single, System.Int32, System.Int32)

    TransformTime(Single, Single)

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

    Declaration
    public override void TransformTime(float timeScale, float timeOffset)
    Parameters
    System.Single timeScale

    The time scale.

    System.Single timeOffset

    The time offset.

    Overrides
    FlaxEngine.CurveBase<T>.TransformTime(System.Single, System.Single)

    Trim(Single, Single)

    Trims the curve keyframes to the specified time range.

    Declaration
    public override void Trim(float start, float end)
    Parameters
    System.Single start

    The time start.

    System.Single end

    The time end.

    Overrides
    FlaxEngine.CurveBase<T>.Trim(System.Single, System.Single)

    Operators

    Implicit(BezierCurve<T> to Byte[])

    Raw memory copy (used by scripting bindings - see MarshalAs tag).

    Declaration
    public static implicit operator byte[](BezierCurve<T> curve)
    Parameters
    BezierCurve<T> curve

    The curve to copy.

    Returns
    System.Byte[]

    The raw keyframes data.

    Implicit(Byte[] to BezierCurve<T>)

    Raw memory copy (used by scripting bindings - see MarshalAs tag).

    Declaration
    public static implicit operator BezierCurve<T>(byte[] raw)
    Parameters
    System.Byte[] raw

    The raw keyframes data.

    Returns
    BezierCurve<T>

    The curve.

    Extension Methods

    Extensions.ReflectiveCompare<T>(T, T)
    Extensions.DeepClone<T>(T)
    Extensions.RawClone<T>(T)
    In This Article
    • Constructors
      • BezierCurve()
      • BezierCurve(BezierCurve<T>.Keyframe[])
      • BezierCurve(IEnumerable<BezierCurve<T>.Keyframe>)
    • Fields
      • Keyframes
    • Methods
      • Evaluate(out T, Single, Boolean)
      • EvaluateKey(out BezierCurve<T>.Keyframe, Single, Boolean)
      • FindKeys(Single, out Int32, out Int32)
      • TransformTime(Single, Single)
      • Trim(Single, Single)
    • Operators
      • Implicit(BezierCurve<T> to Byte[])
      • Implicit(Byte[] to BezierCurve<T>)
    • Extension Methods
    Back to top Copyright © 2012-2024 Wojciech Figat