AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
InterpolatedFloat.cs
Go to the documentation of this file.
1 // Copyright (c) Microsoft Corporation. All rights reserved.
2 // Licensed under the MIT License. See LICENSE in the project root for license information.
3 
4 using System;
5 using UnityEngine;
6 
7 namespace HoloToolkit.Unity
8 {
12  [Serializable]
13  public class InterpolatedFloat : InterpolatedValue<float>
14  {
18  public InterpolatedFloat() : this(0.0f) { }
19 
25  public InterpolatedFloat(float initialValue, bool skipFirstUpdateFrame = false)
26  : base(initialValue, skipFirstUpdateFrame)
27  { }
28 
36  public override bool DoValuesEqual(float one, float other)
37  {
38  return Mathf.Abs(one - other) < SmallNumber;
39  }
40 
49  public override float ApplyCurveValue(float startValue, float targetValue, float curveValue)
50  {
51  return Mathf.Lerp(startValue, targetValue, curveValue);
52  }
53  }
54 }
override bool DoValuesEqual(float one, float other)
Overrides the method to check if two floats are equal.
Provides interpolation over float.
InterpolatedFloat(float initialValue, bool skipFirstUpdateFrame=false)
Instantiates the InterpolatedFloat with a given float value as initial value and defaulted to skippin...
InterpolatedFloat()
Instantiates the InterpolatedFloat with default of float as initial value and skipping the first upda...
override float ApplyCurveValue(float startValue, float targetValue, float curveValue)
Overrides the method to calculate the current float interpolation value by using a Mathf...
Base class that provides the common logic for interpolating between values. This class does not inher...