Class GestureModuleWearable Only

Allows to detect hand gestures using machine learning algorithms.

Gesture Module guide.

@component
export class PinchExample extends BaseScriptComponent {
private gestureModule: GestureModule = require('LensStudio:GestureModule');
onAwake() {
this.gestureModule
.getPinchDownEvent(GestureModule.HandType.Right)
.add((pinchDownArgs: PinchDownArgs) => {
print('Right Hand Pinch Down');
});

this.gestureModule
.getPinchUpEvent(GestureModule.HandType.Right)
.add((pinchUpArgs: PinchUpArgs) => {
print('Right Hand Pinch Up');
});

this.gestureModule
.getPinchStrengthEvent(GestureModule.HandType.Right)
.add((pinchStrengthArgs: PinchStrengthArgs) => {
print('Right Hand Pinch Strength: ' + pinchStrengthArgs.strength);
});

this.gestureModule
.getGrabBeginEvent(GestureModule.HandType.Right)
.add((grabBeginArgs: GrabBeginArgs) => {
print('Right Hand Grab Begin');
});
}
}

Hierarchy (View Summary, Expand)

Constructors

Properties

name: string

The name of the Asset in Lens Studio.

uniqueIdentifier: string

Methods

  • Triggered when a phone is detected in a hand. Note: Only smartphone-like objects are detected.

    Details: The event indicates that the state of a hand not holding a phone has changed to a hand holding a phone. If a Lens contains a GestureModel and has subscribed to getIsPhoneInHandBeginEvent, an initial event is always sent at the start of the Lens if a hand already holds a phone.

    For technical reasons, if a Lens does not initially subscribe to getIsPhoneInHandBeginEvent, but subscribes at a later time, no initial event will be sent after subscription.

    Parameters

    Returns event1<IsPhoneInHandBeginArgs, void>

  • Triggered when a phone is no longer detected in a hand. Note: Only smartphone-like objects are considered.

    Details: The event indicates that the state of a hand holding a phone has changed to a hand not holding a phone. If a Lens contains a GestureModel and has subscribed to getIsPhoneInHandEndEvent, an initial event is always sent at the start of the Lens if a hand does not hold a phone.

    For technical reasons, if a Lens does not initially subscribe to getIsPhoneInHandEndEvent, but subscribes at a later time, no initial event will be sent after subscription.

    Parameters

    Returns event1<IsPhoneInHandEndArgs, void>

  • Returns the name of this object's type.

    Returns string

  • Returns true if the object matches or derives from the passed in type.

    Parameters

    • type: string

    Returns boolean

  • Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

    Parameters

    Returns boolean

MMNEPVFCICPMFPCPTTAAATR