Tanoda
Leap.Unity.HandModel Class Referenceabstract
Inheritance diagram for Leap.Unity.HandModel:
Leap.Unity.HandModelBase Leap.Unity.PolyHand Leap.Unity.RiggedHand Leap.Unity.SkeletalHand Leap.Unity.RigidHand

Public Member Functions

Vector3 GetPalmPosition ()
 
Quaternion GetPalmRotation ()
 
Vector3 GetPalmDirection ()
 
Vector3 GetPalmNormal ()
 
Vector3 GetArmDirection ()
 
Vector3 GetArmCenter ()
 
float GetArmLength ()
 
float GetArmWidth ()
 
Vector3 GetElbowPosition ()
 
Vector3 GetWristPosition ()
 
Quaternion GetArmRotation ()
 
override Hand GetLeapHand ()
 
override void SetLeapHand (Hand hand)
 
override void InitHand ()
 
int LeapID ()
 
abstract override void UpdateHand ()
 
- Public Member Functions inherited from Leap.Unity.HandModelBase
virtual void InitHand ()
 
virtual void BeginHand ()
 
abstract void UpdateHand ()
 
void UpdateHandWithEvent ()
 
virtual void FinishHand ()
 
abstract Hand GetLeapHand ()
 
abstract void SetLeapHand (Hand hand)
 
virtual bool SupportsEditorPersistence ()
 Returns whether or not this hand model supports editor persistence. This is false by default and must be opt-in by a developer making their own hand model script if they want editor persistence. More...
 

Public Attributes

float handModelPalmWidth = 0.085f
 
FingerModel[] fingers = new FingerModel[NUM_FINGERS]
 
Transform palm
 
Transform forearm
 
Transform wristJoint
 
Transform elbowJoint
 
- Public Attributes inherited from Leap.Unity.HandModelBase
HandModelManager.ModelGroup group
 

Static Public Attributes

const int NUM_FINGERS = 5
 

Protected Attributes

Hand hand_
 

Properties

override Chirality Handedness [get, set]
 
abstract override ModelType HandModelType [get]
 
- Properties inherited from Leap.Unity.HandModelBase
bool IsTracked [get]
 
abstract Chirality Handedness [get, set]
 
abstract ModelType HandModelType [get]
 

Additional Inherited Members

- Events inherited from Leap.Unity.HandModelBase
Action OnBegin
 
Action OnFinish
 
Action OnUpdate
 Called directly after the HandModelBase's UpdateHand(). More...
 

Detailed Description

The base class for all hand models, both graphics and physics.

This class serves as the interface between the HandController object and the concrete hand object containing the graphics and physics of a hand.

Subclasses of HandModel must implement InitHand() and UpdateHand(). The UpdateHand() function is called in the Unity Update() phase for graphics HandModel instances; and in the Unity FixedUpdate() phase for physics objects. InitHand() is called once, when the hand is created and is followed by a call to UpdateHand().

Definition at line 25 of file HandModel.cs.

Member Function Documentation

◆ GetArmCenter()

Vector3 Leap.Unity.HandModel.GetArmCenter ( )

Calculates the center of the forearm in global coordinates.

Returns
A Vector3 containing the Unity coordinates of the center of the forearm.

Definition at line 127 of file HandModel.cs.

◆ GetArmDirection()

Vector3 Leap.Unity.HandModel.GetArmDirection ( )

Calculates the direction vector of the forearm in global coordinates.

Returns
A Vector3 representing the direction of the forearm (pointing from elbow to wrist).

Definition at line 114 of file HandModel.cs.

◆ GetArmLength()

float Leap.Unity.HandModel.GetArmLength ( )

Returns the measured length of the forearm in meters.

Definition at line 139 of file HandModel.cs.

◆ GetArmRotation()

Quaternion Leap.Unity.HandModel.GetArmRotation ( )

Calculates the rotation of the forearm in global coordinates.

Returns
A Quaternion representing the rotation of the arm.

Definition at line 179 of file HandModel.cs.

◆ GetArmWidth()

float Leap.Unity.HandModel.GetArmWidth ( )

Returns the measured width of the forearm in meters.

Definition at line 144 of file HandModel.cs.

◆ GetElbowPosition()

Vector3 Leap.Unity.HandModel.GetElbowPosition ( )

Calculates the position of the elbow in global coordinates.

Returns
A Vector3 containing the Unity coordinates of the elbow.

Definition at line 151 of file HandModel.cs.

◆ GetLeapHand()

override Hand Leap.Unity.HandModel.GetLeapHand ( )
virtual

Returns the Leap Hand object represented by this HandModel. Note that any physical quantities and directions obtained from the Leap Hand object are relative to the Leap Motion coordinate system, which uses a right-handed axes and units of millimeters.

Implements Leap.Unity.HandModelBase.

Definition at line 196 of file HandModel.cs.

