AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
HoloToolkit.Unity.InterpolatedFloat Class Reference

Provides interpolation over float. More...

Inheritance diagram for HoloToolkit.Unity.InterpolatedFloat:
HoloToolkit.Unity.InterpolatedValue< float >

Public Member Functions

 InterpolatedFloat ()
 Instantiates the InterpolatedFloat with default of float as initial value and skipping the first update frame. More...
 
 InterpolatedFloat (float initialValue, bool skipFirstUpdateFrame=false)
 Instantiates the InterpolatedFloat with a given float value as initial value and defaulted to skipping the first update frame. More...
 
override bool DoValuesEqual (float one, float other)
 Overrides the method to check if two floats are equal. More...
 
override float ApplyCurveValue (float startValue, float targetValue, float curveValue)
 Overrides the method to calculate the current float interpolation value by using a Mathf.Lerp function. More...
 
- Public Member Functions inherited from HoloToolkit.Unity.InterpolatedValue< float >
 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...
 
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...
 

Additional Inherited Members

- Static Public Member Functions inherited from HoloToolkit.Unity.InterpolatedValue< float >
static implicit operator T (InterpolatedValue< T > interpolatedValue)
 Implicit cast operator that returns the current value of the Interpolator. More...
 
- Public Attributes inherited from HoloToolkit.Unity.InterpolatedValue< float >
const float SmallNumber
 
const float SmallNumberSquared
 
- Properties inherited from HoloToolkit.Unity.InterpolatedValue< float >
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...
 
Value [get]
 Returns the current interpolated value. More...
 
Target [get]
 Returns the current interpolation target value. More...
 
float CurrentTime [get]
 Wrapper for getting time that supports EditTime updates. More...
 
- Events inherited from HoloToolkit.Unity.InterpolatedValue< float >
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...
 

Detailed Description

Provides interpolation over float.

Definition at line 13 of file InterpolatedFloat.cs.

Constructor & Destructor Documentation

§ InterpolatedFloat() [1/2]

HoloToolkit.Unity.InterpolatedFloat.InterpolatedFloat ( )

Instantiates the InterpolatedFloat with default of float as initial value and skipping the first update frame.

Definition at line 18 of file InterpolatedFloat.cs.

§ InterpolatedFloat() [2/2]

HoloToolkit.Unity.InterpolatedFloat.InterpolatedFloat ( float  initialValue,
bool  skipFirstUpdateFrame = false 
)

Instantiates the InterpolatedFloat with a given float value as initial value and defaulted to skipping the first update frame.

Parameters
initialValueInitial current value to use.
skipFirstUpdateFrameA flag to skip first update frame after the interpolation target has been set.

Definition at line 25 of file InterpolatedFloat.cs.

Member Function Documentation

§ ApplyCurveValue()

override float HoloToolkit.Unity.InterpolatedFloat.ApplyCurveValue ( float  startValue,
float  targetValue,
float  curveValue 
)

Overrides the method to calculate the current float interpolation value by using a Mathf.Lerp function.

This method is public because of a Unity compilation bug when dealing with abstract methods on generics.

Parameters
startValueThe float value that the interpolation started at.
targetValueThe target float value that the interpolation is moving to.
curveValueA curve evaluated interpolation position value. This will be in range of [0, 1]
Returns
The new calculated float interpolation value.

Definition at line 49 of file InterpolatedFloat.cs.

§ DoValuesEqual()

override bool HoloToolkit.Unity.InterpolatedFloat.DoValuesEqual ( float  one,
float  other 
)

Overrides the method to check if two floats are equal.

This method is public because of a Unity compilation bug when dealing with abstract methods on generics.

Parameters
oneFirst float value.
otherSecond float value.
Returns
True if the floats are equal.

Definition at line 36 of file InterpolatedFloat.cs.


The documentation for this class was generated from the following file: