#include <parameterblender.h>
Public Member Functions | |
ParameterBlender (ParamType ¶meter) | |
ParameterBlender (Parameter ¶meter) | |
![]() | |
BaseParameterBlender (Parameter ¶meter) | |
virtual | ~BaseParameterBlender ()=default |
void | blend (float value) |
void | setTarget (const Parameter *target) |
void | clearTarget () |
void | sync () |
bool | hasTarget () const |
const Parameter & | getTarget () const |
const Parameter & | getParameter () const |
template<typename T > | |
const T & | getTarget () const |
template<typename T > | |
T & | getParameter () |
Protected Member Functions | |
virtual void | onBlend (float value) override |
virtual void | onSync () override |
virtual void | onTargetSet () override |
void | onBlend (float value) |
void | onBlend (float value) |
void | onBlend (float value) |
void | onBlend (float value) |
void | onBlend (float value) |
void | onBlend (float value) |
Default (float, vec2, double, etc.) parameter blender. Blends a parameter (source) towards a target parameter based on a lerp value from 0 to 1. This blender uses the default math::lerp function to interpolate between the values. The ParameterType class should have an 'mValue' member to bind to. Provide an ParameterBlender::onBlend() specialization if no lerp function is available.
ParameterBlender | ( | ParamType & | parameter | ) |
Constructs the default parameter blender
parameter | the parameter that is updated based on the computed blend value. |
ParameterBlender | ( | Parameter & | parameter | ) |
Constructs the default parameter blender based on base type
parameter | the parameter that is updated based on the computed blend value. |
|
protectedvirtual |
Called after calling blend(). Override in derived class to correctly blend parameter from source to target.
value | the blend value (0-1) |
Implements BaseParameterBlender.
|
protectedvirtual |
Called after calling blend(). Override in derived class to correctly blend parameter from source to target.
value | the blend value (0-1) |
Implements BaseParameterBlender.
|
protectedvirtual |
Called after calling blend(). Override in derived class to correctly blend parameter from source to target.
value | the blend value (0-1) |
Implements BaseParameterBlender.
|
protectedvirtual |
Called after calling blend(). Override in derived class to correctly blend parameter from source to target.
value | the blend value (0-1) |
Implements BaseParameterBlender.
|
protectedvirtual |
Called after calling blend(). Override in derived class to correctly blend parameter from source to target.
value | the blend value (0-1) |
Implements BaseParameterBlender.
|
protectedvirtual |
Called after calling blend(). Override in derived class to correctly blend parameter from source to target.
value | the blend value (0-1) |
Implements BaseParameterBlender.
|
overrideprotectedvirtual |
Blends the numeric parameter based on current target value. The default implementation uses the math::lerp<T> function. Provide a specialization if required for your own parameter type.
value | the blend value (0-1) |
Implements BaseParameterBlender.
|
overrideprotectedvirtual |
Ensures that subsequent calls to blend() are based on the current parameter value.
Implements BaseParameterBlender.
|
overrideprotectedvirtual |
Occurs when the target is updated, ensures the current blend value is cached.
Implements BaseParameterBlender.