Tanoda
Leap.Unity.FingerModel Class Referenceabstract
Inheritance diagram for Leap.Unity.FingerModel:
Leap.Unity.PolyFinger Leap.Unity.RiggedFinger Leap.Unity.SkeletalFinger Leap.Unity.RigidFinger

Public Member Functions

void SetLeapHand (Hand hand)
 
Hand GetLeapHand ()
 
Finger GetLeapFinger ()
 
virtual void InitFinger ()
 
abstract void UpdateFinger ()
 
Vector3 GetTipPosition ()
 
Vector3 GetJointPosition (int joint)
 
Ray GetRay ()
 
Vector3 GetBoneCenter (int bone_type)
 
Vector3 GetBoneDirection (int bone_type)
 
Quaternion GetBoneRotation (int bone_type)
 
float GetBoneLength (int bone_type)
 
float GetBoneWidth (int bone_type)
 
float GetFingerJointStretchMecanim (int joint_type)
 
float GetFingerJointSpreadMecanim ()
 

Public Attributes

Finger.FingerType fingerType = Finger.FingerType.TYPE_INDEX
 
Transform[] bones = new Transform[NUM_BONES]
 
Transform[] joints = new Transform[NUM_BONES - 1]
 

Static Public Attributes

const int NUM_BONES = 4
 
const int NUM_JOINTS = 3
 

Protected Attributes

Hand hand_
 
Finger finger_
 

Detailed Description

The base class for all fingers.

This class serves as the interface between the HandController object, the parent Hand object and the concrete finger objects.

Subclasses of FingerModel must implement InitFinger() and UpdateFinger(). The InitHand() function is typically called by the parent HandModel InitHand() method; likewise, the UpdateFinger() function is typically called by the parent HandModel UpdateHand() function.

Definition at line 26 of file FingerModel.cs.

Member Function Documentation

◆ GetBoneCenter()

Vector3 Leap.Unity.FingerModel.GetBoneCenter ( int  bone_type)

Returns the center of the given bone on the finger

Definition at line 116 of file FingerModel.cs.

◆ GetBoneDirection()

Vector3 Leap.Unity.FingerModel.GetBoneDirection ( int  bone_type)

Returns the direction the given bone is facing on the finger

Definition at line 128 of file FingerModel.cs.

◆ GetBoneLength()

float Leap.Unity.FingerModel.GetBoneLength ( int  bone_type)

Returns the length of the finger bone.

Definition at line 152 of file FingerModel.cs.

◆ GetBoneRotation()

Quaternion Leap.Unity.FingerModel.GetBoneRotation ( int  bone_type)

Returns the rotation quaternion of the given bone

Definition at line 140 of file FingerModel.cs.

◆ GetBoneWidth()

float Leap.Unity.FingerModel.GetBoneWidth ( int  bone_type)

Returns the width of the finger bone.

Definition at line 157 of file FingerModel.cs.

◆ GetFingerJointSpreadMecanim()

float Leap.Unity.FingerModel.GetFingerJointSpreadMecanim ( )

Returns Mecanim spread angle, which only applies to joint_type = 0 NOTE: Positive spread is towards thumb for index and middle, but is in the opposite direction for the ring and pinky. For the thumb negative spread rotates the thumb in to the palm.

Definition at line 192 of file FingerModel.cs.

◆ GetFingerJointStretchMecanim()

float Leap.Unity.FingerModel.GetFingerJointStretchMecanim ( int  joint_type)

Returns Mecanim stretch angle in the range (-180, +180] NOTE: Positive stretch opens the hand. For the thumb this moves it away from the palm.

Definition at line 166 of file FingerModel.cs.

◆ GetJointPosition()

Vector3 Leap.Unity.FingerModel.GetJointPosition ( int  joint)

Returns the location of the given joint on the finger

Definition at line 95 of file FingerModel.cs.

◆ GetLeapFinger()

Finger Leap.Unity.FingerModel.GetLeapFinger ( )

The Leap Finger object.

Definition at line 63 of file FingerModel.cs.

◆ GetLeapHand()

Hand Leap.Unity.FingerModel.GetLeapHand ( )

The Leap Hand object.

Definition at line 61 of file FingerModel.cs.

◆ GetRay()

Ray Leap.Unity.FingerModel.GetRay ( )

Returns a ray from the tip of the finger in the direction it is pointing.

Definition at line 110 of file FingerModel.cs.

◆ GetTipPosition()

Vector3 Leap.Unity.FingerModel.GetTipPosition ( )

Returns the location of the tip of the finger

Definition at line 83 of file FingerModel.cs.

◆ InitFinger()

virtual void Leap.Unity.FingerModel.InitFinger ( )
virtual

Implement this function to initialize this finger after it is created. Typically, this function is called by the parent HandModel object.

Reimplemented in Leap.Unity.SkeletalFinger, and Leap.Unity.PolyFinger.

Definition at line 69 of file FingerModel.cs.

◆ SetLeapHand()

void Leap.Unity.FingerModel.SetLeapHand ( Hand  hand)

Sets the Leap Hand and Leap Finger for this finger. Note that Leap Hand and Finger objects are recreated every frame. The parent HandModel object calls this function to set or update the underlying finger. The tracking data in the Leap objects are used to update the FingerModel.

Definition at line 53 of file FingerModel.cs.

◆ UpdateFinger()

abstract void Leap.Unity.FingerModel.UpdateFinger ( )
pure virtual

Implement this function to update this finger once per game loop. Typically, this function is called by the parent HandModel object's UpdateHand() function, which is called in the Unity Update() phase for graphics hand models and in the FixedUpdate() phase for physics hand models.

Implemented in Leap.Unity.RiggedFinger, Leap.Unity.RigidFinger, Leap.Unity.SkeletalFinger, and Leap.Unity.PolyFinger.

Member Data Documentation

◆ bones

Transform [] Leap.Unity.FingerModel.bones = new Transform[NUM_BONES]

Bones positioned and rotated by FingerModel.

Definition at line 38 of file FingerModel.cs.

◆ finger_

Finger Leap.Unity.FingerModel.finger_
protected

The Leap Finger object.

Definition at line 46 of file FingerModel.cs.

◆ fingerType

Finger.FingerType Leap.Unity.FingerModel.fingerType = Finger.FingerType.TYPE_INDEX

Definition at line 34 of file FingerModel.cs.

◆ hand_

Hand Leap.Unity.FingerModel.hand_
protected

The Leap Hand object.

Definition at line 44 of file FingerModel.cs.

◆ joints

Transform [] Leap.Unity.FingerModel.joints = new Transform[NUM_BONES - 1]

Joints positioned and rotated by FingerModel.

Definition at line 40 of file FingerModel.cs.

◆ NUM_BONES

const int Leap.Unity.FingerModel.NUM_BONES = 4
static

The number of bones in a finger.

Definition at line 29 of file FingerModel.cs.

◆ NUM_JOINTS

const int Leap.Unity.FingerModel.NUM_JOINTS = 3
static

The number of joints in a finger.

Definition at line 32 of file FingerModel.cs.


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