BlendAnimationInterface Class Reference

#include <blend_animation.h>

Inheritance diagram for BlendAnimationInterface:

详细描述

This class allows to handle easy animations using one or more BlendTweenInterfaces with a given timer interval. The following example demonstrates how to use this class:

// create a new BlendAnimationRef. BlendAnimationRef animBlend = AnimBlendClass().Create() iferr_return ; // add one tween to animate a vector data type from 1/2/3 to 10/100/1000. BlendTweenRef tween1 = animBlend.AddTween(BlendFunctions::EaseOutBounce(), Data( 向量 (1, 2, 3)), Data( 向量 (10, 100, 1000)), []( const BlendAnimationRef& anim, const BlendTweenRef& tween, ANIMBLENDSTATE state, const Data& tickValue) { DiagnosticOutput ( "Anim: @ @" , state, tickValue); }, nullptr ) iferr_return ; // start the animation with a 50 milli seconds timer interval and a duration of 1 second. animBlend.StartAnimation(Milliseconds(50), TimeValue(), Seconds(1.0)) iferr_return ;

公共成员函数

MAXON_METHOD Result < BlendTweenRef >  AddTween (const BlendFunctionRef &blendFunction, const 数据 &startValue, const 数据 &endValue)
MAXON_FUNCTION Result < BlendTweenRef >  AddTween (const BlendFunctionRef &blendFunction, const 数据 &startValue, const 数据 &endValue, AnimBlendTweenCallback &&callback, const JobQueueRef &queue)
MAXON_METHOD Result < void >  RemoveTween (const BlendTweenRef &tween)
MAXON_METHOD Result < BaseArray < BlendTweenRef > >  GetTweens () const
MAXON_METHOD Result < void >  StartAnimation (const TimeValue &timerInterval, const TimeValue &startDelay, const TimeValue &duration)
MAXON_METHOD Float   GetProgress () const
MAXON_METHOD ANIMBLENDSTATE   GetState () const
MAXON_METHOD void  CancelAndWait ()
MAXON_METHOD Result < TimerRef >  GetTimerRef () const

静态公共成员函数

static Result < BlendAnimationRef >  创建 ()

成员函数文档编制

◆  Create()

static Result <BlendAnimationRef> Create ( )
static

Creates a new BlendAnimationRef object.

◆  AddTween() [1/2]

MAXON_METHOD Result <BlendTweenRef> AddTween ( const BlendFunctionRef &  blendFunction ,
const 数据 startValue ,
const 数据 endValue  
)

Adds an animation tween with the given function, start and end value.

◆  AddTween() [2/2]

MAXON_FUNCTION Result <BlendTweenRef> AddTween ( const BlendFunctionRef &  blendFunction ,
const 数据 startValue ,
const 数据 endValue ,
AnimBlendTweenCallback &&  callback ,
const JobQueueRef queue  
)

Adds an animation tween with the given function, start and end value. The callbacks are automatically mapped to the tween observable.

◆  RemoveTween()

MAXON_METHOD Result <void> RemoveTween ( const BlendTweenRef &  tween )

Returns an array with all tweens.

◆  GetTweens()

MAXON_METHOD Result < BaseArray <BlendTweenRef> > GetTweens ( ) const

Returns an array with all tweens.

◆  StartAnimation()

MAXON_METHOD Result <void> StartAnimation ( const TimeValue timerInterval ,
const TimeValue startDelay ,
const TimeValue duration  
)

Starts the animation with the given timer interval.

◆  GetProgress()

MAXON_METHOD Float GetProgress ( ) const

Returns a value between 0.0 and 1.0 with the current anim progress.

◆  GetState()

MAXON_METHOD ANIMBLENDSTATE GetState ( ) const

Returns the current state value.

◆  CancelAndWait()

MAXON_METHOD void CancelAndWait ( )

Kills the animation loop and the associated timer.

◆  GetTimerRef()

MAXON_METHOD Result <TimerRef> GetTimerRef ( ) const

Returns the timer used for this object.

iferr_return
#define iferr_return
定义: resultbase.h:1434
DiagnosticOutput
#define DiagnosticOutput(formatString,...)
定义: debugdiagnostics.h:166
maxon::ANIMBLENDSTATE
ANIMBLENDSTATE
Parameter used in the ObservableAnimation of the BlendTweenInterface.
定义: blend_animation.h:20
maxon::Vector
Vec3< Float, 1 > Vector
定义: vector.h:58