Struct MagicLeapTouchpadGestureEvent
The event data related to a Magic Leap Touchpad gesture
Namespace: UnityEngine.XR.MagicLeap
Syntax
public struct MagicLeapTouchpadGestureEvent : IEquatable<MagicLeapTouchpadGestureEvent>
Constructors
MagicLeapTouchpadGestureEvent(GestureId, GestureState, Byte, Single, MagicLeapTouchpadGestureDirection, Single, Single, Vector3, Single, Single, MagicLeapInputControllerTouchpadGestureType)
Constructs a new MagicLeapTouchpadGestureEvent.
Declaration
public MagicLeapTouchpadGestureEvent(GestureId id, GestureState state, byte controllerId, float angle, MagicLeapTouchpadGestureDirection direction, float distance, float fingerGap, Vector3 positionAndForce, float radius, float speed, MagicLeapInputControllerTouchpadGestureType type)
Parameters
Type | Name | Description |
---|---|---|
GestureId | id | The GestureId associated with the gesture. |
GestureState | state | The GestureState associated with the gesture. |
Byte | controllerId | The controller id associated with this gesture. |
Single | angle | The angel of the touch of the gesture. |
MagicLeapTouchpadGestureDirection | direction | The direction of the touch of the gesture. |
Single | distance | The distance of the gesture. |
Single | fingerGap | The finger gap the touch of the gesture. |
Vector3 | positionAndForce | The Vector3 position and force of the gesture. |
Single | radius | The radius of the touch of the gesture. |
Single | speed | The speed of the gesture. |
MagicLeapInputControllerTouchpadGestureType | type | The MagicLeapInputControllerTouchpadGestureType type of the gesture. |
Properties
angle
Angle from the center of the touchpad to the finger.
Declaration
public readonly float angle { get; }
Property Value
Type | Description |
---|---|
Single |
controllerId
The controller id associated with this gesture.
Declaration
public readonly byte controllerId { get; }
Property Value
Type | Description |
---|---|
Byte |
direction
Direction of gesture
Declaration
public readonly MagicLeapTouchpadGestureDirection direction { get; }
Property Value
Type | Description |
---|---|
MagicLeapTouchpadGestureDirection |
distance
For radial gestures, this is the absolute value of the angle. For scroll and pinch gestures, this is the absolute distance traveled in touchpad distance. The touchpad is defined as having extents of [-1.0,1.0] so this distance has a range of [0.0,2.0].
Declaration
public readonly float distance { get; }
Property Value
Type | Description |
---|---|
Single |
fingerGap
Distance between the two fingers performing the gestures in touchpad distance. The touchpad is defined as having extents of [-1.0,1.0] so this distance has a range of [0.0,2.0].
Declaration
public readonly float fingerGap { get; }
Property Value
Type | Description |
---|---|
Single |
id
The GestureId associated with this gesture.
Declaration
public readonly GestureId id { get; }
Property Value
Type | Description |
---|---|
GestureId |
positionAndForce
Gesture position (x,y) and force (z). Position is in the [-1.0,1.0] range and force is in the [0.0,1.0] range.
Declaration
public readonly Vector3 positionAndForce { get; }
Property Value
Type | Description |
---|---|
Vector3 |
radius
For radial gestures, this is the radius of the gesture. The touchpad is defined as having extents of [-1.0,1.0] so this radius has a range of [0.0,2.0].
Declaration
public readonly float radius { get; }
Property Value
Type | Description |
---|---|
Single |
speed
Speed of gesture. Note that this takes on different meanings depending on the gesture type being performed:
Declaration
public readonly float speed { get; }
Property Value
Type | Description |
---|---|
Single |
state
The state of the gesture.
Declaration
public readonly GestureState state { get; }
Property Value
Type | Description |
---|---|
GestureState |
type
Type of gesture.
Declaration
public readonly MagicLeapInputControllerTouchpadGestureType type { get; }
Property Value
Type | Description |
---|---|
MagicLeapInputControllerTouchpadGestureType |
Methods
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj |
Returns
Type | Description |
---|---|
Boolean |
Overrides
Equals(MagicLeapTouchpadGestureEvent)
Declaration
public bool Equals(MagicLeapTouchpadGestureEvent other)
Parameters
Type | Name | Description |
---|---|---|
MagicLeapTouchpadGestureEvent | other |
Returns
Type | Description |
---|---|
Boolean |
GetDefault()
Gets a default-initialized MagicLeapTouchpadGestureEvent.
Declaration
public static MagicLeapTouchpadGestureEvent GetDefault()
Returns
Type | Description |
---|---|
MagicLeapTouchpadGestureEvent | A default MagicLeapTouchpadGestureEvent. |
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 |
Overrides
ToString()
Generates a new string describing the gestures's properties suitable for debugging purposes.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | A string describing the gestures's properties. |
Overrides
Operators
Equality(MagicLeapTouchpadGestureEvent, MagicLeapTouchpadGestureEvent)
Declaration
public static bool operator ==(MagicLeapTouchpadGestureEvent lhs, MagicLeapTouchpadGestureEvent rhs)
Parameters
Type | Name | Description |
---|---|---|
MagicLeapTouchpadGestureEvent | lhs | |
MagicLeapTouchpadGestureEvent | rhs |
Returns
Type | Description |
---|---|
Boolean |
Inequality(MagicLeapTouchpadGestureEvent, MagicLeapTouchpadGestureEvent)
Declaration
public static bool operator !=(MagicLeapTouchpadGestureEvent lhs, MagicLeapTouchpadGestureEvent rhs)
Parameters
Type | Name | Description |
---|---|---|
MagicLeapTouchpadGestureEvent | lhs | |
MagicLeapTouchpadGestureEvent | rhs |
Returns
Type | Description |
---|---|
Boolean |