docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct VisionOSSpatialPointerState

    The input state of a visionOS spatial pointer.

    Implements
    IInputStateTypeInfo
    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.XR.VisionOS.InputDevices
    Assembly: Unity.XR.VisionOS.dll
    Syntax
    public struct VisionOSSpatialPointerState : IInputStateTypeInfo

    Fields

    LayoutName

    The layout name of the spatial pointer state struct.

    Declaration
    public const string LayoutName = "VisionOSSpatialPointer"
    Field Value
    Type Description
    string

    SizeInBytes

    The size in bytes of the spatial pointer state struct.

    Declaration
    public const int SizeInBytes = 97
    Field Value
    Type Description
    int

    inputDevicePosition

    The input device position of the spatial pointer state.

    Declaration
    [InputControl(displayName = "Input Device Position", noisy = true, dontReset = true)]
    public Vector3 inputDevicePosition
    Field Value
    Type Description
    Vector3

    inputDeviceRotation

    The input device rotation of the spatial pointer state.

    Declaration
    [InputControl(displayName = "Input Device Rotation", noisy = true, dontReset = true)]
    public Quaternion inputDeviceRotation
    Field Value
    Type Description
    Quaternion

    interactionId

    The interaction ID of the spatial pointer state.

    Declaration
    [InputControl(displayName = "Interaction ID", layout = "Integer", synthetic = true, dontReset = true)]
    public int interactionId
    Field Value
    Type Description
    int

    interactionRayRotation

    The interaction ray rotation of the spatial pointer state.

    Declaration
    [InputControl(displayName = "Interaction Ray Rotation", noisy = true, dontReset = true)]
    public Quaternion interactionRayRotation
    Field Value
    Type Description
    Quaternion

    isTracked

    The tracking status of the spatial pointer state.

    Declaration
    [InputControl(name = "isTracked", displayName = "IsTracked", layout = "Button", synthetic = true)]
    public bool isTracked
    Field Value
    Type Description
    bool

    kindId

    The byte representation of the spatial pointer's VisionOSSpatialPointerKind.

    Declaration
    [InputControl(name = "kind", displayName = "Kind", layout = "Integer", synthetic = true)]
    public byte kindId
    Field Value
    Type Description
    byte

    modifierKeys

    The modifier key states of the spatial pointer state.

    Declaration
    [InputControl(displayName = "Modifier Keys", layout = "Integer", synthetic = true)]
    public ushort modifierKeys
    Field Value
    Type Description
    ushort

    phaseId

    The byte representation of the spatial pointer's phase Id.

    Declaration
    [InputControl(name = "phase", displayName = "Phase", layout = "TouchPhase", synthetic = true)]
    public byte phaseId
    Field Value
    Type Description
    byte

    startRayDirection

    The start ray direction of the spatial pointer state.

    Declaration
    [InputControl(displayName = "Start Ray Direction", noisy = true, dontReset = true)]
    public Vector3 startRayDirection
    Field Value
    Type Description
    Vector3

    startRayOrigin

    The start ray origin of the spatial pointer state.

    Declaration
    [InputControl(displayName = "Start Ray Origin", noisy = true, dontReset = true)]
    public Vector3 startRayOrigin
    Field Value
    Type Description
    Vector3

    startRayRotation

    The start ray rotation of the spatial pointer state.

    Declaration
    [InputControl(displayName = "Start Ray Rotation", noisy = true, dontReset = true)]
    public Quaternion startRayRotation
    Field Value
    Type Description
    Quaternion

    trackingState

    The input tracking state of the spatial pointer state.

    Declaration
    [InputControl(name = "trackingState", displayName = "TrackingState", layout = "Integer", synthetic = true)]
    public InputTrackingState trackingState
    Field Value
    Type Description
    InputTrackingState

    Properties

    Format

    The four character format of the spatial pointer state.

    Declaration
    public static FourCC Format { get; }
    Property Value
    Type Description
    FourCC

    Kind

    Represents the pointer event kind of the pointer state.

    Declaration
    public VisionOSSpatialPointerKind Kind { get; set; }
    Property Value
    Type Description
    VisionOSSpatialPointerKind

    format

    The four character code representing the input events of the native visionOS backend.

    Declaration
    public FourCC format { get; }
    Property Value
    Type Description
    FourCC

    isNoneEndedOrCanceled

    Returns true if the state is none, ended or cancelled.

    Declaration
    public bool isNoneEndedOrCanceled { get; }
    Property Value
    Type Description
    bool

    phase

    The phase of the spatial pointer event.

    Declaration
    public VisionOSSpatialPointerPhase phase { get; set; }
    Property Value
    Type Description
    VisionOSSpatialPointerPhase

    Methods

    IsModifierKeyPressed(VisionOSSpatialPointerModifierKeys)

    Determines if the specified modifier key is pressed.

    Declaration
    public bool IsModifierKeyPressed(VisionOSSpatialPointerModifierKeys key)
    Parameters
    Type Name Description
    VisionOSSpatialPointerModifierKeys key

    The key to query it's pressed state.

    Returns
    Type Description
    bool

    A boolean that represents the pressed state.

    SetModifierKey(bool, ushort)

    Manually sets the state of a specific modifier key.

    Declaration
    public void SetModifierKey(bool state, ushort modifierKey)
    Parameters
    Type Name Description
    bool state

    The state in which to update the modifier key.

    ushort modifierKey

    The modifier key to update.

    Implements

    IInputStateTypeInfo
    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)