#include <smoothdamp.h>
Public Member Functions | |
SmoothOperator (const T ¤tValue, float smoothTime) | |
SmoothOperator (const T ¤tValue, float smoothTime, float maxSpeed) | |
T & | update (const T &targetValue, float deltaTime) |
const T & | getValue () const |
T & | getValue () |
const T & | getTarget () const |
T & | getTarget () |
const T & | getVelocity () const |
T & | getVelocity () |
void | setValue (const T &value) |
NAPAPI void | setValue (const float &value) |
NAPAPI void | setValue (const double &value) |
NAPAPI void | setValue (const glm::vec2 &value) |
NAPAPI void | setValue (const glm::vec3 &value) |
NAPAPI void | setValue (const glm::vec4 &value) |
![]() | |
BaseSmoothOperator ()=default | |
BaseSmoothOperator (float smoothTime) | |
BaseSmoothOperator (float smoothTime, float maxSpeed) | |
virtual | ~BaseSmoothOperator ()=default |
Protected Member Functions | |
void | init () |
NAPAPI void | init () |
NAPAPI void | init () |
NAPAPI void | init () |
NAPAPI void | init () |
NAPAPI void | init () |
Protected Attributes | |
T | mValue |
T | mTarget |
T | mVelocity |
Additional Inherited Members | |
![]() | |
float | mSmoothTime = 1.0f |
float | mMaxSpeed = math::max<float>() |
Smooth Damp utility class. Gradually changes a value of type T towards a desired goal over time. This operator needs to be updated every frame! Call update() together with the new deltaTime and desired target value on application update. The update call returns the new smoothed value. Alternatively use getValue() to get the current smoothed value after update. This operator is a convenience wrapper around nap::math::smoothDamp<T>()
SmoothOperator | ( | const T & | currentValue, |
float | smoothTime | ||
) |
Constructor that creates the operator based on a set of initial values
currentValue | the value it should started blending from, often same as initial target |
smoothTime | the time in seconds it will take to reach the target |
SmoothOperator | ( | const T & | currentValue, |
float | smoothTime, | ||
float | maxSpeed | ||
) |
Constructor that creates the operator based on a set of initial values
currentValue | the value it should started blending from, often same as initial target |
smoothTime | the time in seconds it will take to reach the target |
maxSpeed | the maximum blend speed |
T& getTarget | ( | ) |
const T& getTarget | ( | ) | const |
T& getValue | ( | ) |
const T& getValue | ( | ) | const |
T& getVelocity | ( | ) |
const T& getVelocity | ( | ) | const |
|
protected |
This needs to be implemented by every template specialized class
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
NAPAPI void setValue | ( | const double & | value | ) |
NAPAPI void setValue | ( | const float & | value | ) |
NAPAPI void setValue | ( | const glm::vec2 & | value | ) |
NAPAPI void setValue | ( | const glm::vec3 & | value | ) |
NAPAPI void setValue | ( | const glm::vec4 & | value | ) |
void setValue | ( | const T & | value | ) |
Sets the current blend value.
value | the value to set as blend value |
T & update | ( | const T & | targetValue, |
float | deltaTime | ||
) |
Updates the current blend value based on the given targetValue
targetValue | the value to blend to |
deltaTime | time in seconds it took to complete the last compute cycle |
|
protected |
|
protected |
|
protected |