Struct MagicLeapTouchpadGestureEvent
The event data related to a Magic Leap Touchpad gesture
Inherited Members
Namespace: UnityEngine.XR.MagicLeap
Syntax
public struct MagicLeapTouchpadGestureEvent : IEquatable<MagicLeapTouchpadGestureEvent>
Constructors
MagicLeapTouchpadGestureEvent(GestureId, GestureState, Byte, Single, MagicLeapTouchpadGestureDirection, Single, Vector3, Single, Single, MagicLeapInputControllerTouchpadGestureType)
Constructs a new MagicLeapTouchpadGestureEvent.
Declaration
public MagicLeapTouchpadGestureEvent(GestureId id, GestureState state, byte controllerId, float angle, MagicLeapTouchpadGestureDirection direction, float distance, 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. |
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 |
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)
Equals test
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj | Object to compare with |
Returns
Type | Description |
---|---|
Boolean |
|
Overrides
Equals(MagicLeapTouchpadGestureEvent)
Equals test
Declaration
public bool Equals(MagicLeapTouchpadGestureEvent other)
Parameters
Type | Name | Description |
---|---|---|
MagicLeapTouchpadGestureEvent | other | other object to compare with |
Returns
Type | Description |
---|---|
Boolean | true if equal |
Implements
GetDefault()
Gets a default-initialized MagicLeapTouchpadGestureEvent.
Declaration
public static MagicLeapTouchpadGestureEvent GetDefault()
Returns
Type | Description |
---|---|
MagicLeapTouchpadGestureEvent | A default MagicLeapTouchpadGestureEvent. |
GetHashCode()
Generate a hash code from this object
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 | Integer representing the hash code of this object. |
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)
Equivalency operator
Declaration
public static bool operator ==(MagicLeapTouchpadGestureEvent lhs, MagicLeapTouchpadGestureEvent rhs)
Parameters
Type | Name | Description |
---|---|---|
MagicLeapTouchpadGestureEvent | lhs | Left hand side |
MagicLeapTouchpadGestureEvent | rhs | Right hand side |
Returns
Type | Description |
---|---|
Boolean | true if equal |
Inequality(MagicLeapTouchpadGestureEvent, MagicLeapTouchpadGestureEvent)
Inequality operator
Declaration
public static bool operator !=(MagicLeapTouchpadGestureEvent lhs, MagicLeapTouchpadGestureEvent rhs)
Parameters
Type | Name | Description |
---|---|---|
MagicLeapTouchpadGestureEvent | lhs | Left hand side |
MagicLeapTouchpadGestureEvent | rhs | Right hand side |
Returns
Type | Description |
---|---|
Boolean | true if not equal |