#if AR_FOUNDATION_PRESENT || PACKAGE_DOCS_GENERATION using System.Runtime.InteropServices; using UnityEngine.InputSystem.Layouts; using UnityEngine.InputSystem.LowLevel; using UnityEngine.InputSystem.Utilities; namespace UnityEngine.XR.Interaction.Toolkit.AR.Inputs { /// /// State for input device representing touchscreen gestures. /// [StructLayout(LayoutKind.Explicit, Size = 116)] public struct TouchscreenGestureInputControllerState : IInputStateTypeInfo { /// /// Memory format identifier for . /// /// public static FourCC formatId => new FourCC('T', 'S', 'G', 'C'); /// /// The data format identifier of the state. /// public FourCC format => formatId; /// /// The screen position where the tap gesture started. /// [InputControl(usage = "tapStartPosition", offset = 0)] [FieldOffset(0)] public Vector2 tapStartPosition; /// /// The screen position where the drag gesture started. /// [InputControl(usage = "dragStartPosition", offset = 8)] [FieldOffset(8)] public Vector2 dragStartPosition; /// /// The current screen position of the drag gesture. /// [InputControl(usage = "dragCurrentPosition", offset = 16)] [FieldOffset(16)] public Vector2 dragCurrentPosition; /// /// The delta screen position of the drag gesture. /// [InputControl(usage = "dragDelta", offset = 24)] [FieldOffset(24)] public Vector2 dragDelta; /// /// The screen position of the first finger where the pinch gesture started. /// [InputControl(usage = "pinchStartPosition1", offset = 32)] [FieldOffset(32)] public Vector2 pinchStartPosition1; /// /// The screen position of the second finger where the pinch gesture started. /// [InputControl(usage = "pinchStartPosition2", offset = 40)] [FieldOffset(40)] public Vector2 pinchStartPosition2; /// /// The gap between then position of the first and second fingers for the pinch gesture. /// [InputControl(usage = "pinchGap", offset = 48, layout = "Axis")] [FieldOffset(48)] public float pinchGap; /// /// The gap delta between then position of the first and second fingers for the pinch gesture. /// [InputControl(usage = "pinchGapDelta", offset = 52, layout = "Axis")] [FieldOffset(52)] public float pinchGapDelta; /// /// The screen position of the first finger where the twist gesture started. /// [InputControl(usage = "twistStartPosition1", offset = 56)] [FieldOffset(56)] public Vector2 twistStartPosition1; /// /// The screen position of the second finger where the twist gesture started. /// [InputControl(usage = "twistStartPosition2", offset = 64)] [FieldOffset(64)] public Vector2 twistStartPosition2; /// /// The delta rotation of the twist gesture. /// [InputControl(usage = "twistDeltaRotation", offset = 72, layout = "Axis")] [FieldOffset(72)] public float twistDeltaRotation; /// /// The screen position of the first finger where the two-finger drag gesture started. /// [InputControl(usage = "twoFingerDragStartPosition1", offset = 76)] [FieldOffset(76)] public Vector2 twoFingerDragStartPosition1; /// /// The screen position of the second finger where the two-finger drag gesture started. /// [InputControl(usage = "twoFingerDragStartPosition2", offset = 84)] [FieldOffset(84)] public Vector2 twoFingerDragStartPosition2; /// /// The current screen position of the two-finger drag gesture. /// [InputControl(usage = "twoFingerDragCurrentPosition", offset = 92)] [FieldOffset(92)] public Vector2 twoFingerDragCurrentPosition; /// /// The delta screen position of the two-finger drag gesture. /// [InputControl(usage = "twoFingerDragDelta", offset = 100)] [FieldOffset(100)] public Vector2 twoFingerDragDelta; /// /// The number of fingers on the touchscreen. /// [InputControl(usage = "fingerCount", offset = 108, layout = "Integer")] [FieldOffset(108)] public int fingerCount; } } #endif