docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ArmModel

    Inheritance
    object
    Object
    Component
    Behaviour
    MonoBehaviour
    BasePoseProvider
    ArmModel
    SwingArmModel
    TransitionArmModel
    Inherited Members
    BasePoseProvider.TryGetPoseFromProvider(out Pose)
    MonoBehaviour.IsInvoking()
    MonoBehaviour.CancelInvoke()
    MonoBehaviour.Invoke(string, float)
    MonoBehaviour.InvokeRepeating(string, float, float)
    MonoBehaviour.CancelInvoke(string)
    MonoBehaviour.IsInvoking(string)
    MonoBehaviour.StartCoroutine(string)
    MonoBehaviour.StartCoroutine(string, object)
    MonoBehaviour.StartCoroutine(IEnumerator)
    MonoBehaviour.StartCoroutine_Auto(IEnumerator)
    MonoBehaviour.StopCoroutine(IEnumerator)
    MonoBehaviour.StopCoroutine(Coroutine)
    MonoBehaviour.StopCoroutine(string)
    MonoBehaviour.StopAllCoroutines()
    MonoBehaviour.print(object)
    MonoBehaviour.useGUILayout
    MonoBehaviour.runInEditMode
    Behaviour.enabled
    Behaviour.isActiveAndEnabled
    Component.GetComponent(Type)
    Component.GetComponent<T>()
    Component.TryGetComponent(Type, out Component)
    Component.TryGetComponent<T>(out T)
    Component.GetComponent(string)
    Component.GetComponentInChildren(Type, bool)
    Component.GetComponentInChildren(Type)
    Component.GetComponentInChildren<T>(bool)
    Component.GetComponentInChildren<T>()
    Component.GetComponentsInChildren(Type, bool)
    Component.GetComponentsInChildren(Type)
    Component.GetComponentsInChildren<T>(bool)
    Component.GetComponentsInChildren<T>(bool, List<T>)
    Component.GetComponentsInChildren<T>()
    Component.GetComponentsInChildren<T>(List<T>)
    Component.GetComponentInParent(Type)
    Component.GetComponentInParent<T>()
    Component.GetComponentsInParent(Type, bool)
    Component.GetComponentsInParent(Type)
    Component.GetComponentsInParent<T>(bool)
    Component.GetComponentsInParent<T>(bool, List<T>)
    Component.GetComponentsInParent<T>()
    Component.GetComponents(Type)
    Component.GetComponents(Type, List<Component>)
    Component.GetComponents<T>(List<T>)
    Component.GetComponents<T>()
    Component.CompareTag(string)
    Component.SendMessageUpwards(string, object, SendMessageOptions)
    Component.SendMessageUpwards(string, object)
    Component.SendMessageUpwards(string)
    Component.SendMessageUpwards(string, SendMessageOptions)
    Component.SendMessage(string, object)
    Component.SendMessage(string)
    Component.SendMessage(string, object, SendMessageOptions)
    Component.SendMessage(string, SendMessageOptions)
    Component.BroadcastMessage(string, object, SendMessageOptions)
    Component.BroadcastMessage(string, object)
    Component.BroadcastMessage(string)
    Component.BroadcastMessage(string, SendMessageOptions)
    Component.transform
    Component.gameObject
    Component.tag
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(object)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, bool)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, float)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectOfType<T>()
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.ToString()
    Object.name
    Object.hideFlags
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.XR.LegacyInputHelpers
    Assembly: UnityEngine.XR.LegacyInputHelpers.dll
    Syntax
    public class ArmModel : BasePoseProvider

    Fields

    DEFAULT_ARM_EXTENSION_OFFSET

    Declaration
    protected static readonly Vector3 DEFAULT_ARM_EXTENSION_OFFSET
    Field Value
    Type Description
    Vector3

    DEFAULT_CONTROLLER_REST_POSITION

    Declaration
    protected static readonly Vector3 DEFAULT_CONTROLLER_REST_POSITION
    Field Value
    Type Description
    Vector3

    DEFAULT_ELBOW_BEND_RATIO

    Declaration
    protected const float DEFAULT_ELBOW_BEND_RATIO = 0.6
    Field Value
    Type Description
    float

    DEFAULT_ELBOW_REST_POSITION

    Declaration
    protected static readonly Vector3 DEFAULT_ELBOW_REST_POSITION
    Field Value
    Type Description
    Vector3

    DEFAULT_WRIST_REST_POSITION

    Declaration
    protected static readonly Vector3 DEFAULT_WRIST_REST_POSITION
    Field Value
    Type Description
    Vector3

    EXTENSION_WEIGHT

    Declaration
    protected const float EXTENSION_WEIGHT = 0.4
    Field Value
    Type Description
    float

    MAX_EXTENSION_ANGLE

    Declaration
    protected const float MAX_EXTENSION_ANGLE = 60
    Field Value
    Type Description
    float

    MIN_EXTENSION_ANGLE

    Declaration
    protected const float MIN_EXTENSION_ANGLE = 7
    Field Value
    Type Description
    float

    NECK_OFFSET

    Declaration
    protected static readonly Vector3 NECK_OFFSET
    Field Value
    Type Description
    Vector3

    SHOULDER_POSITION

    Declaration
    protected static readonly Vector3 SHOULDER_POSITION
    Field Value
    Type Description
    Vector3

    m_ControllerPosition

    Declaration
    protected Vector3 m_ControllerPosition
    Field Value
    Type Description
    Vector3

    m_ControllerRotation

    Declaration
    protected Quaternion m_ControllerRotation
    Field Value
    Type Description
    Quaternion

    m_ElbowPosition

    Declaration
    protected Vector3 m_ElbowPosition
    Field Value
    Type Description
    Vector3

    m_ElbowRotation

    Declaration
    protected Quaternion m_ElbowRotation
    Field Value
    Type Description
    Quaternion

    m_HandedMultiplier

    Declaration
    protected Vector3 m_HandedMultiplier
    Field Value
    Type Description
    Vector3

    m_NeckPosition

    Declaration
    protected Vector3 m_NeckPosition
    Field Value
    Type Description
    Vector3

    m_TorsoDirection

    Declaration
    protected Vector3 m_TorsoDirection
    Field Value
    Type Description
    Vector3

    m_TorsoRotation

    Declaration
    protected Quaternion m_TorsoRotation
    Field Value
    Type Description
    Quaternion

    m_WristPosition

    Declaration
    protected Vector3 m_WristPosition
    Field Value
    Type Description
    Vector3

    m_WristRotation

    Declaration
    protected Quaternion m_WristRotation
    Field Value
    Type Description
    Quaternion

    Properties

    armExtensionOffset

    Offset applied to the elbow position as the controller is rotated upwards.

    Declaration
    public Vector3 armExtensionOffset { get; set; }
    Property Value
    Type Description
    Vector3

    controllerPosition

    Declaration
    public Vector3 controllerPosition { get; }
    Property Value
    Type Description
    Vector3

    controllerRestPosition

    Position of the controller joint relative to the wrist before the arm model is applied.

    Declaration
    public Vector3 controllerRestPosition { get; set; }
    Property Value
    Type Description
    Vector3

    controllerRotation

    Declaration
    public Quaternion controllerRotation { get; }
    Property Value
    Type Description
    Quaternion

    elbowBendRatio

    Ratio of the controller's rotation to apply to the rotation of the elbow. The remaining rotation is applied to the wrist's rotation.

    Declaration
    public float elbowBendRatio { get; set; }
    Property Value
    Type Description
    float

    elbowPosition

    Declaration
    public Vector3 elbowPosition { get; }
    Property Value
    Type Description
    Vector3

    elbowRestPosition

    Position of the elbow joint relative to the head before the arm model is applied.

    Declaration
    public Vector3 elbowRestPosition { get; set; }
    Property Value
    Type Description
    Vector3

    elbowRotation

    Declaration
    public Quaternion elbowRotation { get; }
    Property Value
    Type Description
    Quaternion

    finalPose

    the pose which represents the final tracking result of the arm model

    Declaration
    public Pose finalPose { get; set; }
    Property Value
    Type Description
    Pose

    headGameObject

    The game object which represents the "head" position of the user

    Declaration
    public XRNode headGameObject { get; set; }
    Property Value
    Type Description
    XRNode

    isLockedToNeck

    If true, the root of the pose is locked to the local position of the player's neck.

    Declaration
    public bool isLockedToNeck { get; set; }
    Property Value
    Type Description
    bool

    neckPosition

    Declaration
    public Vector3 neckPosition { get; }
    Property Value
    Type Description
    Vector3

    poseSource

    the pose to use as the input 3DOF position

    Declaration
    public XRNode poseSource { get; set; }
    Property Value
    Type Description
    XRNode

    shoulderPosition

    Declaration
    public Vector3 shoulderPosition { get; }
    Property Value
    Type Description
    Vector3

    shoulderRotation

    Declaration
    public Quaternion shoulderRotation { get; }
    Property Value
    Type Description
    Quaternion

    torsoDirection

    Declaration
    public Vector3 torsoDirection { get; }
    Property Value
    Type Description
    Vector3

    torsoRotation

    Declaration
    public Quaternion torsoRotation { get; }
    Property Value
    Type Description
    Quaternion

    wristPosition

    Declaration
    public Vector3 wristPosition { get; }
    Property Value
    Type Description
    Vector3

    wristRestPosition

    Position of the wrist joint relative to the elbow before the arm model is applied.

    Declaration
    public Vector3 wristRestPosition { get; set; }
    Property Value
    Type Description
    Vector3

    wristRotation

    Declaration
    public Quaternion wristRotation { get; }
    Property Value
    Type Description
    Quaternion

    Methods

    ApplyArmModel()

    Declaration
    protected virtual bool ApplyArmModel()
    Returns
    Type Description
    bool

    ApplyExtensionOffset(float)

    Declaration
    protected virtual void ApplyExtensionOffset(float extensionRatio)
    Parameters
    Type Name Description
    float extensionRatio

    ApplyInverseNeckModel(Vector3, out Vector3)

    Declaration
    protected virtual bool ApplyInverseNeckModel(Vector3 headPosition, out Vector3 calculatedPosition)
    Parameters
    Type Name Description
    Vector3 headPosition
    Vector3 calculatedPosition
    Returns
    Type Description
    bool

    ApplyRotationToJoints()

    Declaration
    protected virtual void ApplyRotationToJoints()

    CalculateExtensionRatio(float)

    Declaration
    protected virtual float CalculateExtensionRatio(float xAngle)
    Parameters
    Type Name Description
    float xAngle
    Returns
    Type Description
    float

    CalculateFinalJointRotations(Quaternion, Quaternion, Quaternion)

    Declaration
    protected virtual void CalculateFinalJointRotations(Quaternion controllerOrientation, Quaternion xyRotation, Quaternion lerpRotation)
    Parameters
    Type Name Description
    Quaternion controllerOrientation
    Quaternion xyRotation
    Quaternion lerpRotation

    CalculateLerpRotation(Quaternion, float)

    Declaration
    protected virtual Quaternion CalculateLerpRotation(Quaternion xyRotation, float extensionRatio)
    Parameters
    Type Name Description
    Quaternion xyRotation
    float extensionRatio
    Returns
    Type Description
    Quaternion

    GetControllerRotation(out Quaternion, out Quaternion, out float)

    Declaration
    protected bool GetControllerRotation(out Quaternion rotation, out Quaternion xyRotation, out float xAngle)
    Parameters
    Type Name Description
    Quaternion rotation
    Quaternion xyRotation
    float xAngle
    Returns
    Type Description
    bool

    GetPoseFromProvider(out Pose)

    Gets the Pose value from the calculated arm model. as the model returns both position and rotation in all cases, we set both flags on return if successful.

    Declaration
    public override PoseDataFlags GetPoseFromProvider(out Pose output)
    Parameters
    Type Name Description
    Pose output
    Returns
    Type Description
    PoseDataFlags
    Overrides
    BasePoseProvider.GetPoseFromProvider(out Pose)

    OnControllerInputUpdated()

    Declaration
    public virtual bool OnControllerInputUpdated()
    Returns
    Type Description
    bool

    OnDisable()

    Declaration
    protected virtual void OnDisable()

    OnDrawGizmos()

    Editor only API to draw debug gizmos to help visualize the arm model

    Declaration
    public virtual void OnDrawGizmos()

    OnEnable()

    Declaration
    protected virtual void OnEnable()

    SetUntransformedJointPositions()

    Declaration
    protected virtual void SetUntransformedJointPositions()

    TryGetAngularAcceleration(XRNode, out Vector3)

    Declaration
    protected bool TryGetAngularAcceleration(XRNode node, out Vector3 angularAccel)
    Parameters
    Type Name Description
    XRNode node
    Vector3 angularAccel
    Returns
    Type Description
    bool

    TryGetAngularVelocity(XRNode, out Vector3)

    Declaration
    protected bool TryGetAngularVelocity(XRNode node, out Vector3 angVel)
    Parameters
    Type Name Description
    XRNode node
    Vector3 angVel
    Returns
    Type Description
    bool

    TryGetForwardVector(XRNode, out Vector3)

    Declaration
    protected bool TryGetForwardVector(XRNode node, out Vector3 forward)
    Parameters
    Type Name Description
    XRNode node
    Vector3 forward
    Returns
    Type Description
    bool

    TryGetPosition(XRNode, out Vector3)

    Declaration
    protected bool TryGetPosition(XRNode node, out Vector3 position)
    Parameters
    Type Name Description
    XRNode node
    Vector3 position
    Returns
    Type Description
    bool

    TryGetRotation(XRNode, out Quaternion)

    Declaration
    protected bool TryGetRotation(XRNode node, out Quaternion rotation)
    Parameters
    Type Name Description
    XRNode node
    Quaternion rotation
    Returns
    Type Description
    bool

    UpdateHandedness()

    Declaration
    protected virtual void UpdateHandedness()

    UpdateNeckPosition()

    Declaration
    protected virtual bool UpdateNeckPosition()
    Returns
    Type Description
    bool

    UpdateTorsoDirection(bool)

    Declaration
    protected virtual bool UpdateTorsoDirection(bool forceImmediate)
    Parameters
    Type Name Description
    bool forceImmediate
    Returns
    Type Description
    bool
    In This Article
    Back to top
    Copyright © 2025 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)