docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class XRFingerShapeMath

    Extension methods for XRHand to calculate the XRFingerShape for each finger. Also provides static access to the Finger State Processor that is used to clear the cache of calculated values.

    Inheritance
    object
    XRFingerShapeMath
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.XR.Hands.Gestures
    Assembly: Unity.XR.Hands.dll
    Syntax
    public static class XRFingerShapeMath

    Methods

    CalculateFingerShape(XRHand, XRHandFingerID, XRFingerShapeTypes)

    Calculate values useful for pose detection for a single finger. Will only calculate fields of XRFingerShape for corresponding flags that are set in shapeTypes.

    Declaration
    public static XRFingerShape CalculateFingerShape(this XRHand xrHand, XRHandFingerID fingerID, XRFingerShapeTypes shapeTypes)
    Parameters
    Type Name Description
    XRHand xrHand

    The XRHand from which to get finger joint data.

    XRHandFingerID fingerID

    Denotes which finger to calculate XRFingerState values for.

    XRFingerShapeTypes shapeTypes

    Denotes which fields to calculate in the returned XRFingerShape.

    Returns
    Type Description
    XRFingerShape

    Returns an XRFingerShape with values calculated if their corresponding flags were set in shapeTypes.

    Remarks

    Calling this overload will use a XRFingerShapeConfiguration with the current configuration. The configuration is set to a sensible default provided by the platform.

    CalculateFingerShape(XRHand, XRHandFingerID, XRFingerShapeTypes, XRFingerShapeConfiguration)

    Calculate values useful for pose detection for a single finger. Will only calculate fields of XRFingerShape for corresponding flags that are set in shapeTypes.

    Declaration
    public static XRFingerShape CalculateFingerShape(this XRHand xrHand, XRHandFingerID fingerID, XRFingerShapeTypes shapeTypes, XRFingerShapeConfiguration configuration)
    Parameters
    Type Name Description
    XRHand xrHand

    The XRHand from which to get finger joint data.

    XRHandFingerID fingerID

    Denotes which finger to calculate XRFingerShape values for.

    XRFingerShapeTypes shapeTypes

    Denotes which fields to calculate in the returned XRFingerShape.

    XRFingerShapeConfiguration configuration

    The configuration used to convert joint data to finger state values.

    Returns
    Type Description
    XRFingerShape

    Returns an XRFingerShape with values calculated if their corresponding flags were set in shapeTypes.

    ResetFingerShapeConfiguration(XRHandFingerID)

    Resets the finger state configuration to default for all future calls to XRFingerStateMathUtilities.CalculateFingerStates for the given finger.

    Declaration
    public static void ResetFingerShapeConfiguration(XRHandFingerID fingerID)
    Parameters
    Type Name Description
    XRHandFingerID fingerID

    Which finger to reset the XRFingerShapeConfiguration for.

    Remarks

    If you wish to override the default, call SetFingerShapeConfiguration(XRHandFingerID, XRFingerShapeConfiguration).

    SetFingerShapeConfiguration(XRHandFingerID, XRFingerShapeConfiguration)

    Set the finger state configuration to use for all future calls to XRFingerStateMathUtilities.CalculateFingerStates for the given finger.

    Declaration
    public static void SetFingerShapeConfiguration(XRHandFingerID fingerID, XRFingerShapeConfiguration configuration)
    Parameters
    Type Name Description
    XRHandFingerID fingerID

    Which finger to set the XRFingerShapeConfiguration for.

    XRFingerShapeConfiguration configuration

    The configurations for the given finger. If null, that finger's configuration will revert to an appropriate default.

    Remarks

    If you wish to restore the default, call ResetFingerShapeConfiguration(XRHandFingerID).

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if fileName is null.

    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)