Skip to content

Input Modules꞉ LeapMotion

Zach Kinstner edited this page Jul 5, 2018 · 5 revisions

This module converts fingertips and palms into cursors. It references the "Orion" SDK, which is not compatible with previous versions. The module's main component provides properties for using stabilized positions and for extending cursors beyond the ends of the fingers.

Cursors

LeapMotion Cursors 📷 Cursors attached to specific points on the LeapMotion hands

This animation shows all the available cursors enabled simultaneously. A more common usage would be to enable only one or two cursors per hand.

SDK

This input module is compatible with the Leap Motion Core Assets v4.4.0+ SDK, with legacy support for Core Assets v3 through v4.3.4.

Scene

The input module scene is named HoverInputModule-LeapMotion, located in the /Assets/Hover/InputModules/LeapMotion/Scenes folder. An alternative scene with support for legacy Core Assets versions (with the "LMHeadMountedRig" prefab) is named HoverInputModule-LeapMotion-Pre-4-4-0, located in the same folder.

Installation

See the Input Modules page for details about loading input module scenes and defining symbols. To install this input module via its pre-built scene:

  1. Attach the HoverSceneLoader component to an object.
    1. For the "Scene Folder Path" and "Scene Name" properties, replace the "NAME" placeholder text with "LeapMotion".
    2. To load the scene before runtime, click the "Reload Scene" button.
  2. Define the HOVER_INPUT_LEAPMOTION symbol.

To install this module manually:

  1. Add the LMHeadMountedRig prefab to the scene.
  2. Attach the HoverInputLeapMotion component to the prefab's root object.
  3. Define the HOVER_INPUT_LEAPMOTION symbol.

Component

LeapMotion Component 📷 The HoverInputLeapMotion component

  • The "Cursor Data Provider" property will automatically attempt to find the HoverCursorDataProvider component (in the HoverKit prefab).
  • The "Leap Service Provider" and "Look Cursor Transform" properties will be set automatically.
  • The "Use Stabilized Positions" property enables smoother cursor motion, but introduces lag.
  • The "Extend Fingertip Distance" property pushes the cursors outward from the fingertips, in the forward-pointing direction of the finger.

Raycast Cursors

LeapMotion Raycasts 📷 All cursors set to "Is Raycast" mode

This animation shows all the available cursors projecting raycast lines. Typically, a scene the requires raycast functionality would enable only one cursor per hand. Note that the "Palm" cursors use the hand's forward direction (which is perpendicular to the palm normal) as their raycast direction.

Clone this wiki locally