docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct XRFingerShape

    The calculated state of certain relative geometric properties of a finger from a given hand. Useful for pose detection. All values are normalized from 0 to 1.

    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.XR.Hands.Gestures
    Assembly: Unity.XR.Hands.dll
    Syntax
    public struct XRFingerShape
    Remarks

    Do not construct this yourself. Only retrieve it from CalculateFingerShape(XRHand, XRHandFingerID, XRFingerShapeTypes) or CalculateFingerShape(XRHand, XRHandFingerID, XRFingerShapeTypes, XRFingerShapeConfiguration).

    Properties

    types

    Each enabled flag signifies that the corresponding data was successfully updated.

    Declaration
    public readonly XRFingerShapeTypes types { get; }
    Property Value
    Type Description
    XRFingerShapeTypes
    Remarks

    May not necessarily match the types passed to CalculateFingerShape(XRHand, XRHandFingerID, XRFingerShapeTypes) or CalculateFingerShape(XRHand, XRHandFingerID, XRFingerShapeTypes, XRFingerShapeConfiguration), as data required for the calculations is not guaranteed to be available.

    Methods

    TryGetBaseCurl(out float)

    Attempts to retrieve the base-curl value.

    Declaration
    public readonly bool TryGetBaseCurl(out float baseCurl)
    Parameters
    Type Name Description
    float baseCurl

    If successful, will be set to the calculated base-curl value for the requested finger.

    Returns
    Type Description
    bool

    Returns true if successful and baseCurl is set to a usable value. Otherwise, returns false.

    Remarks

    Base-curl represents the extent that the proximal joint is bent.

    TryGetFullCurl(out float)

    Attempts to retrieve the full-curl value.

    Declaration
    public readonly bool TryGetFullCurl(out float fullCurl)
    Parameters
    Type Name Description
    float fullCurl

    If successful, will be set to the calculated full-curl value for the requested finger.

    Returns
    Type Description
    bool

    Returns true if successful and fullCurl is set to a usable value. Otherwise, returns false.

    Remarks

    Full-curl represents how curled the entire finger is. A value of 1 denotes a fully curled finger.

    TryGetPinch(out float)

    Attempts to retrieve the pinch value.

    Declaration
    public readonly bool TryGetPinch(out float pinch)
    Parameters
    Type Name Description
    float pinch

    If successful, will be set to the calculated pinch value for the requested finger.

    Returns
    Type Description
    bool

    Returns true if successful and pinch is set to a usable value. Otherwise, returns false.

    Remarks

    Pinch represents the strength of the pinch between the requested finger tip and the thumb tip. Will never be valid for the thumb (will always have a value of 0 and this method will always return false).

    TryGetSpread(out float)

    Attempts to retrieve the spread value.

    Declaration
    public readonly bool TryGetSpread(out float spread)
    Parameters
    Type Name Description
    float spread

    If successful, will be set to the calculated spread value for the requested finger.

    Returns
    Type Description
    bool

    Returns true if successful and spread is set to a usable value. Otherwise, returns false.

    Remarks

    Spread represents the normalized angle between two adjacent fingers, measured at the base of those two fingers. Will never be valid for the little finger (will always have a value of 0 and this method will always return false).

    TryGetTipCurl(out float)

    Attempts to retrieve the tip-curl value.

    Declaration
    public readonly bool TryGetTipCurl(out float tipCurl)
    Parameters
    Type Name Description
    float tipCurl

    If successful, will be set to the calculated tip-curl value for the requested finger.

    Returns
    Type Description
    bool

    Returns true if successful and tipCurl is set to a usable value. Otherwise, returns false.

    Remarks

    Tip curl represents how bent the top two joints of the finger or thumb are. This feature does not take the proximal joint into consideration.

    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)