Tanoda
Leap.Unity.InputModule.LeapInputModule Class Reference
Inheritance diagram for Leap.Unity.InputModule.LeapInputModule:

Classes

class  PositionEvent
 

Public Types

enum  InteractionCapability : int { Hybrid , Tactile , Projective }
 

Public Member Functions

override void Process ()
 
bool isTriggeringInteraction (int whichPointer, int whichHand, int whichFinger)
 
float distanceOfTipToPointer (int whichPointer, int whichHand, int whichFinger)
 
float distanceOfTipToElement (Transform UIElement, int whichHand, int whichFinger)
 
bool getTouchingMode ()
 
bool getTouchingMode (int whichPointer)
 
void lerpPointerColor (int whichPointer, Color color, float lerpalpha)
 
override bool ShouldActivateModule ()
 

Public Attributes

LeapProvider LeapDataProvider
 
Leap.Unity.PinchDetector LeftHandDetector
 
Leap.Unity.PinchDetector RightHandDetector
 
Sprite PointerSprite
 
Material PointerMaterial
 
Color StandardColor = Color.white
 
Color HoveringColor = Color.green
 
Color TriggeringColor = Color.gray
 
Color TriggerMissedColor = Color.gray
 
bool ShowAdvancedOptions = false
 
float TactilePadding = 0.005f
 
AudioClip BeginHoverSound
 
AudioClip EndHoverSound
 
AudioClip BeginTriggerSound
 
AudioClip EndTriggerSound
 
AudioClip BeginMissedSound
 
AudioClip EndMissedSound
 
AudioClip DragLoopSound
 
PositionEvent onClickDown
 
PositionEvent onClickUp
 
PositionEvent onHover
 
PositionEvent whileClickHeld
 
bool ShowExperimentalOptions = false
 
InteractionCapability InteractionMode = InteractionCapability.Tactile
 
float ProjectiveToTactileTransitionDistance = 0.4f
 
AnimationCurve PointerDistanceScale = AnimationCurve.Linear(0f, 0.1f, 6f, 1f)
 
AnimationCurve PointerPinchScale = AnimationCurve.Linear(30f, 0.6f, 70f, 1.1f)
 
float PinchingThreshold = 30f
 
bool perFingerPointer = false
 
bool EnvironmentPointer = false
 
PositionEvent environmentPinch
 
bool InnerPointer = true
 
float InnerPointerOpacityScalar = 0.77f
 
bool TriggerHoverOnElementSwitch = false
 
bool OverrideScrollViewClicks = false
 
bool DrawDebug = false
 
bool RetractUI = false
 
bool MovingReferenceFrame = false
 

Protected Member Functions

override void Start ()
 

Detailed Description

An InputModule that supports the use of Leap Motion tracking data for manipulating Unity UI controls.

Definition at line 17 of file LeapInputModule.cs.

Member Enumeration Documentation

◆ InteractionCapability

Defines the interaction modes :

  • Hybrid: Both tactile and projective interaction. The active mode depends on the ProjectiveToTactileTransitionDistance value.
  • Tactile: The user must physically touch the controls.
  • Projective: A cursor is projected from the user's knuckle.
Enumerator
Hybrid 
Tactile 
Projective 

Definition at line 115 of file LeapInputModule.cs.

Member Function Documentation

◆ distanceOfTipToElement()

float Leap.Unity.InputModule.LeapInputModule.distanceOfTipToElement ( Transform  UIElement,
int  whichHand,
int  whichFinger 
)

The z position of the index finger tip to the specified transform.

Definition at line 922 of file LeapInputModule.cs.

◆ distanceOfTipToPointer()

float Leap.Unity.InputModule.LeapInputModule.distanceOfTipToPointer ( int  whichPointer,
int  whichHand,
int  whichFinger 
)

The z position of the index finger tip to the Pointer.

Definition at line 915 of file LeapInputModule.cs.

◆ getTouchingMode() [1/2]

bool Leap.Unity.InputModule.LeapInputModule.getTouchingMode ( )

Returns true if any active pointer is in the "touching" interaction mode, i.e, whether it is touching or nearly touching a canvas or control.

Definition at line 929 of file LeapInputModule.cs.

◆ getTouchingMode() [2/2]

bool Leap.Unity.InputModule.LeapInputModule.getTouchingMode ( int  whichPointer)

Returns true if the specified pointer is in the "touching" interaction mode, i.e, whether it is touching or nearly touching a canvas or control.

Definition at line 940 of file LeapInputModule.cs.

◆ isTriggeringInteraction()

bool Leap.Unity.InputModule.LeapInputModule.isTriggeringInteraction ( int  whichPointer,
int  whichHand,
int  whichFinger 
)

A boolean function that returns true if a "click" is being triggered during the current frame.

Definition at line 892 of file LeapInputModule.cs.

◆ lerpPointerColor()

void Leap.Unity.InputModule.LeapInputModule.lerpPointerColor ( int  whichPointer,
Color  color,
float  lerpalpha 
)

