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