X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fupdate%2Fanimation%2Fscene-graph-animator.h;h=3ff31447dddf709b63d8787b9969a4a1d52f4399;hb=0db05961b8c65b81ab2e8795f3264cd6fb5cc919;hp=0b3ff50e1a1017e8e82b3ac2c515ecf70c8fed8e;hpb=e3609e24bff1c8b5b8d9c9684b773b72d6b0d884;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/update/animation/scene-graph-animator.h b/dali/internal/update/animation/scene-graph-animator.h index 0b3ff50..3ff3144 100644 --- a/dali/internal/update/animation/scene-graph-animator.h +++ b/dali/internal/update/animation/scene-graph-animator.h @@ -20,6 +20,7 @@ // EXTERNAL INCLUDES #include +#include // INTERNAL INCLUDES #include @@ -45,59 +46,6 @@ namespace Internal using Interpolation = Dali::Animation::Interpolation; -/** - * AnimatorFunction base class. - * Needs to be declared first so AnimatorBase knows about it's destructor - * All update functions must inherit from AnimatorFunctionBase and overload the appropiate "()" operator - */ -struct AnimatorFunctionBase -{ - /** - * Constructor - */ - AnimatorFunctionBase() {} - - /* - * Virtual destructor (Intended as base class) - */ - virtual ~AnimatorFunctionBase() {} - - ///Stub "()" operators. - virtual bool operator()(float progress, const bool& property) - { - return property; - } - - virtual float operator()(float progress, const int32_t& property) - { - return static_cast( property ); - } - - virtual float operator()(float progress, const float& property) - { - return property; - } - - virtual Vector2 operator()(float progress, const Vector2& property) - { - return property; - } - - virtual Vector3 operator()(float progress, const Vector3& property) - { - return property; - } - - virtual Vector4 operator()(float progress, const Vector4& property) - { - return property; - } - - virtual Quaternion operator()(float progress, const Quaternion& property) - { - return property; - } -}; namespace SceneGraph { @@ -135,19 +83,16 @@ public: * Constructor. */ AnimatorBase( PropertyOwner* propertyOwner, - AnimatorFunctionBase* animatorFunction, AlphaFunction alphaFunction, const TimePeriod& timePeriod ) : mLifecycleObserver( nullptr ), mPropertyOwner( propertyOwner ), - mAnimatorFunction( animatorFunction ), mDurationSeconds( timePeriod.durationSeconds ), mIntervalDelaySeconds( timePeriod.delaySeconds ), mSpeedFactor( 1.0f ), mCurrentProgress( 0.f ), - mLoopCount( 1 ), mAlphaFunction( alphaFunction ), - mDisconnectAction( Dali::Animation::BakeFinal ), + mDisconnectAction( Dali::Animation::BAKE_FINAL ), mAnimationPlaying( false ), mEnabled( true ), mConnectedToSceneGraph( false ), @@ -158,9 +103,8 @@ public: /** * Virtual destructor. */ - virtual ~AnimatorBase() + ~AnimatorBase() override { - delete mAnimatorFunction; if (mPropertyOwner && mConnectedToSceneGraph) { mPropertyOwner->RemoveObserver(*this); @@ -186,7 +130,7 @@ private: // From PropertyOwner::Observer /** * @copydoc PropertyOwner::Observer::PropertyOwnerConnected( PropertyOwner& owner ) */ - void PropertyOwnerConnected( PropertyOwner& owner ) override final + void PropertyOwnerConnected( PropertyOwner& owner ) final { mEnabled = true; } @@ -194,13 +138,13 @@ private: // From PropertyOwner::Observer /** * @copydoc PropertyOwner::Observer::PropertyOwnerDisconnected( BufferIndex bufferIndex, PropertyOwner& owner ) */ - void PropertyOwnerDisconnected( BufferIndex bufferIndex, PropertyOwner& owner ) override final + void PropertyOwnerDisconnected( BufferIndex bufferIndex, PropertyOwner& owner ) final { // If we are active, then bake the value if required - if ( mAnimationPlaying && mDisconnectAction != Dali::Animation::Discard ) + if ( mAnimationPlaying && mDisconnectAction != Dali::Animation::DISCARD ) { // Bake to target-value if BakeFinal, otherwise bake current value - Update( bufferIndex, ( mDisconnectAction == Dali::Animation::Bake ? mCurrentProgress : 1.0f ), true ); + Update( bufferIndex, ( mDisconnectAction == Dali::Animation::BAKE ? mCurrentProgress : 1.0f ), true ); } mEnabled = false; @@ -209,7 +153,7 @@ private: // From PropertyOwner::Observer /** * @copydoc PropertyOwner::Observer::PropertyOwnerDestroyed( PropertyOwner& owner ) */ - void PropertyOwnerDestroyed( PropertyOwner& owner ) override final + void PropertyOwnerDestroyed( PropertyOwner& owner ) final { mPropertyOwner = nullptr; } @@ -222,6 +166,9 @@ public: { mConnectedToSceneGraph = true; mPropertyOwner->AddObserver(*this); + + // Enable if the target object is valid and connected to the scene graph. + mEnabled = mPropertyOwner->IsAnimationPossible(); } /** @@ -519,6 +466,11 @@ public: progress = SetProgress( progress ); } + if( mPropertyOwner ) + { + mPropertyOwner->SetUpdated( true ); + } + float alpha = ApplyAlphaFunction( progress ); // PropertyType specific part @@ -552,16 +504,15 @@ protected: LifecycleObserver* mLifecycleObserver; PropertyOwner* mPropertyOwner; - AnimatorFunctionBase* mAnimatorFunction; + float mDurationSeconds; float mIntervalDelaySeconds; float mSpeedFactor; float mCurrentProgress; - int32_t mLoopCount; - AlphaFunction mAlphaFunction; + int32_t mLoopCount{1}; Dali::Animation::EndAction mDisconnectAction; ///< EndAction to apply when target object gets disconnected from the stage. bool mAnimationPlaying:1; ///< whether disconnect has been applied while it's running. bool mEnabled:1; ///< Animator is "enabled" while its target object is valid and on the stage. @@ -572,9 +523,13 @@ protected: /** * An animator for a specific property type PropertyType. */ -template < typename PropertyType, typename PropertyAccessorType > -class Animator : public AnimatorBase +template +class Animator final : public AnimatorBase { + using AnimatorFunction = std::function; + + AnimatorFunction mAnimatorFunction; + public: /** @@ -585,36 +540,29 @@ public: * @param[in] timePeriod The time period of this animation. * @return A newly allocated animator. */ - static AnimatorBase* New( const PropertyOwner& propertyOwner, - const PropertyBase& property, - AnimatorFunctionBase* animatorFunction, - AlphaFunction alphaFunction, - const TimePeriod& timePeriod ) + static AnimatorBase* New(const PropertyOwner& propertyOwner, + const PropertyBase& property, + AnimatorFunction animatorFunction, + AlphaFunction alphaFunction, + const TimePeriod& timePeriod) { // The property was const in the actor-thread, but animators are used in the scene-graph thread. - return new Animator( const_cast( &propertyOwner ), - const_cast( &property ), - animatorFunction, - alphaFunction, - timePeriod ); - } - - /** - * Virtual destructor. - */ - virtual ~Animator() - { + return new Animator(const_cast(&propertyOwner), + const_cast(&property), + std::move(animatorFunction), + alphaFunction, + timePeriod); } /** * @copydoc AnimatorBase::DoUpdate( BufferIndex bufferIndex, bool bake, float alpha ) */ - virtual void DoUpdate( BufferIndex bufferIndex, bool bake, float alpha ) override final + void DoUpdate( BufferIndex bufferIndex, bool bake, float alpha ) final { const PropertyType& current = mPropertyAccessor.Get( bufferIndex ); // need to cast the return value in case property is integer - const PropertyType result = static_cast( (*mAnimatorFunction)( alpha, current ) ); + const PropertyType result = static_cast(mAnimatorFunction(alpha, current)); if ( bake ) { @@ -631,13 +579,14 @@ private: /** * Private constructor; see also Animator::New(). */ - Animator( PropertyOwner* propertyOwner, - PropertyBase* property, - AnimatorFunctionBase* animatorFunction, - AlphaFunction alphaFunction, - const TimePeriod& timePeriod ) - : AnimatorBase( propertyOwner, animatorFunction, alphaFunction, timePeriod ), - mPropertyAccessor( property ) + Animator(PropertyOwner* propertyOwner, + PropertyBase* property, + AnimatorFunction animatorFunction, + AlphaFunction alphaFunction, + const TimePeriod& timePeriod) + : AnimatorBase(propertyOwner, alphaFunction, timePeriod), + mAnimatorFunction(std::move(animatorFunction)), + mPropertyAccessor(property) { // WARNING - this object is created in the event-thread // The scene-graph mPropertyOwner object cannot be observed here @@ -660,9 +609,13 @@ protected: /** * An animator for a specific property type PropertyType. */ -template -class AnimatorTransformProperty : public AnimatorBase +template +class AnimatorTransformProperty final : public AnimatorBase { + using AnimatorFunction = std::function; + + AnimatorFunction mAnimatorFunction; + public: /** @@ -673,37 +626,30 @@ public: * @param[in] timePeriod The time period of this animation. * @return A newly allocated animator. */ - static AnimatorBase* New( const PropertyOwner& propertyOwner, - const PropertyBase& property, - AnimatorFunctionBase* animatorFunction, - AlphaFunction alphaFunction, - const TimePeriod& timePeriod ) + static AnimatorBase* New(const PropertyOwner& propertyOwner, + const PropertyBase& property, + AnimatorFunction animatorFunction, + AlphaFunction alphaFunction, + const TimePeriod& timePeriod) { // The property was const in the actor-thread, but animators are used in the scene-graph thread. - return new AnimatorTransformProperty( const_cast( &propertyOwner ), - const_cast( &property ), - animatorFunction, - alphaFunction, - timePeriod ); - } - - /** - * Virtual destructor. - */ - virtual ~AnimatorTransformProperty() - { + return new AnimatorTransformProperty(const_cast(&propertyOwner), + const_cast(&property), + std::move(animatorFunction), + alphaFunction, + timePeriod); } /** * @copydoc AnimatorBase::DoUpdate( BufferIndex bufferIndex, bool bake, float alpha ) */ - virtual void DoUpdate( BufferIndex bufferIndex, bool bake, float alpha ) override final + void DoUpdate( BufferIndex bufferIndex, bool bake, float alpha ) final { const PropertyType& current = mPropertyAccessor.Get( bufferIndex ); // need to cast the return value in case property is integer - const PropertyType result = static_cast( (*mAnimatorFunction)( alpha, current ) ); + const PropertyType result = static_cast(mAnimatorFunction(alpha, current)); if ( bake ) { @@ -720,13 +666,14 @@ private: /** * Private constructor; see also Animator::New(). */ - AnimatorTransformProperty( PropertyOwner* propertyOwner, - PropertyBase* property, - AnimatorFunctionBase* animatorFunction, - AlphaFunction alphaFunction, - const TimePeriod& timePeriod ) - : AnimatorBase( propertyOwner, animatorFunction, alphaFunction, timePeriod ), - mPropertyAccessor( property ) + AnimatorTransformProperty(PropertyOwner* propertyOwner, + PropertyBase* property, + AnimatorFunction animatorFunction, + AlphaFunction alphaFunction, + const TimePeriod& timePeriod) + : AnimatorBase(propertyOwner, alphaFunction, timePeriod), + mAnimatorFunction(std::move(animatorFunction)), + mPropertyAccessor(property) { // WARNING - this object is created in the event-thread // The scene-graph mPropertyOwner object cannot be observed here @@ -747,14 +694,13 @@ protected: // Update functions -struct AnimateByInteger : public AnimatorFunctionBase +struct AnimateByInteger { AnimateByInteger(const int& relativeValue) : mRelative(relativeValue) { } - using AnimatorFunctionBase::operator(); float operator()(float alpha, const int32_t& property) { // integers need to be correctly rounded @@ -764,14 +710,13 @@ struct AnimateByInteger : public AnimatorFunctionBase int32_t mRelative; }; -struct AnimateToInteger : public AnimatorFunctionBase +struct AnimateToInteger { AnimateToInteger(const int& targetValue) : mTarget(targetValue) { } - using AnimatorFunctionBase::operator(); float operator()(float alpha, const int32_t& property) { // integers need to be correctly rounded @@ -781,14 +726,13 @@ struct AnimateToInteger : public AnimatorFunctionBase int32_t mTarget; }; -struct AnimateByFloat : public AnimatorFunctionBase +struct AnimateByFloat { AnimateByFloat(const float& relativeValue) : mRelative(relativeValue) { } - using AnimatorFunctionBase::operator(); float operator()(float alpha, const float& property) { return float(property + mRelative * alpha); @@ -797,14 +741,13 @@ struct AnimateByFloat : public AnimatorFunctionBase float mRelative; }; -struct AnimateToFloat : public AnimatorFunctionBase +struct AnimateToFloat { AnimateToFloat(const float& targetValue) : mTarget(targetValue) { } - using AnimatorFunctionBase::operator(); float operator()(float alpha, const float& property) { return float(property + ((mTarget - property) * alpha)); @@ -813,14 +756,13 @@ struct AnimateToFloat : public AnimatorFunctionBase float mTarget; }; -struct AnimateByVector2 : public AnimatorFunctionBase +struct AnimateByVector2 { AnimateByVector2(const Vector2& relativeValue) : mRelative(relativeValue) { } - using AnimatorFunctionBase::operator(); Vector2 operator()(float alpha, const Vector2& property) { return Vector2(property + mRelative * alpha); @@ -829,14 +771,13 @@ struct AnimateByVector2 : public AnimatorFunctionBase Vector2 mRelative; }; -struct AnimateToVector2 : public AnimatorFunctionBase +struct AnimateToVector2 { AnimateToVector2(const Vector2& targetValue) : mTarget(targetValue) { } - using AnimatorFunctionBase::operator(); Vector2 operator()(float alpha, const Vector2& property) { return Vector2(property + ((mTarget - property) * alpha)); @@ -845,14 +786,13 @@ struct AnimateToVector2 : public AnimatorFunctionBase Vector2 mTarget; }; -struct AnimateByVector3 : public AnimatorFunctionBase +struct AnimateByVector3 { AnimateByVector3(const Vector3& relativeValue) : mRelative(relativeValue) { } - using AnimatorFunctionBase::operator(); Vector3 operator()(float alpha, const Vector3& property) { return Vector3(property + mRelative * alpha); @@ -861,14 +801,13 @@ struct AnimateByVector3 : public AnimatorFunctionBase Vector3 mRelative; }; -struct AnimateToVector3 : public AnimatorFunctionBase +struct AnimateToVector3 { AnimateToVector3(const Vector3& targetValue) : mTarget(targetValue) { } - using AnimatorFunctionBase::operator(); Vector3 operator()(float alpha, const Vector3& property) { return Vector3(property + ((mTarget - property) * alpha)); @@ -877,14 +816,13 @@ struct AnimateToVector3 : public AnimatorFunctionBase Vector3 mTarget; }; -struct AnimateByVector4 : public AnimatorFunctionBase +struct AnimateByVector4 { AnimateByVector4(const Vector4& relativeValue) : mRelative(relativeValue) { } - using AnimatorFunctionBase::operator(); Vector4 operator()(float alpha, const Vector4& property) { return Vector4(property + mRelative * alpha); @@ -893,14 +831,13 @@ struct AnimateByVector4 : public AnimatorFunctionBase Vector4 mRelative; }; -struct AnimateToVector4 : public AnimatorFunctionBase +struct AnimateToVector4 { AnimateToVector4(const Vector4& targetValue) : mTarget(targetValue) { } - using AnimatorFunctionBase::operator(); Vector4 operator()(float alpha, const Vector4& property) { return Vector4(property + ((mTarget - property) * alpha)); @@ -909,14 +846,13 @@ struct AnimateToVector4 : public AnimatorFunctionBase Vector4 mTarget; }; -struct AnimateByOpacity : public AnimatorFunctionBase +struct AnimateByOpacity { AnimateByOpacity(const float& relativeValue) : mRelative(relativeValue) { } - using AnimatorFunctionBase::operator(); Vector4 operator()(float alpha, const Vector4& property) { Vector4 result(property); @@ -928,14 +864,13 @@ struct AnimateByOpacity : public AnimatorFunctionBase float mRelative; }; -struct AnimateToOpacity : public AnimatorFunctionBase +struct AnimateToOpacity { AnimateToOpacity(const float& targetValue) : mTarget(targetValue) { } - using AnimatorFunctionBase::operator(); Vector4 operator()(float alpha, const Vector4& property) { Vector4 result(property); @@ -947,14 +882,13 @@ struct AnimateToOpacity : public AnimatorFunctionBase float mTarget; }; -struct AnimateByBoolean : public AnimatorFunctionBase +struct AnimateByBoolean { AnimateByBoolean(bool relativeValue) : mRelative(relativeValue) { } - using AnimatorFunctionBase::operator(); bool operator()(float alpha, const bool& property) { // Alpha is not useful here, just keeping to the same template as other update functors @@ -964,14 +898,13 @@ struct AnimateByBoolean : public AnimatorFunctionBase bool mRelative; }; -struct AnimateToBoolean : public AnimatorFunctionBase +struct AnimateToBoolean { AnimateToBoolean(bool targetValue) : mTarget(targetValue) { } - using AnimatorFunctionBase::operator(); bool operator()(float alpha, const bool& property) { // Alpha is not useful here, just keeping to the same template as other update functors @@ -981,7 +914,7 @@ struct AnimateToBoolean : public AnimatorFunctionBase bool mTarget; }; -struct RotateByAngleAxis : public AnimatorFunctionBase +struct RotateByAngleAxis { RotateByAngleAxis(const Radian& angleRadians, const Vector3& axis) : mAngleRadians( angleRadians ), @@ -989,7 +922,6 @@ struct RotateByAngleAxis : public AnimatorFunctionBase { } - using AnimatorFunctionBase::operator(); Quaternion operator()(float alpha, const Quaternion& rotation) { if (alpha > 0.0f) @@ -1004,14 +936,13 @@ struct RotateByAngleAxis : public AnimatorFunctionBase Vector3 mAxis; }; -struct RotateToQuaternion : public AnimatorFunctionBase +struct RotateToQuaternion { RotateToQuaternion(const Quaternion& targetValue) : mTarget(targetValue) { } - using AnimatorFunctionBase::operator(); Quaternion operator()(float alpha, const Quaternion& rotation) { return Quaternion::Slerp(rotation, mTarget, alpha); @@ -1020,161 +951,156 @@ struct RotateToQuaternion : public AnimatorFunctionBase Quaternion mTarget; }; - -struct KeyFrameBooleanFunctor : public AnimatorFunctionBase +struct KeyFrameBooleanFunctor { - KeyFrameBooleanFunctor(KeyFrameBooleanPtr keyFrames) - : mKeyFrames(keyFrames) + KeyFrameBooleanFunctor(KeyFrameBoolean keyFrames) + : mKeyFrames(std::move(keyFrames)) { } - using AnimatorFunctionBase::operator(); bool operator()(float progress, const bool& property) { - if(mKeyFrames->IsActive(progress)) + if(mKeyFrames.IsActive(progress)) { - return mKeyFrames->GetValue(progress, Dali::Animation::Linear); + return mKeyFrames.GetValue(progress, Dali::Animation::LINEAR); } return property; } - KeyFrameBooleanPtr mKeyFrames; + KeyFrameBoolean mKeyFrames; }; -struct KeyFrameIntegerFunctor : public AnimatorFunctionBase +struct KeyFrameIntegerFunctor { - KeyFrameIntegerFunctor(KeyFrameIntegerPtr keyFrames, Interpolation interpolation) - : mKeyFrames(keyFrames),mInterpolation(interpolation) + KeyFrameIntegerFunctor(KeyFrameInteger keyFrames, Interpolation interpolation) + : mKeyFrames(std::move(keyFrames)), + mInterpolation(interpolation) { } - using AnimatorFunctionBase::operator(); float operator()(float progress, const int32_t& property) { - if(mKeyFrames->IsActive(progress)) + if(mKeyFrames.IsActive(progress)) { - return static_cast( mKeyFrames->GetValue(progress, mInterpolation) ); + return static_cast(mKeyFrames.GetValue(progress, mInterpolation)); } return static_cast( property ); } - KeyFrameIntegerPtr mKeyFrames; + KeyFrameInteger mKeyFrames; Interpolation mInterpolation; }; -struct KeyFrameNumberFunctor : public AnimatorFunctionBase +struct KeyFrameNumberFunctor { - KeyFrameNumberFunctor(KeyFrameNumberPtr keyFrames, Interpolation interpolation) - : mKeyFrames(keyFrames),mInterpolation(interpolation) + KeyFrameNumberFunctor(KeyFrameNumber keyFrames, Interpolation interpolation) + : mKeyFrames(std::move(keyFrames)), + mInterpolation(interpolation) { } - using AnimatorFunctionBase::operator(); float operator()(float progress, const float& property) { - if(mKeyFrames->IsActive(progress)) + if(mKeyFrames.IsActive(progress)) { - return mKeyFrames->GetValue(progress, mInterpolation); + return mKeyFrames.GetValue(progress, mInterpolation); } return property; } - KeyFrameNumberPtr mKeyFrames; + KeyFrameNumber mKeyFrames; Interpolation mInterpolation; }; -struct KeyFrameVector2Functor : public AnimatorFunctionBase +struct KeyFrameVector2Functor { - KeyFrameVector2Functor(KeyFrameVector2Ptr keyFrames, Interpolation interpolation) - : mKeyFrames(keyFrames),mInterpolation(interpolation) + KeyFrameVector2Functor(KeyFrameVector2 keyFrames, Interpolation interpolation) + : mKeyFrames(std::move(keyFrames)), + mInterpolation(interpolation) { } - using AnimatorFunctionBase::operator(); Vector2 operator()(float progress, const Vector2& property) { - if(mKeyFrames->IsActive(progress)) + if(mKeyFrames.IsActive(progress)) { - return mKeyFrames->GetValue(progress, mInterpolation); + return mKeyFrames.GetValue(progress, mInterpolation); } return property; } - KeyFrameVector2Ptr mKeyFrames; + KeyFrameVector2 mKeyFrames; Interpolation mInterpolation; }; - -struct KeyFrameVector3Functor : public AnimatorFunctionBase +struct KeyFrameVector3Functor { - KeyFrameVector3Functor(KeyFrameVector3Ptr keyFrames, Interpolation interpolation) - : mKeyFrames(keyFrames),mInterpolation(interpolation) + KeyFrameVector3Functor(KeyFrameVector3 keyFrames, Interpolation interpolation) + : mKeyFrames(std::move(keyFrames)), + mInterpolation(interpolation) { } - using AnimatorFunctionBase::operator(); Vector3 operator()(float progress, const Vector3& property) { - if(mKeyFrames->IsActive(progress)) + if(mKeyFrames.IsActive(progress)) { - return mKeyFrames->GetValue(progress, mInterpolation); + return mKeyFrames.GetValue(progress, mInterpolation); } return property; } - KeyFrameVector3Ptr mKeyFrames; + KeyFrameVector3 mKeyFrames; Interpolation mInterpolation; }; -struct KeyFrameVector4Functor : public AnimatorFunctionBase +struct KeyFrameVector4Functor { - KeyFrameVector4Functor(KeyFrameVector4Ptr keyFrames, Interpolation interpolation) - : mKeyFrames(keyFrames),mInterpolation(interpolation) + KeyFrameVector4Functor(KeyFrameVector4 keyFrames, Interpolation interpolation) + : mKeyFrames(std::move(keyFrames)), + mInterpolation(interpolation) { } - using AnimatorFunctionBase::operator(); Vector4 operator()(float progress, const Vector4& property) { - if(mKeyFrames->IsActive(progress)) + if(mKeyFrames.IsActive(progress)) { - return mKeyFrames->GetValue(progress, mInterpolation); + return mKeyFrames.GetValue(progress, mInterpolation); } return property; } - KeyFrameVector4Ptr mKeyFrames; + KeyFrameVector4 mKeyFrames; Interpolation mInterpolation; }; -struct KeyFrameQuaternionFunctor : public AnimatorFunctionBase +struct KeyFrameQuaternionFunctor { - KeyFrameQuaternionFunctor(KeyFrameQuaternionPtr keyFrames) - : mKeyFrames(keyFrames) + KeyFrameQuaternionFunctor(KeyFrameQuaternion keyFrames) + : mKeyFrames(std::move(keyFrames)) { } - using AnimatorFunctionBase::operator(); Quaternion operator()(float progress, const Quaternion& property) { - if(mKeyFrames->IsActive(progress)) + if(mKeyFrames.IsActive(progress)) { - return mKeyFrames->GetValue(progress, Dali::Animation::Linear); + return mKeyFrames.GetValue(progress, Dali::Animation::LINEAR); } return property; } - KeyFrameQuaternionPtr mKeyFrames; + KeyFrameQuaternion mKeyFrames; }; -struct PathPositionFunctor : public AnimatorFunctionBase +struct PathPositionFunctor { PathPositionFunctor( PathPtr path ) : mPath(path) { } - using AnimatorFunctionBase::operator(); Vector3 operator()(float progress, const Vector3& property) { Vector3 position(property); @@ -1185,7 +1111,7 @@ struct PathPositionFunctor : public AnimatorFunctionBase PathPtr mPath; }; -struct PathRotationFunctor : public AnimatorFunctionBase +struct PathRotationFunctor { PathRotationFunctor( PathPtr path, const Vector3& forward ) : mPath(path), @@ -1194,7 +1120,6 @@ struct PathRotationFunctor : public AnimatorFunctionBase mForward.Normalize(); } - using AnimatorFunctionBase::operator(); Quaternion operator()(float progress, const Quaternion& property) { Vector3 tangent;