Tanoda
Leap.Unity.AbstractHoldDetector Class Referenceabstract
Inheritance diagram for Leap.Unity.AbstractHoldDetector:
Leap.Unity.Detector Leap.Unity.PinchDetector

Public Attributes

bool ControlsTransform = true
 
bool ShowGizmos = true
 
- Public Attributes inherited from Leap.Unity.Detector
UnityEvent OnActivate
 
UnityEvent OnDeactivate
 

Protected Member Functions

abstract void ensureUpToDate ()
 
virtual void Awake ()
 
virtual void Update ()
 
virtual void changeState (bool shouldBeActive)
 

Protected Attributes

HandModelBase _handModel
 
int _lastUpdateFrame = -1
 
bool _didChange = false
 
Vector3 _position
 
Quaternion _rotation
 
Vector3 _direction = Vector3.forward
 
Vector3 _normal = Vector3.up
 
float _distance
 
float _lastHoldTime = 0.0f
 
float _lastReleaseTime = 0.0f
 
Vector3 _lastPosition = Vector3.zero
 
Quaternion _lastRotation = Quaternion.identity
 
Vector3 _lastDirection = Vector3.forward
 
Vector3 _lastNormal = Vector3.up
 
float _lastDistance = 1.0f
 
- 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

HandModelBase HandModel [get, set]
 
virtual bool IsHolding [get]
 Returns whether or not the dectector is currently detecting a pinch or grab. More...
 
virtual bool DidChangeFromLastFrame [get]
 Returns whether or not the value of IsPinching is different than the value reported during the previous frame. More...
 
virtual bool DidStartHold [get]
 Returns whether or not the value of IsHolding changed to true between this frame and the previous. More...
 
virtual bool DidRelease [get]
 Returns whether or not the value of IsHolding changed to false between this frame and the previous. More...
 
float LastHoldTime [get]
 Returns the value of Time.time during the most recent pinch event. More...
 
float LastReleaseTime [get]
 Returns the value of Time.time during the most recent unpinch event. More...
 
Vector3 Position [get]
 Returns the position value of the detected pinch or grab. If a pinch or grab is not currently being detected, returns the most recent position value. More...
 
Vector3 LastActivePosition [get]
 
Quaternion Rotation [get]
 Returns the rotation value of the detected pinch or grab. If a pinch or grab is not currently being detected, returns the most recent rotation value. More...
 
Quaternion LastActiveRotation [get]
 
Vector3 Direction [get]
 
Vector3 LastActiveDirection [get]
 
Vector3 Normal [get]
 
Vector3 LastActiveNormal [get]
 
float Distance [get]
 
float LastActiveDistance [get]
 
- Properties inherited from Leap.Unity.Detector
bool IsActive [get]
 

Additional Inherited Members

- Public Member Functions inherited from Leap.Unity.Detector
virtual void Activate ()
 
virtual void Deactivate ()
 

Detailed Description

A base class for implementing detectors that detect a holding pose of a hand.

Such detectors might use the PinchStrength, PinchDistance, GrabStrength, or GrabAngle properties of the Hand or might use a more complex heuristic.

Definition at line 20 of file AbstractHoldDetector.cs.

Member Function Documentation

◆ Awake()

virtual void Leap.Unity.AbstractHoldDetector.Awake ( )
protectedvirtual

Definition at line 62 of file AbstractHoldDetector.cs.

◆ changeState()

virtual void Leap.Unity.AbstractHoldDetector.changeState ( bool  shouldBeActive)
protectedvirtual

Definition at line 174 of file AbstractHoldDetector.cs.

◆ ensureUpToDate()

abstract void Leap.Unity.AbstractHoldDetector.ensureUpToDate ( )
protectedpure virtual

Implementations must implement this method.

Implemented in Leap.Unity.PinchDetector.

◆ Update()

virtual void Leap.Unity.AbstractHoldDetector.Update ( )
protectedvirtual

Definition at line 75 of file AbstractHoldDetector.cs.

Member Data Documentation

◆ _didChange

bool Leap.Unity.AbstractHoldDetector._didChange = false
protected

Definition at line 45 of file AbstractHoldDetector.cs.

◆ _direction

Vector3 Leap.Unity.AbstractHoldDetector._direction = Vector3.forward
protected

Definition at line 49 of file AbstractHoldDetector.cs.

◆ _distance

float Leap.Unity.AbstractHoldDetector._distance
protected

Definition at line 51 of file AbstractHoldDetector.cs.

◆ _handModel

HandModelBase Leap.Unity.AbstractHoldDetector._handModel
protected

Definition at line 26 of file AbstractHoldDetector.cs.

◆ _lastDirection

Vector3 Leap.Unity.AbstractHoldDetector._lastDirection = Vector3.forward
protected

Definition at line 57 of file AbstractHoldDetector.cs.

◆ _lastDistance

float Leap.Unity.AbstractHoldDetector._lastDistance = 1.0f
protected

Definition at line 59 of file AbstractHoldDetector.cs.

◆ _lastHoldTime

float Leap.Unity.AbstractHoldDetector._lastHoldTime = 0.0f
protected

Definition at line 53 of file AbstractHoldDetector.cs.

◆ _lastNormal

Vector3 Leap.Unity.AbstractHoldDetector._lastNormal = Vector3.up
protected

Definition at line 58 of file AbstractHoldDetector.cs.

◆ _lastPosition

Vector3 Leap.Unity.AbstractHoldDetector._lastPosition = Vector3.zero
protected

Definition at line 55 of file AbstractHoldDetector.cs.

◆ _lastReleaseTime

float Leap.Unity.AbstractHoldDetector._lastReleaseTime = 0.0f
protected

Definition at line 54 of file AbstractHoldDetector.cs.

◆ _lastRotation

Quaternion Leap.Unity.AbstractHoldDetector._lastRotation = Quaternion.identity
protected

Definition at line 56 of file AbstractHoldDetector.cs.

◆ _lastUpdateFrame

int Leap.Unity.AbstractHoldDetector._lastUpdateFrame = -1
protected

Definition at line 43 of file AbstractHoldDetector.cs.

◆ _normal

Vector3 Leap.Unity.AbstractHoldDetector._normal = Vector3.up
protected

Definition at line 50 of file AbstractHoldDetector.cs.

◆ _position

Vector3 Leap.Unity.AbstractHoldDetector._position
protected

Definition at line 47 of file AbstractHoldDetector.cs.

◆ _rotation

Quaternion Leap.Unity.AbstractHoldDetector._rotation
protected

Definition at line 48 of file AbstractHoldDetector.cs.

◆ ControlsTransform

bool Leap.Unity.AbstractHoldDetector.ControlsTransform = true

Whether the Transform of the object containing this Detector script is transformed by the Position and Rotation of the hand when IsHolding is true.

If false, the Transform is not affected.

Definition at line 36 of file AbstractHoldDetector.cs.

◆ ShowGizmos

bool Leap.Unity.AbstractHoldDetector.ShowGizmos = true

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

Since
4.1.2

Definition at line 41 of file AbstractHoldDetector.cs.

Property Documentation

◆ DidChangeFromLastFrame

virtual bool Leap.Unity.AbstractHoldDetector.DidChangeFromLastFrame
get

Returns whether or not the value of IsPinching is different than the value reported during the previous frame.

Definition at line 96 of file AbstractHoldDetector.cs.

◆ DidRelease

virtual bool Leap.Unity.AbstractHoldDetector.DidRelease
get

Returns whether or not the value of IsHolding changed to false between this frame and the previous.

Definition at line 116 of file AbstractHoldDetector.cs.

◆ DidStartHold

virtual bool Leap.Unity.AbstractHoldDetector.DidStartHold
get

Returns whether or not the value of IsHolding changed to true between this frame and the previous.

Definition at line 106 of file AbstractHoldDetector.cs.

◆ Direction

Vector3 Leap.Unity.AbstractHoldDetector.Direction
get

Definition at line 166 of file AbstractHoldDetector.cs.

◆ Distance

float Leap.Unity.AbstractHoldDetector.Distance
get

Definition at line 170 of file AbstractHoldDetector.cs.

◆ HandModel

HandModelBase Leap.Unity.AbstractHoldDetector.HandModel
getset

Definition at line 27 of file AbstractHoldDetector.cs.

◆ IsHolding

virtual bool Leap.Unity.AbstractHoldDetector.IsHolding
get

Returns whether or not the dectector is currently detecting a pinch or grab.

Definition at line 85 of file AbstractHoldDetector.cs.

◆ LastActiveDirection

Vector3 Leap.Unity.AbstractHoldDetector.LastActiveDirection
get

Definition at line 167 of file AbstractHoldDetector.cs.

◆ LastActiveDistance

float Leap.Unity.AbstractHoldDetector.LastActiveDistance
get

Definition at line 171 of file AbstractHoldDetector.cs.

◆ LastActiveNormal

Vector3 Leap.Unity.AbstractHoldDetector.LastActiveNormal
get

Definition at line 169 of file AbstractHoldDetector.cs.

◆ LastActivePosition

Vector3 Leap.Unity.AbstractHoldDetector.LastActivePosition
get

Definition at line 153 of file AbstractHoldDetector.cs.

◆ LastActiveRotation

Quaternion Leap.Unity.AbstractHoldDetector.LastActiveRotation
get

Definition at line 164 of file AbstractHoldDetector.cs.

◆ LastHoldTime

float Leap.Unity.AbstractHoldDetector.LastHoldTime
get

Returns the value of Time.time during the most recent pinch event.

Definition at line 126 of file AbstractHoldDetector.cs.

◆ LastReleaseTime

float Leap.Unity.AbstractHoldDetector.LastReleaseTime
get

Returns the value of Time.time during the most recent unpinch event.

Definition at line 136 of file AbstractHoldDetector.cs.

◆ Normal

Vector3 Leap.Unity.AbstractHoldDetector.Normal
get

Definition at line 168 of file AbstractHoldDetector.cs.

◆ Position

Vector3 Leap.Unity.AbstractHoldDetector.Position
get

Returns the position value of the detected pinch or grab. If a pinch or grab is not currently being detected, returns the most recent position value.

Definition at line 147 of file AbstractHoldDetector.cs.

◆ Rotation

Quaternion Leap.Unity.AbstractHoldDetector.Rotation
get

Returns the rotation value of the detected pinch or grab. If a pinch or grab is not currently being detected, returns the most recent rotation value.

Definition at line 158 of file AbstractHoldDetector.cs.


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