Linearly interpolates the color of a cursor toward the specified color.

Parameters
whichPointerThe identifier of the pointer to change.
colorThe target color.
lerpalphaThe amount to interpolate by.

Definition at line 995 of file LeapInputModule.cs.

◆ Process()

override void Leap.Unity.InputModule.LeapInputModule.Process ( )

Definition at line 333 of file LeapInputModule.cs.

◆ ShouldActivateModule()

override bool Leap.Unity.InputModule.LeapInputModule.ShouldActivateModule ( )

Only activate the InputModule when there are hands in the scene.

Definition at line 1043 of file LeapInputModule.cs.

◆ Start()

override void Leap.Unity.InputModule.LeapInputModule.Start ( )
protected

Definition at line 213 of file LeapInputModule.cs.

Member Data Documentation

◆ BeginHoverSound

AudioClip Leap.Unity.InputModule.LeapInputModule.BeginHoverSound

The sound that is played when the pointer transitions from canvas to element.

Definition at line 67 of file LeapInputModule.cs.

◆ BeginMissedSound

AudioClip Leap.Unity.InputModule.LeapInputModule.BeginMissedSound

The sound that is played when the pointer triggers blank canvas.

Definition at line 79 of file LeapInputModule.cs.

◆ BeginTriggerSound

AudioClip Leap.Unity.InputModule.LeapInputModule.BeginTriggerSound

The sound that is played when the pointer triggers a UI element.

Definition at line 73 of file LeapInputModule.cs.

◆ DragLoopSound

AudioClip Leap.Unity.InputModule.LeapInputModule.DragLoopSound

The sound that is played while the pointer is dragging an object.

Definition at line 85 of file LeapInputModule.cs.

◆ DrawDebug

bool Leap.Unity.InputModule.LeapInputModule.DrawDebug = false

Draw the raycast for projective interaction.

Definition at line 158 of file LeapInputModule.cs.

◆ EndHoverSound

AudioClip Leap.Unity.InputModule.LeapInputModule.EndHoverSound

The sound that is played when the pointer transitions from canvas to element.

Definition at line 70 of file LeapInputModule.cs.

◆ EndMissedSound

AudioClip Leap.Unity.InputModule.LeapInputModule.EndMissedSound

The sound that is played when the pointer triggers blank canvas.

Definition at line 82 of file LeapInputModule.cs.

◆ EndTriggerSound

AudioClip Leap.Unity.InputModule.LeapInputModule.EndTriggerSound

The sound that is played when the pointer triggers a UI element.

Definition at line 76 of file LeapInputModule.cs.

◆ environmentPinch

PositionEvent Leap.Unity.InputModule.LeapInputModule.environmentPinch

The event that is triggered while pinching to a point in the environment.

Definition at line 143 of file LeapInputModule.cs.

◆ EnvironmentPointer

bool Leap.Unity.InputModule.LeapInputModule.EnvironmentPointer = false

Render the pointer onto the enviroment.

Definition at line 140 of file LeapInputModule.cs.

◆ HoveringColor

Color Leap.Unity.InputModule.LeapInputModule.HoveringColor = Color.green

The color for the cursor when it is hovering over a control.

Definition at line 50 of file LeapInputModule.cs.

◆ InnerPointer

bool Leap.Unity.InputModule.LeapInputModule.InnerPointer = true

Render a smaller pointer inside of the main pointer.

Definition at line 146 of file LeapInputModule.cs.

◆ InnerPointerOpacityScalar

float Leap.Unity.InputModule.LeapInputModule.InnerPointerOpacityScalar = 0.77f

The Opacity of the Inner Pointer relative to the Primary Pointer.

Definition at line 149 of file LeapInputModule.cs.

◆ InteractionMode

InteractionCapability Leap.Unity.InputModule.LeapInputModule.InteractionMode = InteractionCapability.Tactile

The mode to use for interaction. The default mode is tactile. The projective mode is considered experimental.

Definition at line 122 of file LeapInputModule.cs.

◆ LeapDataProvider

LeapProvider Leap.Unity.InputModule.LeapInputModule.LeapDataProvider

The LeapProvider providing tracking data to the scene.

Definition at line 22 of file LeapInputModule.cs.

◆ LeftHandDetector

Leap.Unity.PinchDetector Leap.Unity.InputModule.LeapInputModule.LeftHandDetector

An optional component that will be used to detect pinch motions if set. Primarily used for projective or hybrid interaction modes (under experimental features).

Definition at line 27 of file LeapInputModule.cs.

◆ MovingReferenceFrame

bool Leap.Unity.InputModule.LeapInputModule.MovingReferenceFrame = false

Retransform the Interaction Pointer to allow the Module to work in a non-stationary reference frame.

Definition at line 164 of file LeapInputModule.cs.

◆ onClickDown

PositionEvent Leap.Unity.InputModule.LeapInputModule.onClickDown

The event that is triggered upon clicking on a non-canvas UI element.

