16 template<
typename KeyType >
60 template<
typename KeyType >
69 template<
typename KeyType >
72 TimeType timeInterval = right.Time - left.Time;
73 TimeType progress = ( time - left.Time ) / timeInterval;
75 auto leftResult = ( 1.0 + (-1.0f) * progress ) * left.Value;
76 auto rightResult = progress * right.Value;
78 return static_cast< KeyType
>( leftResult + rightResult );
83 template<
typename KeyType >
94 template<
typename KeyType >
97 return Tangent( left, right );
102 template<
typename KeyType >
105 return Tangent( left, right );
115 template<
typename KeyType >
118 KeyType valueInterval = right.Value - left.Value;
119 TimeType timeInterval = right.Time - left.Time;
121 return static_cast< KeyType
>( ( TimeType( 1.0f ) / timeInterval )* valueInterval );
Base class for interpolators.
Definition: IInterpolator.h:38
virtual KeyType LeftTangent(const Key< KeyType > &left, const Key< KeyType > &right) const override
Returns curve tangent. Function can be used by surrounding interpolators to smooth curve...
Definition: LinearInterpolator.h:95
virtual void Update(const Key< KeyType > &leftKey, const Key< KeyType > &rightKey, UPtr< const IInterpolator< KeyType > > &leftInterpolator, UPtr< const IInterpolator< KeyType > > &rightInterpolator) override
Function updates interpolator, when left or right key value changes.
Definition: LinearInterpolator.h:84
LinearInterpolator()=default
Constructor for serialization.
Linear interpolator.
Definition: LinearInterpolator.h:17
Animation key.
Definition: IInterpolator.h:21
virtual KeyType RightTangent(const Key< KeyType > &left, const Key< KeyType > &right) const override
Returns curve tangent. Function can be used by surrounding interpolators to smooth curve...
Definition: LinearInterpolator.h:103
virtual KeyType Interpolate(TimeType time, Key< KeyType > &left, Key< KeyType > &right) override
Main function invoked by evaluator.
Definition: LinearInterpolator.h:70