// %BANNER_BEGIN%
// ---------------------------------------------------------------------
// %COPYRIGHT_BEGIN%
// Copyright (c) (2019-2022) Magic Leap, Inc. All Rights Reserved.
// Use of this file is governed by the Software License Agreement, located here: https://www.magicleap.com/software-license-agreement-ml2
// Terms and conditions applicable to third-party materials accompanying this distribution may also be found in the top-level NOTICE file appearing herein.
// %COPYRIGHT_END%
// ---------------------------------------------------------------------
// %BANNER_END%
using System.Runtime.InteropServices;
using UnityEngine.XR.MagicLeap.Native;
namespace UnityEngine.XR.MagicLeap
{
public static partial class InputSubsystem
{
public static partial class Extensions
{
public static class TouchpadGesture
{
///
/// Gesture state. Links to MLInputControllerTouchpadGestureState in ml_input.h.
///
public enum State : uint
{
///
/// State: End
///
End = 0,
///
/// State: Continue
///
Continue,
///
/// State: Start
///
Start
}
///
/// Recognized touchpad gesture types. Links to MLInputControllerTouchpadGestureType in ml_input.h.
///
public enum Type : uint
{
///
/// Type: None
///
None = 0,
///
/// Type: Tap
///
Tap,
///
/// Type: Force Tap Down
///
ForceTapDown,
///
/// Type: Force Tap Up
///
ForceTapUp,
///
/// Type: Force Dwell
///
ForceDwell,
///
/// Type: Second Force Down
///
SecondForceDown,
///
/// Type: Radial Scroll
///
RadialScroll,
///
/// Type: Swipe
///
Swipe,
}
///
/// Direction of touchpad gesture. Links to MLInputControllerTouchpadGestureDirection in ml_input.h.
///
public enum Direction : uint
{
///
/// Direction: None
///
None = 0,
///
/// Direction: Up
///
Up,
///
/// Direction: Down
///
Down,
///
/// Direction: Left
///
Left,
///
/// Direction: Right
///
Right,
///
/// Direction: Clockwise
///
Clockwise,
///
/// Direction: Counter Clockwise
///
CounterClockwise
}
public struct Data
{
public Vector3 PositionAndForce;
public Type Type;
public Direction Direction;
public float Speed;
public float Distance;
public float Radius;
public float Angle;
public override string ToString() => $"PositionAndForce: {PositionAndForce}, Type: {Type}, Direction: {Direction}, Speed: {Speed}, Distance: {Distance}, Radius: {Radius}, Angle: {Angle}";
}
}
}
}
}