LeapMotion Class

Extends Object3D
Module: Devices

Leap device object based on the official LeapJS runtime.

Used to connect nunuStudio to a leap motion hand tracker, works on Windows and MacOS.

Constructor

LeapMotion

()

Methods

checkGesture

(
  • gesture
)
Boolean

Check if a gesture is occuring, is true while the gesture is occuring.

Parameters:

  • gesture Number

    Gesture to check

Returns:

Boolean:

True if the gesture is occuring

checkPose

(
  • pose
)
Boolean

Check if hand is in pose.

Parameters:

  • pose Number

    Pose to be checked

Returns:

Boolean:

True is hand is in this pose

getMovement

() Number

Get hand speed (temporaly normalized).

Returns:

Number:

Hand speed

initialize

()

Initialize LeapMotion object.

Called automatically by the runtime.

Connects to the websocket provided by the leap driver.

setMode

(
  • mode
)

Set hand tracking mode.

Can be set to HDM or Desktop mode.

Parameters:

  • mode Number

    Mode

toJSON

()

Create JSON for object.

update

()

Update leap status.

Called automatically by the runtime.

updateDebugModel

()

Update internal hand debug model.

Automatically called by the update method if debugModel is set to true.

updateGestures

()

Update leap object gesture flags from collected data.

Called automatically by the update method.

updatePoses

()

Update leap object pose flags from collected data.

Called automatically by the update methos.

Properties

debugModel

Boolean

Debug model flag.

Default: true

gesturesEnabled

Boolean

Flag to enable gesture detection.

Default: true

mode

Number

Hand tracking mode.

Default: DESK

posesEnabled

Boolean

Flag to enable hand pose detection.

Default: true

useArm

Boolean

Flag to set arm tracking.

Default: false

Attributes

CIRCLE

Number

Leap CIRCLE gesture

CLOSED

Number

Hand CLOSED pose

DESK

Number

Leap tracking desktop mode

DESK

Number

Leap tracking HDM mode

KEY_TAP

Number

Leap KEY_TAP gesture

OPEN

Number

Hand OPEN pose

POINTING

Number

Hand POINTING pose

SCREEN_TAP

Number

Leap SCREEN_TAP gesture

SWIPE

Number

Leap SWIPE gesture

SWIPE_BACK

Number

Leap SWIPE_BACK gesture

SWIPE_DOWN

Number

Leap SWIPE_DOWN gesture

SWIPE_FRONT

Number

Leap SWIPE_FRONT gesture

SWIPE_LEFT

Number

Leap SWIPE_LEFT gesture

SWIPE_RIGHT

Number

Leap SWIPE_RIGHT gesture

SWIPE_UP

Number

Leap SWIPE_UP gesture