Definition at line 94 of file LeapInputModule.cs.

◆ onClickUp

PositionEvent Leap.Unity.InputModule.LeapInputModule.onClickUp

The event that is triggered upon lifting up from a non-canvas UI element (Not 1:1 with onClickDown!)

Definition at line 97 of file LeapInputModule.cs.

◆ onHover

PositionEvent Leap.Unity.InputModule.LeapInputModule.onHover

The event that is triggered upon hovering over a non-canvas UI element.

Definition at line 100 of file LeapInputModule.cs.

◆ OverrideScrollViewClicks

bool Leap.Unity.InputModule.LeapInputModule.OverrideScrollViewClicks = false

If the ScrollView still doesn't work even after disabling RaycastTarget on the intermediate layers.

Definition at line 155 of file LeapInputModule.cs.

◆ perFingerPointer

bool Leap.Unity.InputModule.LeapInputModule.perFingerPointer = false

Create a pointer for each finger.

Definition at line 137 of file LeapInputModule.cs.

◆ PinchingThreshold

float Leap.Unity.InputModule.LeapInputModule.PinchingThreshold = 30f

When not using a PinchDetector, the distance in mm that the tip of the thumb and forefinger should be to activate selection during projective interaction.

Definition at line 134 of file LeapInputModule.cs.

◆ PointerDistanceScale

AnimationCurve Leap.Unity.InputModule.LeapInputModule.PointerDistanceScale = AnimationCurve.Linear(0f, 0.1f, 6f, 1f)

The size of the pointer in world coordinates with respect to the distance between the cursor and the camera.

Definition at line 128 of file LeapInputModule.cs.

◆ PointerMaterial

Material Leap.Unity.InputModule.LeapInputModule.PointerMaterial

The cursor material.

Definition at line 44 of file LeapInputModule.cs.

◆ PointerPinchScale

AnimationCurve Leap.Unity.InputModule.LeapInputModule.PointerPinchScale = AnimationCurve.Linear(30f, 0.6f, 70f, 1.1f)

The size of the pointer in world coordinates with respect to the distance between the thumb and forefinger.

Definition at line 131 of file LeapInputModule.cs.

◆ PointerSprite

Sprite Leap.Unity.InputModule.LeapInputModule.PointerSprite

The sprite for the cursor.

Definition at line 41 of file LeapInputModule.cs.

◆ ProjectiveToTactileTransitionDistance

float Leap.Unity.InputModule.LeapInputModule.ProjectiveToTactileTransitionDistance = 0.4f

The distance from the canvas at which to switch to projective mode.

Definition at line 125 of file LeapInputModule.cs.

◆ RetractUI

bool Leap.Unity.InputModule.LeapInputModule.RetractUI = false

Retract compressible widgets when not using Tactile Interaction.

Definition at line 161 of file LeapInputModule.cs.

◆ RightHandDetector

Leap.Unity.PinchDetector Leap.Unity.InputModule.LeapInputModule.RightHandDetector

An optional component that will be used to detect pinch motions if set. Primarily used for projective or hybrid interaction modes (under experimental features).

Definition at line 32 of file LeapInputModule.cs.

◆ ShowAdvancedOptions

bool Leap.Unity.InputModule.LeapInputModule.ShowAdvancedOptions = false

Definition at line 61 of file LeapInputModule.cs.

◆ ShowExperimentalOptions

bool Leap.Unity.InputModule.LeapInputModule.ShowExperimentalOptions = false

Definition at line 106 of file LeapInputModule.cs.

◆ StandardColor

Color Leap.Unity.InputModule.LeapInputModule.StandardColor = Color.white

The color for the cursor when it is not in a special state.

Definition at line 47 of file LeapInputModule.cs.

◆ TactilePadding

float Leap.Unity.InputModule.LeapInputModule.TactilePadding = 0.005f

The distance from the base of a UI element that tactile interaction is triggered.

Definition at line 64 of file LeapInputModule.cs.

◆ TriggerHoverOnElementSwitch

bool Leap.Unity.InputModule.LeapInputModule.TriggerHoverOnElementSwitch = false

Trigger a Hover Event when switching between UI elements.

Definition at line 152 of file LeapInputModule.cs.

◆ TriggeringColor

Color Leap.Unity.InputModule.LeapInputModule.TriggeringColor = Color.gray

The color for the cursor when it is actively interacting with a control.

Definition at line 53 of file LeapInputModule.cs.

◆ TriggerMissedColor

Color Leap.Unity.InputModule.LeapInputModule.TriggerMissedColor = Color.gray

The color for the cursor when it is touching or triggering a non-active part of the UI (such as the canvas).

Definition at line 56 of file LeapInputModule.cs.

◆ whileClickHeld

PositionEvent Leap.Unity.InputModule.LeapInputModule.whileClickHeld

The event that is triggered while holding down a non-canvas UI element.

Definition at line 103 of file LeapInputModule.cs.


The documentation for this class was generated from the following file: