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

Public Attributes

float Period = .1f
 
HandModelBase HandModel = null
 
PointingType PointingType = PointingType.RelativeToHorizon
 
Vector3 PointingDirection = Vector3.forward
 
Transform TargetObject = null
 
float OnAngle = 45
 
float OffAngle = 65
 
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 whether the palm of the hand is pointing toward the specified direction. The detector activates when the palm direction is within OnAngle degrees of the desired direction and deactivates when it becomes more than OffAngle degrees.

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 palm 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 33 of file PalmDirectionDetector.cs.

Member Data Documentation

◆ HandModel

HandModelBase Leap.Unity.PalmDirectionDetector.HandModel = null

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

Since
4.1.2

Definition at line 48 of file PalmDirectionDetector.cs.

◆ OffAngle

float Leap.Unity.PalmDirectionDetector.OffAngle = 65

The turn-off angle. The detector deactivates when the palm 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 101 of file PalmDirectionDetector.cs.

◆ OnAngle

float Leap.Unity.PalmDirectionDetector.OnAngle = 45

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

Since
4.1.2

Definition at line 92 of file PalmDirectionDetector.cs.

◆ Period

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

The interval at which to check palm direction.

Since
4.1.2

Definition at line 41 of file PalmDirectionDetector.cs.

◆ PointingDirection

Vector3 Leap.Unity.PalmDirectionDetector.PointingDirection = Vector3.forward

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

Since
4.1.2

Definition at line 76 of file PalmDirectionDetector.cs.

◆ PointingType

PointingType Leap.Unity.PalmDirectionDetector.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 67 of file PalmDirectionDetector.cs.

◆ ShowGizmos

bool Leap.Unity.PalmDirectionDetector.ShowGizmos = true

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

Since
4.1.2

Definition at line 108 of file PalmDirectionDetector.cs.

◆ TargetObject

Transform Leap.Unity.PalmDirectionDetector.TargetObject = null

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

Definition at line 83 of file PalmDirectionDetector.cs.


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