![]() |
AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
|
Base class that provides the common logic for interpolating between values. This class does not inherit from MonoBehaviour in order to enable various scenarios under which it used. To perform the interpolation step, call FrameUpdate. More...
Public Member Functions | |
| InterpolatedValue (T initialValue, bool skipFirstUpdateFrame) | |
| Instantiates a new InterpolatedValue with an initial value and a setting of whether to skip first update frame. More... | |
| void | UpdateTarget (T updateTargetValue) |
| Updates the target value and starts the interpolator if it is not running already. More... | |
| void | UpdateTarget (T updateTargetValue, bool forceUpdate) |
| Updates the target value and starts the interpolator if it is not running already. More... | |
| void | SnapToTarget () |
| Snap (set) the interpolated value to the current target value. More... | |
| void | SnapToTarget (T snapTargetValue) |
| Update the target to a new value and snap (set) the interpolated value to it. More... | |
| void | InterpolateThenSnapToTarget (T snapTargetValue) |
| Interpolative snap to target will interpolate until it reaches the given target value, after which subsequent calls to this method it will snap to the target value given. More... | |
| void | EnsureEnabled () |
| Starts interpolation if it is not currently running. More... | |
| void | EnsureDisabled () |
| Stops the interpolation if it is currently running. More... | |
| T | FrameUpdate () |
| Increments the interpolation step. This function should be called each frame. More... | |
| abstract bool | DoValuesEqual (T one, T other) |
| A method to check whether two values are equal. This should be overridden by inheriting classes. More... | |
| abstract T | ApplyCurveValue (T startValue, T targetValue, float curveValue) |
| A method to calculate the current interpolated value based on the start value, a target value and the curve evaluated interpolation position value. This should be overridden by inheriting classes. More... | |
Static Public Member Functions | |
| static implicit | operator T (InterpolatedValue< T > interpolatedValue) |
| Implicit cast operator that returns the current value of the Interpolator. More... | |
Public Attributes | |
| const float | SmallNumber = 0.0000001f |
| const float | SmallNumberSquared = SmallNumber * SmallNumber |
Properties | |
| float | Duration [get, set] |
| Time the interpolator takes to get from current value to the target value. More... | |
| AnimationCurve | Curve [get, set] |
| The AnimationCurve used for evaluating the interpolation value. More... | |
| bool | IsValid [get] |
| Checks if the interpolator can be used by ensuring an AnimatorCurve has been set. More... | |
| bool | IsRunning [get] |
| Checks whether the interpolator is currently interpolating. More... | |
| T | Value [get] |
| Returns the current interpolated value. More... | |
| T | Target [get] |
| Returns the current interpolation target value. More... | |
| float | CurrentTime [get] |
| Wrapper for getting time that supports EditTime updates. More... | |
Events | |
| Action< InterpolatedValue< T > > | Started |
| Event that is triggered when interpolation starts. More... | |
| Action< InterpolatedValue< T > > | Completed |
| Event that is triggered when interpolation completes. More... | |
| Action< InterpolatedValue< T > > | ValueChanged |
| Event that is triggered when the current interpolated value is changed. More... | |
Base class that provides the common logic for interpolating between values. This class does not inherit from MonoBehaviour in order to enable various scenarios under which it used. To perform the interpolation step, call FrameUpdate.
| T | Type of value used for interpolation. |
Definition at line 16 of file InterpolatedValue.cs.
| HoloToolkit.Unity.InterpolatedValue< T >.InterpolatedValue | ( | T | initialValue, |
| bool | skipFirstUpdateFrame | ||
| ) |
Instantiates a new InterpolatedValue with an initial value and a setting of whether to skip first update frame.
| initialValue | Initial current value to use. |
| skipFirstUpdateFrame | A flag to skip first update frame after the interpolation target has been set. |
Definition at line 134 of file InterpolatedValue.cs.
|
pure virtual |
A method to calculate the current interpolated value based on the start value, a target value and the curve evaluated interpolation position value. This should be overridden by inheriting classes.
This method is public because of a Unity compilation bug when dealing with abstract methods on generics.
| startValue | The value that the interpolation started at. |
| targetValue | The target value that the interpolation is moving to. |
| curveValue | A curve evaluated interpolation position value. This will be in range of [0, 1] |
|
pure virtual |
A method to check whether two values are equal. This should be overridden by inheriting classes.
This method is public because of a Unity compilation bug when dealing with abstract methods on generics.
| one | First value. |
| other | Second value. |
| void HoloToolkit.Unity.InterpolatedValue< T >.EnsureDisabled | ( | ) |
Stops the interpolation if it is currently running.
This forces a stop if currently running and does not check if the interpolated value has not reached the target value.
Definition at line 245 of file InterpolatedValue.cs.
| void HoloToolkit.Unity.InterpolatedValue< T >.EnsureEnabled | ( | ) |
Starts interpolation if it is not currently running.
This forces a start if not currently running and does not check if the interpolated value is at the target value.
Definition at line 226 of file InterpolatedValue.cs.
| T HoloToolkit.Unity.InterpolatedValue< T >.FrameUpdate | ( | ) |
Increments the interpolation step. This function should be called each frame.
To enable multiple scenarios for using the InterpolatedValues, the class does not inherit from MonoBehaviour.
Definition at line 260 of file InterpolatedValue.cs.
| void HoloToolkit.Unity.InterpolatedValue< T >.InterpolateThenSnapToTarget | ( | T | snapTargetValue | ) |
Interpolative snap to target will interpolate until it reaches the given target value, after which subsequent calls to this method it will snap to the target value given.
SnapToTarget and UpdateTarget resets this.
| snapTargetValue | The target value to set and interpolate to. |
Definition at line 201 of file InterpolatedValue.cs.
|
static |
Implicit cast operator that returns the current value of the Interpolator.
| interpolatedValue | The interpolator casting from. |
Definition at line 25 of file InterpolatedValue.cs.
| void HoloToolkit.Unity.InterpolatedValue< T >.SnapToTarget | ( | ) |
Snap (set) the interpolated value to the current target value.
Definition at line 180 of file InterpolatedValue.cs.
| void HoloToolkit.Unity.InterpolatedValue< T >.SnapToTarget | ( | T | snapTargetValue | ) |
Update the target to a new value and snap (set) the interpolated value to it.
| snapTargetValue | The new target value. |
Definition at line 189 of file InterpolatedValue.cs.
| void HoloToolkit.Unity.InterpolatedValue< T >.UpdateTarget | ( | T | updateTargetValue | ) |
Updates the target value and starts the interpolator if it is not running already.
| updateTargetValue | The new target value. |
Definition at line 148 of file InterpolatedValue.cs.
| void HoloToolkit.Unity.InterpolatedValue< T >.UpdateTarget | ( | T | updateTargetValue, |
| bool | forceUpdate | ||
| ) |
Updates the target value and starts the interpolator if it is not running already.
| updateTargetValue | The new target value. |
| forceUpdate | A flag for forcing an update propagation. |
Definition at line 158 of file InterpolatedValue.cs.
| const float HoloToolkit.Unity.InterpolatedValue< T >.SmallNumber = 0.0000001f |
Definition at line 18 of file InterpolatedValue.cs.
| const float HoloToolkit.Unity.InterpolatedValue< T >.SmallNumberSquared = SmallNumber * SmallNumber |
Definition at line 19 of file InterpolatedValue.cs.
|
getprotected |
Wrapper for getting time that supports EditTime updates.
Definition at line 118 of file InterpolatedValue.cs.
|
getset |
The AnimationCurve used for evaluating the interpolation value.
Definition at line 73 of file InterpolatedValue.cs.
|
getset |
Time the interpolator takes to get from current value to the target value.
Definition at line 60 of file InterpolatedValue.cs.
|
get |
Checks whether the interpolator is currently interpolating.
Definition at line 86 of file InterpolatedValue.cs.
|
get |
Checks if the interpolator can be used by ensuring an AnimatorCurve has been set.
Definition at line 81 of file InterpolatedValue.cs.
|
get |
Returns the current interpolation target value.
Definition at line 110 of file InterpolatedValue.cs.
|
get |
Returns the current interpolated value.
Definition at line 94 of file InterpolatedValue.cs.
| Action<InterpolatedValue<T> > HoloToolkit.Unity.InterpolatedValue< T >.Completed |
Event that is triggered when interpolation completes.
Definition at line 38 of file InterpolatedValue.cs.
| Action<InterpolatedValue<T> > HoloToolkit.Unity.InterpolatedValue< T >.Started |
Event that is triggered when interpolation starts.
Definition at line 33 of file InterpolatedValue.cs.
| Action<InterpolatedValue<T> > HoloToolkit.Unity.InterpolatedValue< T >.ValueChanged |
Event that is triggered when the current interpolated value is changed.
Definition at line 43 of file InterpolatedValue.cs.