docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class SmartFollowQuaternionTweenableVariable

    This class expands on the Quaternion tweenable variable to introduce two concepts:

    • A dynamic threshold angle that grows over time in a range, that prevents updating the target so long as the value being assigned to the target is within that threshold.
    • A variable speed tween (HandleSmartTween(float, float, float)) that inputs a lower and upper range speed for tweening. The closer the value is to the target, the faster the tween.
    Inheritance
    object
    BindableVariableBase<Quaternion>
    BindableVariable<Quaternion>
    TweenableVariableBase<Quaternion>
    TweenableVariableSynchronousBase<Quaternion>
    QuaternionTweenableVariable
    SmartFollowQuaternionTweenableVariable
    Implements
    IReadOnlyBindableVariable<Quaternion>
    Inherited Members
    QuaternionTweenableVariable.angleEqualityThreshold
    QuaternionTweenableVariable.Lerp(Quaternion, Quaternion, float)
    QuaternionTweenableVariable.IsNearlyEqual(Quaternion, Quaternion)
    TweenableVariableSynchronousBase<Quaternion>.ExecuteTween(Quaternion, Quaternion, float, bool)
    TweenableVariableBase<Quaternion>.k_NearlyOne
    TweenableVariableBase<Quaternion>.animationCurve
    TweenableVariableBase<Quaternion>.target
    TweenableVariableBase<Quaternion>.initialValue
    TweenableVariableBase<Quaternion>.HandleTween(float)
    TweenableVariableBase<Quaternion>.StartAutoTween(float)
    TweenableVariableBase<Quaternion>.PlaySequence(Quaternion, Quaternion, float, Action)
    TweenableVariableBase<Quaternion>.OnAnimationCurveChanged(AnimationCurve)
    TweenableVariableBase<Quaternion>.PreprocessTween()
    BindableVariable<Quaternion>.ValueEquals(Quaternion)
    BindableVariableBase<Quaternion>.Value
    BindableVariableBase<Quaternion>.BindingCount
    BindableVariableBase<Quaternion>.SetValueWithoutNotify(Quaternion)
    BindableVariableBase<Quaternion>.Subscribe(Action<Quaternion>)
    BindableVariableBase<Quaternion>.SubscribeAndUpdate(Action<Quaternion>)
    BindableVariableBase<Quaternion>.Unsubscribe(Action<Quaternion>)
    BindableVariableBase<Quaternion>.BroadcastValue()
    BindableVariableBase<Quaternion>.Task(Func<Quaternion, bool>, CancellationToken)
    BindableVariableBase<Quaternion>.Task(Quaternion, CancellationToken)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.XR.Interaction.Toolkit.Utilities.Tweenables.SmartTweenableVariables
    Assembly: Unity.XR.Interaction.Toolkit.dll
    Syntax
    public class SmartFollowQuaternionTweenableVariable : QuaternionTweenableVariable, IReadOnlyBindableVariable<Quaternion>

    Constructors

    SmartFollowQuaternionTweenableVariable(float, float, float)

    Constructor for SmartFollowQuaternionTweenableVariable.

    Declaration
    public SmartFollowQuaternionTweenableVariable(float minAngleAllowed = 0.1, float maxAngleAllowed = 5, float minToMaxDelaySeconds = 3)
    Parameters
    Type Name Description
    float minAngleAllowed

    Minimum angle offset (in degrees) from target before which tween starts.

    float maxAngleAllowed

    Maximum angle offset (in degrees) from target before tween targets, when time threshold is reached.

    float minToMaxDelaySeconds

    Time required to elapse (in seconds) before the max angle offset allowed goes from the min angle offset to the max.

    See Also
    SmartFollowVector3TweenableVariable

    Properties

    maxAngleAllowed

    Maximum angle offset allowed in degrees.

    Declaration
    public float maxAngleAllowed { get; set; }
    Property Value
    Type Description
    float
    See Also
    SmartFollowVector3TweenableVariable

    minAngleAllowed

    Minimum angle offset allowed in degrees.

    Declaration
    public float minAngleAllowed { get; set; }
    Property Value
    Type Description
    float
    See Also
    SmartFollowVector3TweenableVariable

    minToMaxDelaySeconds

    Time required to elapse before the max angle offset allowed goes from the min angle to the max.

    Declaration
    public float minToMaxDelaySeconds { get; set; }
    Property Value
    Type Description
    float
    See Also
    SmartFollowVector3TweenableVariable

    Methods

    HandleSmartTween(float, float, float)

    Tween to new target with variable speed according to distance from target. The closer the target is to the current value, the faster the tween.

    Declaration
    public void HandleSmartTween(float deltaTime, float lowerSpeed, float upperSpeed)
    Parameters
    Type Name Description
    float deltaTime

    Time elapsed since last tween.

    float lowerSpeed

    Lower speed limit new tween target will clamp to.

    float upperSpeed

    Upper speed limit new tween target will clamp to.

    See Also
    SmartFollowVector3TweenableVariable

    IsNewTargetWithinThreshold(Quaternion)

    Checks if the angle difference between the current target rotation and a new target rotation is within a dynamically determined threshold, based on the time since the last update.

    Declaration
    public bool IsNewTargetWithinThreshold(Quaternion newTarget)
    Parameters
    Type Name Description
    Quaternion newTarget

    The new target rotation as a Quaternion.

    Returns
    Type Description
    bool

    Returns true if the angle difference between the current and new targets is within the allowed threshold, false otherwise.

    See Also
    SmartFollowVector3TweenableVariable

    OnTargetChanged(Quaternion)

    Callback when new tween target value is assigned.

    Declaration
    protected override void OnTargetChanged(Quaternion newTarget)
    Parameters
    Type Name Description
    Quaternion newTarget

    New target value.

    Overrides
    TweenableVariableBase<Quaternion>.OnTargetChanged(Quaternion)
    See Also
    target

    SetTargetWithinThreshold(Quaternion)

    Updates the target rotation to a new value if it is within a dynamically determined threshold, based on the time since the last update.

    Declaration
    public bool SetTargetWithinThreshold(Quaternion newTarget)
    Parameters
    Type Name Description
    Quaternion newTarget

    The new target rotation as a Quaternion.

    Returns
    Type Description
    bool

    Returns true if the target rotation is updated, false otherwise.

    See Also
    SmartFollowVector3TweenableVariable

    Implements

    Unity.XR.CoreUtils.Bindings.Variables.IReadOnlyBindableVariable<T>

    See Also

    SmartFollowVector3TweenableVariable
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)