ArmΒΆ

Properties:

Methods:

class Leap::Arm

The Arm class represents the forearm.

Public Functions

Arm()

Constructs an invalid Arm object.

Get valid Arm objects from a Hand object.

Hand hand = frame.Hands.Frontmost;
Arm arm = hand.Arm;

Since
2.0.3

bool Equals(Arm arg0)

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

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

Property

Matrix Basis

The orthonormal basis vectors for the Arm bone as a Matrix.

Basis vectors specify the orientation of a bone.

xBasis Perpendicular to the longitudinal axis of the bone; exits the arm laterally through the sides of the wrist.

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

zBasis Aligned with the longitudinal axis of the arm bone. More positive toward the wrist.

Matrix basis = arm.Basis;
Vector xBasis = basis.xBasis;
Vector yBasis = basis.yBasis;
Vector zBasis = basis.zBasis;

Vector armCenter = arm.ElbowPosition +
                   (arm.WristPosition - arm.ElbowPosition) * 0.5f;
Matrix transform = new Matrix (xBasis, yBasis, zBasis, armCenter);

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

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.

Return
The basis of the arm bone as a matrix.
Since
2.0.3

Vector Center

The center of the forearm.

This location represents the midpoint of the arm between the wrist position and the elbow position.

Since
2.1.0

Vector Direction

The normalized direction in which the arm is pointing (from elbow to wrist).

Vector direction = arm.Direction;

Since
2.0.3

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

Arm Invalid

Returns an invalid Arm object.

Arm arm = Arm.Invalid;

Return
The invalid Arm instance.
Since
2.0.3

bool IsValid

Reports whether this is a valid Arm object.

Arm arm = frame.Hand (10).Arm;
if (arm.IsValid) {
    // ... Use the arm data
}

Return
True, if this Arm object contains valid tracking data.
Since
2.0.3

float Width

The average width of the arm.

float width = arm.Width;

//length
Vector displacement = arm.ElbowPosition - arm.WristPosition;
float length = displacement.Magnitude;

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