# Arm¶

Properties:

Methods:

class Leap::Arm

The Arm class represents the forearm.

Public Type

BoneType enum

Enumerates the names of the bones.

Members of this enumeration are returned by Bone::type() to identify a Bone object.

Since
2.0

Values:

• TYPE_INVALID = = -1 -
• TYPE_METACARPAL = = 0 -
• TYPE_PROXIMAL = = 1 -
• TYPE_INTERMEDIATE = = 2 -
• TYPE_DISTAL = = 3 -
Public Functions

Arm()

Constructs a default Arm object.

Get valid Arm objects from a Hand object.

Arm arm = hand.Arm;


Since
2.0.3

Arm(Vector elbow, Vector wrist, Vector center, Vector direction, float length, float width, LeapQuaternion rotation)

Constructs a new Arm object.

Since
3.0
Parameters
• elbow -

The position of the elbow.

• wrist -

The position of the wrist.

• center -

The position of the midpoint between the elbow and wrist.

• direction -

The unit direction vector from elbow to wrist.

• length -

The distance between elbow and wrist in millimeters.

• width -

The estimated average width of the arm.

• basis -

The basis matrix representing the orientation of the arm.

bool Equals(Arm other)

Compare Arm object equality.

Boolean theSame = thisArm.Equals(thatArm);


Two Arm objects are equal if and only if both Arm objects represent the

exact same physical arm in the same frame and both Arm objects are valid.

Since
2.0.3

bool Equals(Bone other)

Compare Bone object equality.

Two Bone objects are equal if and only if both Bone objects represent the exact same physical bone in the same frame and both Bone objects are valid.

Since
2.0

override string ToString()

A string containing a brief, human readable description of the Arm object.

String description = arm.ToString ();


Return
A description of the Arm object as a string.
Since
2.0.3

Public Members

Vector Center

The midpoint of the bone.

Vector middle = bone.Center;


Return
The midpoint in the center of the bone.
Since
2.0

Vector Direction

The normalized direction of the bone from base to tip.

Vector direction = bone.Direction;


Return
The normalized direction of the bone from base to tip.
Since
2.0

float Length

The estimated length of the bone in millimeters.

float length = bone.Length;


Return
The length of the bone in millimeters.
Since
2.0

Vector NextJoint

The end of the bone, closest to the finger tip.

In anatomical terms, this is the distal end of the bone.

Vector boneEnd = bone.NextJoint;


Return
The Vector containing the coordinates of the next joint position.
Since
2.0

Vector PrevJoint

The base of the bone, closest to the wrist.

In anatomical terms, this is the proximal end of the bone.

Vector boneStart = bone.PrevJoint;


Return
The Vector containing the coordinates of the previous joint position.
Since
2.0

LeapQuaternion Rotation

The orientation of this Bone as a Quaternion.

Return
The Quaternion.
Since
2.0

Bone.BoneType Type

The name of this bone.

Bone.BoneType type = bone.Type;


Return
The anatomical type of this bone as a member of the Bone::Type enumeration.
Since
2.0

float Width

The average width of the flesh around the bone in millimeters.

float width = bone.Width;


Return
The width of the flesh around the bone in millimeters.
Since
2.0

Property

LeapTransform Basis

The orthonormal basis vectors for this Bone as a Matrix.

The orientation of this Bone as a Quaternion.

Basis vectors specify the orientation of a bone.

xBasis Perpendicular to the longitudinal axis of the bone; exits the sides of the finger.

yBasis or up vector Perpendicular to the longitudinal axis of the bone; exits the top and bottom of the finger. More positive in the upward direction.

zBasis Aligned with the longitudinal axis of the bone. More positive toward the base of the finger.

The bases provided for the right hand use the right-hand rule; those for the left hand use the left-hand rule. Thus, the positive direction of the x-basis is to the right for the right hand and to the left for the left hand. You can change from right-hand to left-hand rule by multiplying the z basis vector by -1.

You can use the basis vectors for such purposes as measuring complex finger poses and skeletal animation.

Note that converting the basis vectors directly into a quaternion representation is not mathematically valid. If you use quaternions, create them from the derived rotation matrix not directly from the bases.

LeapTransform basis = bone.Basis;
Vector xBasis = basis.xBasis;
Vector yBasis = basis.yBasis;
Vector zBasis = basis.zBasis;


Return
The basis of the bone as a matrix.
Return
The Quaternion.
Since
2.0

Vector ElbowPosition

The position of the elbow.

Vector elbow = arm.ElbowPosition;


If not in view, the elbow position is estimated based on typical human anatomical proportions.

Since
2.0.3

Vector WristPosition

The position of the wrist.

Vector wrist = arm.WristPosition;


Note that the wrist position is not collocated with the end of any bone in the hand. There is a gap of a few centimeters since the carpal bones are not included in the skeleton model.

Since
2.0.3