◆ GetPalmDirection()

Vector3 Leap.Unity.HandModel.GetPalmDirection ( )

Calculates the direction vector of the hand in global coordinates.

Returns
A Vector3 representing the direction of the hand.

Definition at line 88 of file HandModel.cs.

◆ GetPalmNormal()

Vector3 Leap.Unity.HandModel.GetPalmNormal ( )

Calculates the normal vector projecting from the hand in global coordinates.

Returns
A Vector3 representing the vector perpendicular to the palm.

Definition at line 101 of file HandModel.cs.

◆ GetPalmPosition()

Vector3 Leap.Unity.HandModel.GetPalmPosition ( )

Calculates the position of the palm in global coordinates.

Returns
A Vector3 containing the Unity coordinates of the palm position.

Definition at line 66 of file HandModel.cs.

◆ GetPalmRotation()

Quaternion Leap.Unity.HandModel.GetPalmRotation ( )

Calculates the rotation of the hand in global coordinates.

Returns
A Quaternion representing the rotation of the hand.

Definition at line 73 of file HandModel.cs.

◆ GetWristPosition()

Vector3 Leap.Unity.HandModel.GetWristPosition ( )

Calculates the position of the wrist in global coordinates.

Returns
A Vector3 containing the Unity coordinates of the wrist.

Definition at line 165 of file HandModel.cs.

◆ InitHand()

override void Leap.Unity.HandModel.InitHand ( )
virtual

Implement this function to initialise this hand after it is created. This function is called by the HandController during the Unity Update() phase when a new hand is detected by the Leap Motion device.

Reimplemented from Leap.Unity.HandModelBase.

Reimplemented in Leap.Unity.RiggedHand, Leap.Unity.RigidHand, and Leap.Unity.PolyHand.

Definition at line 219 of file HandModel.cs.

◆ LeapID()

int Leap.Unity.HandModel.LeapID ( )

Returns the ID associated with the hand in the Leap API. This ID is guaranteed to be unique among all hands in a frame, and is invariant for the lifetime of the hand model.

Definition at line 233 of file HandModel.cs.

◆ SetLeapHand()

override void Leap.Unity.HandModel.SetLeapHand ( Hand  hand)
virtual

Assigns a Leap Hand object to this hand model. Note that the Leap Hand objects are recreated every frame. The parent HandController calls this method to set or update the underlying hand.

Implements Leap.Unity.HandModelBase.

Definition at line 205 of file HandModel.cs.

◆ UpdateHand()

abstract override void Leap.Unity.HandModel.UpdateHand ( )
pure virtual

Implement this function to update this hand once every game loop. For HandModel instances assigned to the HandController graphics hand list, the HandController calls this function during the Unity Update() phase. For HandModel instances in the physics hand list, the HandController calls this function in the FixedUpdate() phase.

Implements Leap.Unity.HandModelBase.

Implemented in Leap.Unity.RiggedHand, Leap.Unity.RigidHand, Leap.Unity.SkeletalHand, and Leap.Unity.PolyHand.

Member Data Documentation

◆ elbowJoint

Transform Leap.Unity.HandModel.elbowJoint

Transform object for the elbow joint of this hand.

Definition at line 57 of file HandModel.cs.

◆ fingers

FingerModel [] Leap.Unity.HandModel.fingers = new FingerModel[NUM_FINGERS]

The array of finger objects for this hand. The array is ordered from thumb (element 0) to pinky (element 4).

Definition at line 47 of file HandModel.cs.

◆ forearm

Transform Leap.Unity.HandModel.forearm

Transform object for the forearm object of this hand.

Definition at line 53 of file HandModel.cs.

◆ hand_

Hand Leap.Unity.HandModel.hand_
protected

The Leap Hand object this hand model represents.

Definition at line 61 of file HandModel.cs.

◆ handModelPalmWidth

float Leap.Unity.HandModel.handModelPalmWidth = 0.085f

The model width of the hand in meters. This value is used with the measured value of the user's hand to scale the model proportionally.

Definition at line 45 of file HandModel.cs.

◆ NUM_FINGERS

const int Leap.Unity.HandModel.NUM_FINGERS = 5
static

The number of fingers on a hand.

Definition at line 40 of file HandModel.cs.

◆ palm

Transform Leap.Unity.HandModel.palm

Transform object for the palm object of this hand.

Definition at line 51 of file HandModel.cs.

◆ wristJoint

Transform Leap.Unity.HandModel.wristJoint

Transform object for the wrist joint of this hand.

Definition at line 55 of file HandModel.cs.

Property Documentation

◆ Handedness

override Chirality Leap.Unity.HandModel.Handedness
getset

Definition at line 29 of file HandModel.cs.

◆ HandModelType

abstract override ModelType Leap.Unity.HandModel.HandModelType
get

Definition at line 35 of file HandModel.cs.


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