Helper class for using linear interpolation between a begin and an end value. More...
#include <juce_StaticAnimationLimits.h>
Public Member Functions | |
StaticAnimationLimits (const ValueType &endIn) | |
Constructor. | |
StaticAnimationLimits (const ValueType &beginIn, const ValueType &endIn) | |
Constructor. | |
ValueType | operator() (float value) const |
Evaluation operator. | |
ValueType | lerp (float value) const |
Returns a value that is a linear interpolation of the beginning and end state. | |
Helper class for using linear interpolation between a begin and an end value.
The ValueType could be any numerical type, or a std::tuple containing numerical types. This class is mainly intended to be used with the latter.
This way you can interpolate multiple values by supplying a single float value, which you can access in an Animator's value change callback.
E.g.
|
explicit |
Constructor.
You can use it to interpolate between a 0 initialised numerical value or tuple and the provided end state.
StaticAnimationLimits< ValueType >::StaticAnimationLimits | ( | const ValueType & | beginIn, |
const ValueType & | endIn ) |
Constructor.
Creates an object that will interpolate between the two provided beginning and end states. The ValueType can be a numerical type or a std::tuple containing numerical types.
ValueType StaticAnimationLimits< ValueType >::operator() | ( | float | value | ) | const |
Evaluation operator.
Returns a value that is a linear interpolation of the beginning and end state. It's a shorthand for the lerp() function.
ValueType StaticAnimationLimits< ValueType >::lerp | ( | float | value | ) | const |