Open Search
    BlendTweenInterface Class Reference

    #include <blend_animation.h>

    Inheritance diagram for BlendTweenInterface:

    Detailed Description

    The BlendTweenInterface allows to add a values animated by BlendAnimationInterface. Each BlendTweenInterface is a separated channel with it's own data type and start and end values.

    Public Member Functions

    MAXON_METHOD Result< DataGetMappedValue (Float xValue)
     
    MAXON_METHOD Result< void > SetNewTarget (const BlendFunctionRef &blendFunction, const Data &endValue)
     
    MAXON_METHOD Result< void > SetFunction (const BlendFunctionRef &blendFunction)
     
    MAXON_METHOD BlendFunctionRef GetFunction () const
     
    MAXON_METHOD Result< void > SetStart (const Data &value)
     
    MAXON_METHOD Result< DataGetStart () const
     
    MAXON_METHOD Result< void > SetEnd (const Data &value)
     
    MAXON_METHOD Result< DataGetEnd () const
     
     MAXON_OBSERVABLE (void, ObservableAnimation,(const BlendAnimationRef &anim, const BlendTweenRef &tween, ANIMBLENDSTATE state, const Data &animValue), ObservableCombinerRunAllComponent)
     

    Member Function Documentation

    ◆ GetMappedValue()

    MAXON_METHOD Result<Data> GetMappedValue ( Float  xValue)

    Calculates the value for the given x value.

    Parameters
    [in]xValueValue to be mapped with the given blend function, start and end value. The value is must be with in the 0.0 .. 1.0 range.

    ◆ SetNewTarget()

    MAXON_METHOD Result<void> SetNewTarget ( const BlendFunctionRef &  blendFunction,
    const Data endValue 
    )

    Allows to set a new target value for the BlendTweenInterface. The last value calculated by this tween will be used as the new start value. Warning: The BlendAnimationInterface should be canceled before calling this function and can be restarted afterwards. Otherwise the behavior is undefined.

    Parameters
    [in]blendFunctionBlend function to be used to reach the end value.
    [in]endValueNew end value.

    ◆ SetFunction()

    MAXON_METHOD Result<void> SetFunction ( const BlendFunctionRef &  blendFunction)

    Sets the blend function for this tween. Warning: The BlendAnimationInterface should be canceled before calling this function and can be restarted afterwards. Otherwise the behavior is undefined.

    Parameters
    [in]blendFunctionBlend function to be used. See BlendFunctions registry.

    ◆ GetFunction()

    MAXON_METHOD BlendFunctionRef GetFunction ( ) const

    Returns the current blend function.

    ◆ SetStart()

    MAXON_METHOD Result<void> SetStart ( const Data value)

    Sets the start value of this tween. Warning: The BlendAnimationInterface should be canceled before calling this function and can be restarted afterwards. Otherwise the behavior is undefined.

    Parameters
    [in]valueStart value to be used.

    ◆ GetStart()

    MAXON_METHOD Result<Data> GetStart ( ) const

    Returns the current start value.

    ◆ SetEnd()

    MAXON_METHOD Result<void> SetEnd ( const Data value)

    Sets the end value of this tween. Warning: The BlendAnimationInterface should be canceled before calling this function and can be restarted afterwards. Otherwise the behavior is undefined.

    Parameters
    [in]valueEnd value to be used.

    ◆ GetEnd()

    MAXON_METHOD Result<Data> GetEnd ( ) const

    Returns the current end value.

    ◆ MAXON_OBSERVABLE()

    MAXON_OBSERVABLE ( void  ,
    ObservableAnimation  ,
    (const BlendAnimationRef &anim, const BlendTweenRef &tween, ANIMBLENDSTATE state, const Data &animValue)  ,
    ObservableCombinerRunAllComponent   
    )

    Observable which is triggered for each BlendAnimationInterface timer event. It's only guaranteed that ANIMBLENDSTATE::FINISHED or ANIMBLENDSTATE::CANCELED is triggered. ANIMBLENDSTATE::STARTED and ANIMBLENDSTATE::RUNNING are optional messages if enough timer events are fired.

    Parameters
    [in]animBlendAnimationRef object.
    [in]tweenBlendTweenRef object (this object).
    [in]stateThe current state of the animation. See ANIMBLENDSTATE for more details.
    [in]animValueThe animated value.