Tanoda
Leap.Unity.FingerDirectionDetector Class Reference
Inheritance diagram for Leap.Unity.FingerDirectionDetector:
Leap.Unity.Detector

Public Attributes

float Period = .1f
 
HandModelBase HandModel = null
 
Finger.FingerType FingerName = Finger.FingerType.TYPE_INDEX
 
PointingType PointingType = PointingType.RelativeToHorizon
 
Vector3 PointingDirection = Vector3.forward
 
Transform TargetObject = null
 
float OnAngle = 15f
 
float OffAngle = 25f
 
bool ShowGizmos = true
 
- Public Attributes inherited from Leap.Unity.Detector
UnityEvent OnActivate
 
UnityEvent OnDeactivate
 

Additional Inherited Members

- Public Member Functions inherited from Leap.Unity.Detector
virtual void Activate ()
 
virtual void Deactivate ()
 
- Protected Attributes inherited from Leap.Unity.Detector
Color OnColor = Color.green
 
Color OffColor = Color.red
 
Color LimitColor = Color.blue
 
Color DirectionColor = Color.white
 
Color NormalColor = Color.gray
 
- Properties inherited from Leap.Unity.Detector
bool IsActive [get]
 

Detailed Description

Detects when specified fingers are pointing in the specified manner.

Directions can be specified relative to the global frame of reference, relative to the camera frame of reference, or using a combination of the two – relative to the camera direction in the x-z plane, but not changing relative to the horizon.

You can alternatively specify a target game object.

If added to a HandModelBase instance or one of its children, this detector checks the finger direction at the interval specified by the Period variable. You can also specify which hand model to observe explicitly by setting handModel in the Unity editor or in code.

Since
4.1.2

Definition at line 30 of file FingerDirectionDetector.cs.

Member Data Documentation

◆ FingerName

Finger.FingerType Leap.Unity.FingerDirectionDetector.FingerName = Finger.FingerType.TYPE_INDEX

The finger to compare to the specified direction.

Since
4.1.2

Definition at line 53 of file FingerDirectionDetector.cs.

◆ HandModel

HandModelBase Leap.Unity.FingerDirectionDetector.HandModel = null

The HandModelBase instance to observe. Set automatically if not explicitly set in the editor.

Since
4.1.2

Definition at line 46 of file FingerDirectionDetector.cs.

◆ OffAngle

float Leap.Unity.FingerDirectionDetector.OffAngle = 25f

The turn-off angle. The detector deactivates when the specified finger points more than this many degrees away from the target direction. The off angle must be larger than the on angle.

Since
4.1.2

Definition at line 106 of file FingerDirectionDetector.cs.

◆ OnAngle

float Leap.Unity.FingerDirectionDetector.OnAngle = 15f

The turn-on angle. The detector activates when the specified finger points within this many degrees of the target direction.

Since
4.1.2

Definition at line 97 of file FingerDirectionDetector.cs.

◆ Period

float Leap.Unity.FingerDirectionDetector.Period = .1f

The interval at which to check finger state.

Since
4.1.2

Definition at line 38 of file FingerDirectionDetector.cs.

◆ PointingDirection

Vector3 Leap.Unity.FingerDirectionDetector.PointingDirection = Vector3.forward

The target direction as interpreted by the PointingType setting. Ignored when Pointingtype is "AtTarget."

Since
4.1.2

Definition at line 82 of file FingerDirectionDetector.cs.

◆ PointingType

PointingType Leap.Unity.FingerDirectionDetector.PointingType = PointingType.RelativeToHorizon

Specifies how to interprete the direction specified by PointingDirection.

  • RelativeToCamera – the target direction is defined relative to the camera's forward vector, i.e. (0, 0, 1) is the cmaera's local forward direction.
  • RelativeToHorizon – the target direction is defined relative to the camera's forward vector, except that it does not change with pitch.
  • RelativeToWorld – the target direction is defined as a global direction that does not change with camera movement. For example, (0, 1, 0) is always world up, no matter which way the camera is pointing.
  • AtTarget – a target object is used as the pointing direction (The specified PointingDirection is ignored).

In VR scenes, RelativeToHorizon with a direction of (0, 0, 1) for camera forward and RelativeToWorld with a direction of (0, 1, 0) for absolute up, are often the most useful settings.

Since
4.1.2

Definition at line 73 of file FingerDirectionDetector.cs.

◆ ShowGizmos

bool Leap.Unity.FingerDirectionDetector.ShowGizmos = true

Whether to draw the detector's Gizmos for debugging. (Not every detector provides gizmos.)

Since
4.1.2

Definition at line 112 of file FingerDirectionDetector.cs.

◆ TargetObject

Transform Leap.Unity.FingerDirectionDetector.TargetObject = null

The object to point at when the PointingType is "AtTarget." Ignored otherwise.

Definition at line 89 of file FingerDirectionDetector.cs.


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