We've moved!

Starting from MRTK 2.6, we are publishing both conceptual docs and API references on docs.microsoft.com. For conceptual docs, please visit our new landing page. For API references, please visit the MRTK-Unity section of the dot net API explorer. Existing content will remain here but will not be updated further.

Search Results for

    Show / Hide Table of Contents

    Class InputAnimation

    Contains a set of animation curves that describe motion of camera and hands.

    Inheritance
    Object
    InputAnimation
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Microsoft.MixedReality.Toolkit.Input
    Assembly: cs.temp.dll.dll
    Syntax
    [Serializable]
    public class InputAnimation

    Constructors

    InputAnimation()

    Default constructor

    Declaration
    public InputAnimation()

    Fields

    jointCount

    Declaration
    protected static readonly int jointCount
    Field Value
    Type Description
    Int32

    Properties

    Duration

    Maximum duration of all animations curves.

    Declaration
    public float Duration { get; }
    Property Value
    Type Description
    Single

    HasCameraPose

    Whether the animation has camera pose curves

    Declaration
    public bool HasCameraPose { get; }
    Property Value
    Type Description
    Boolean

    HasEyeGaze

    Whether the animation has eye gaze curves

    Declaration
    public bool HasEyeGaze { get; }
    Property Value
    Type Description
    Boolean

    HasHandData

    Whether the animation has hand state and joint curves

    Declaration
    public bool HasHandData { get; }
    Property Value
    Type Description
    Boolean

    markerCount

    Number of markers in the animation.

    Declaration
    public int markerCount { get; }
    Property Value
    Type Description
    Int32

    Methods

    AddCameraPoseKey(Single, MixedRealityPose, Single, Single)

    Add a keyframe for the camera transform.

    Declaration
    [Obsolete("Use FromRecordingBuffer to construct new InputAnimations")]
    public void AddCameraPoseKey(float time, MixedRealityPose cameraPose, float positionThreshold, float rotationThreshold)
    Parameters
    Type Name Description
    Single time
    MixedRealityPose cameraPose
    Single positionThreshold
    Single rotationThreshold

    AddHandJointKey(Single, Handedness, TrackedHandJoint, MixedRealityPose, Single, Single)

    Add a keyframe for one hand joint.

    Declaration
    [Obsolete("Use FromRecordingBuffer to construct new InputAnimations")]
    public void AddHandJointKey(float time, Handedness handedness, TrackedHandJoint joint, MixedRealityPose jointPose, float positionThreshold, float rotationThreshold)
    Parameters
    Type Name Description
    Single time
    Handedness handedness
    TrackedHandJoint joint
    MixedRealityPose jointPose
    Single positionThreshold
    Single rotationThreshold

    AddHandStateKey(Single, Handedness, Boolean, Boolean)

    Add a keyframe for the tracking state of a hand.

    Declaration
    [Obsolete("Use FromRecordingBuffer to construct new InputAnimations")]
    public void AddHandStateKey(float time, Handedness handedness, bool isTracked, bool isPinching)
    Parameters
    Type Name Description
    Single time
    Handedness handedness
    Boolean isTracked
    Boolean isPinching

    AddMarker(InputAnimationMarker)

    Add a user-defined marker.

    Declaration
    public void AddMarker(InputAnimationMarker marker)
    Parameters
    Type Name Description
    InputAnimationMarker marker

    Clear()

    Remove all keyframes from all animation curves.

    Declaration
    public void Clear()

    CutoffBeforeTime(Single)

    Remove all keyframes from all animation curves with time values before the given cutoff time.

    Declaration
    [Obsolete("Cutoff is achieved in InputRecordingBuffer")]
    public void CutoffBeforeTime(float time)
    Parameters
    Type Name Description
    Single time
    Remarks

    If keyframes exists before the cutoff time then one preceding keyframe will be retained, so that interpolation at the cutoff time yields the same result.

    EvaluateCameraPose(Single)

    Evaluate the camera transform at the given time.

    Declaration
    public MixedRealityPose EvaluateCameraPose(float time)
    Parameters
    Type Name Description
    Single time
    Returns
    Type Description
    MixedRealityPose

    EvaluateEyeGaze(Single)

    Evaluate the eye gaze ray at the given time.

    Declaration
    public Ray EvaluateEyeGaze(float time)
    Parameters
    Type Name Description
    Single time
    Returns
    Type Description
    Ray

    EvaluateHandJoint(Single, Handedness, TrackedHandJoint)

    Evaluate joint pose at the given time.

    Declaration
    public MixedRealityPose EvaluateHandJoint(float time, Handedness handedness, TrackedHandJoint joint)
    Parameters
    Type Name Description
    Single time
    Handedness handedness
    TrackedHandJoint joint
    Returns
    Type Description
    MixedRealityPose

    EvaluateHandState(Single, Handedness, out Boolean, out Boolean)

    Evaluate hand tracking state at the given time.

    Declaration
    public void EvaluateHandState(float time, Handedness handedness, out bool isTracked, out bool isPinching)
    Parameters
    Type Name Description
    Single time
    Handedness handedness
    Boolean isTracked
    Boolean isPinching

    FindMarkerInterval(Single)

    Find an index i in the sorted events list, such that events[i].time <= time < events[i+1].time.

    Declaration
    public int FindMarkerInterval(float time)
    Parameters
    Type Name Description
    Single time
    Returns
    Type Description
    Int32

    0 <= i < eventCount if a full interval could be found. -1 if time is less than the first event time. eventCount-1 if time is greater than the last event time.

    Remarks

    Uses binary search.

    FromRecordingBuffer(InputRecordingBuffer, MixedRealityInputRecordingProfile)

    Generates an input animation from the contents of a recording buffer.

    Declaration
    public static InputAnimation FromRecordingBuffer(InputRecordingBuffer recordingBuffer, MixedRealityInputRecordingProfile profile)
    Parameters
    Type Name Description
    InputRecordingBuffer recordingBuffer

    The buffer to convert to an animation

    MixedRealityInputRecordingProfile profile

    The profile that specifies the parameters for optimization

    Returns
    Type Description
    InputAnimation

    FromStream(Stream)

    Deserializes animation data from a stream.

    Declaration
    public static InputAnimation FromStream(Stream stream)
    Parameters
    Type Name Description
    Stream stream
    Returns
    Type Description
    InputAnimation

    FromStreamAsync(Stream, Action)

    Deserialize animation data from a stream asynchronously.

    Declaration
    public static Task<InputAnimation> FromStreamAsync(Stream stream, Action callback = null)
    Parameters
    Type Name Description
    Stream stream
    Action callback
    Returns
    Type Description
    Task<InputAnimation>

    GetMarker(Int32)

    Get the marker at the given index.

    Declaration
    public InputAnimationMarker GetMarker(int index)
    Parameters
    Type Name Description
    Int32 index
    Returns
    Type Description
    InputAnimationMarker

    RemoveMarker(Int32)

    Remove the user-defined marker at the given index.

    Declaration
    public void RemoveMarker(int index)
    Parameters
    Type Name Description
    Int32 index

    SetMarkerTime(Int32, Single)

    Change the time of the marker at the given index.

    Declaration
    public void SetMarkerTime(int index, float time)
    Parameters
    Type Name Description
    Int32 index
    Single time

    ToStream(Stream, Single)

    Serialize animation data into a stream.

    Declaration
    public void ToStream(Stream stream, float startTime)
    Parameters
    Type Name Description
    Stream stream
    Single startTime

    ToStreamAsync(Stream, Single, Action)

    Serialize animation data into a stream asynchronously.

    Declaration
    public Task ToStreamAsync(Stream stream, float startTime, Action callback = null)
    Parameters
    Type Name Description
    Stream stream
    Single startTime
    Action callback
    Returns
    Type Description
    Task
    In This Article
    Back to top Generated by DocFX