using System;
namespace UnityEngine.XR.Interaction.Toolkit.Utilities.Tweenables.Primitives
{
///
/// Bindable variable that can tween over time towards a target Quaternion value.
/// Uses an synchronous implementation so the tween does not use the job system.
///
[Obsolete("The Affordance System namespace and all associated classes have been deprecated. The existing affordance system will be moved, replaced and updated with a new interaction feedback system in a future version of XRI.")]
public class QuaternionTweenableVariable : TweenableVariableSynchronousBase
{
///
/// Angle threshold in degrees, under which two quaternions are considered equal.
///
public float angleEqualityThreshold { get; set; } = 0.01f;
///
protected override Quaternion Lerp(Quaternion from, Quaternion to, float t)
{
return Quaternion.Slerp(from, to, t);
}
///
protected override bool IsNearlyEqual(Quaternion startValue, Quaternion targetValue)
{
return Quaternion.Angle(startValue, targetValue) < angleEqualityThreshold;
}
}
}