AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
InterpolatedVector3.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 InterpolatedVector3 : InterpolatedValue<Vector3>
14  {
18  public InterpolatedVector3() : this(default(Vector3)) { }
19 
25  public InterpolatedVector3(Vector3 initialValue, bool skipFirstUpdateFrame = false) : base(initialValue, skipFirstUpdateFrame) { }
26 
34  public override bool DoValuesEqual(Vector3 one, Vector3 other)
35  {
36  return (one - other).sqrMagnitude <= SmallNumberSquared;
37  }
38 
47  public override Vector3 ApplyCurveValue(Vector3 startValue, Vector3 targetValue, float curveValue)
48  {
49  return Vector3.Lerp(startValue, targetValue, curveValue);
50  }
51  }
52 }
InterpolatedVector3()
Instantiates the InterpolatedVector3 with default of Vector3 as initial value and skipping the first ...
Provides interpolation over Vector3.
override bool DoValuesEqual(Vector3 one, Vector3 other)
Overrides the method to check if two Vector3s are close enough.
override Vector3 ApplyCurveValue(Vector3 startValue, Vector3 targetValue, float curveValue)
Overrides the method to calculate the current Vector3 interpolation value by using a Vector3...
Base class that provides the common logic for interpolating between values. This class does not inher...
InterpolatedVector3(Vector3 initialValue, bool skipFirstUpdateFrame=false)
Instantiates the InterpolatedVector3 with a given Vector3 value as initial value and defaulted to ski...