InterpolatedChangeProperty
Engine/source/util/interpolatedChangeProperty.h
A property that smoothly transitions to new values instead of assuming them right away.
Transitioning
Transitioning allows to smoothly go from one value to a different one over a period of time.
Number of milliseconds it takes to go from one value to a different one.
Interpolation to use for going from source to target.
The time the transition started. If 0, no transition is in progress.
The value we are transitioning from.
The value we are transitioning to.
Public Types
_Anonymous_ { DEFAULT_TRANSITION_TIME = 2000 }
TimeSource
TimeSourceType
TimeSource::TickType
TimeType
Protected Attributes
The current value.
Protected Functions
_update()
Update mCurrentValue.
Public Functions
InterpolatedChangeProperty(const T & initialValue)
Get the current value.
Return the time source to which interpolation synchronizes.
setTargetValue(const T & value)
Set the desired value.
setTransitionCurve(const EaseF & ease)
Set the interpolation to use for going from one ambient color to a different one.
setTransitionTime(TimeType time)
Set the amount of time it takes to go from one ambient color to a different one.
Detailed Description
A property that smoothly transitions to new values instead of assuming them right away.
Parameters:
T | Value type. Must have "interpolate( from, to, factor )" method. |
TimeSource | Time source to which interpolation is synchronized. |
Transitioning
Transitioning allows to smoothly go from one value to a different one over a period of time.
TimeSourceType mTimeSource
TimeType mBlendPhaseTime
Number of milliseconds it takes to go from one value to a different one.
EaseF mTransitionCurve
Interpolation to use for going from source to target.
TimeType mTransitionStartTime
The time the transition started. If 0, no transition is in progress.
T mSourceValue
The value we are transitioning from.
T mTargetValue
The value we are transitioning to.
Public Types
@214
Enumerator
- DEFAULT_TRANSITION_TIME = 2000
Default time (in milliseconds) to go from one value to a new one.
typedef TimeSource TimeSourceType
typedef TimeSource::TickType TimeType
Protected Attributes
T mCurrentValue
The current value.
Protected Functions
_update()
Update mCurrentValue.
Public Functions
InterpolatedChangeProperty(const T & initialValue)
getCurrentValue()
Get the current value.
If a transition is in progress, this will be an interpolation of the last value and the new one.
geTimeSource()
Return the time source to which interpolation synchronizes.
getTimeSource()
setTargetValue(const T & value)
Set the desired value.
If this differs from the current value, a smooth blend to the given color will be initiated.
Parameters:
value | Desired value. |
setTransitionCurve(const EaseF & ease)
Set the interpolation to use for going from one ambient color to a different one.
setTransitionTime(TimeType time)
Set the amount of time it takes to go from one ambient color to a different one.