Struct Binary.TrajectoryFragment | Kinematica | 0.5.0-preview.1
docs.unity3d.com
    Show / Hide Table of Contents

    Struct Binary.TrajectoryFragment

    A trajectory fragment contains information necessary to perform similarity calculations between trajectories.

    Namespace: Unity.Kinematica
    Syntax
    public struct TrajectoryFragment : IDisposable
    Remarks

    A trajectory is simply a sequence for root joint transforms forming a continuous path. Trajectories can either be expressed in world space according to the original animation data or relative to a sampling time.

    A trajectory fragment can be constructed from any animation pose contained in the motion library. It requires a metric in order to extract the relevant information. The similarity calculation uses a weighted sum of features that includes root velocity, forward direction and optionally root displacements.

    The main purpose of this class is to:

    • Create trajectory fragments from poses in the motion library.
    • Perform similarity calculation between trajectory fragments.

    Fields

    array

    Denotes the feature array of this trajectory fragment.

    Declaration
    public NativeArray<float3> array
    Field Value
    Type Description
    NativeArray<float3>

    metricIndex

    Denotes the metric index that this trajectory fragment belongs to.

    Declaration
    public Binary.MetricIndex metricIndex
    Field Value
    Type Description
    Binary.MetricIndex

    samplingTime

    Denotes the sampling time that this trajectory fragment was generated from.

    Declaration
    public SamplingTime samplingTime
    Field Value
    Type Description
    SamplingTime

    Properties

    Invalid

    Represents an invalid trajectory fragment.

    Declaration
    public static Binary.TrajectoryFragment Invalid { get; }
    Property Value
    Type Description
    Binary.TrajectoryFragment

    IsValid

    Determines whether or not this trajectory fragment is valid.

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

    Item[Int32]

    Gives access to the individual pose fragment features.

    Declaration
    public float3 this[int index] { get; }
    Parameters
    Type Name Description
    Int32 index
    Property Value
    Type Description
    float3

    length

    Denotes the size of the feature array.

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

    Methods

    Dispose()

    Disposes the underlying feature array.

    Declaration
    public void Dispose()

    Equals(Binary.TrajectoryFragment, Single)

    Determines whether a two trajectory fragments are equal.

    Declaration
    public bool Equals(Binary.TrajectoryFragment instance, float eps)
    Parameters
    Type Name Description
    Binary.TrajectoryFragment instance

    The trajectory fragment to compare against the current trajectory fragment.

    Single eps

    Tolerance value to indicate by how much the result can diverge before being considered unequal.

    Returns
    Type Description
    Boolean

    True if the trajectory fragment passed as argument is equal to the current trajectory fragment; otherwise, false.

    GetRootDisplacement(ref Binary, Int32)

    Returns root displacement of a trajectory sample, relative to the root transform of the character at fragment sampling time

    Declaration
    public float3 GetRootDisplacement(ref Binary binary, int index)
    Parameters
    Type Name Description
    Binary binary
    Int32 index

    Index of the trajectory sample

    Returns
    Type Description
    float3

    GetRootForward(ref Binary, Int32)

    Returns root forward vector of a trajectory sample, relative to the root transform of the character at fragment sampling time

    Declaration
    public float3 GetRootForward(ref Binary binary, int index)
    Parameters
    Type Name Description
    Binary binary
    Int32 index

    Index of the trajectory sample

    Returns
    Type Description
    float3

    GetRootVelocity(ref Binary, Int32)

    Returns root velocity of a trajectory sample, relative to the root transform of the character at fragment sampling time

    Declaration
    public float3 GetRootVelocity(ref Binary binary, int index)
    Parameters
    Type Name Description
    Binary binary
    Int32 index

    Index of the trajectory sample

    Returns
    Type Description
    float3
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023