Properties:
The LeapBone class represents a tracked bone.
All fingers contain 4 bones that make up the anatomy of the finger. Get valid LeapBone objects from a Finger object.
Bones are ordered from base to tip, indexed from 0 to 3. Additionally, the bone’s LeapBoneType enum may be used to index a specific bone anatomically.
The thumb does not have a base metacarpal bone and therefore contains a valid, zero length bone at that location.
Note that LeapBone objects can be invalid, which means that they do not contain valid tracking data and do not correspond to a physical bone. Invalid LeapBone objects can be the result of asking for a LeapBone object from an invalid finger, indexing a bone out of range, or constructing a new bone. Test for validity with the LeapBone.isValid property.
Property
- Since 2.0
basis- (LeapMatrix *) basisThe orientation of the bone as a basis matrix.
The basis is defined as follows: xAxis: Clockwise rotation axis of the bone yAxis: Positive above the bone zAxis: Positive along the bone towards the wrist
LeapMatrix *basis = bone.basis;Note: Since the left hand is a mirror of the right hand, left handed bones will contain a left-handed basis.
- Return
- The basis of the bone as a matrix.
- Since
- 2.0
center- (LeapVector *) centerThe midpoint in the center of the bone.
LeapVector *center = bone.center;
- Return
- The midpoint in the center of the bone.
- Since
- 2.0
direction- (LeapVector *) directionThe normalized direction of the bone from base to tip.
LeapVector *direction = bone.direction;
- Return
- The normalized direction of the bone from base to tip.
- Since
- 2.0
invalid- (LeapBone *) invalidAn invalid Bone object.
You can use an invalid LeapBone object in comparisons testing whether a given LeapBone instance is valid or invalid. (You can also use the LeapBone.isValid property.)
- (LeapBone *)findBone:(NSString *) criteria { //Look up bone with criteria, else return LeapBone.invalid; }
- Return
- The invalid LeapBone instance.
- Since
- 2.0
isValid- (BOOL) isValidlength- (float) lengthThe estimated length of the bone in millimeters.
float length = bone.length;
- Return
- The length of the bone in millimeters.
- Since
- 2.0
nextJoint- (LeapVector *) nextJointThe end of the bone farthest from the wrist.
LeapVector *distalEnd = bone.nextJoint;
- Return
- The LeapVector containing the coordinates of the next joint position (the joint or bone tip closest to the end of the finger).
- Since
- 2.0
prevJoint- (LeapVector *) prevJointThe end of the bone closest from the wrist.
LeapVector *proximalEnd = bone.prevJoint;
- Return
- The LeapVector containing the coordinates of the previous joint position (the joint closer to the wrist).
- Since
- 2.0
type- (LeapBoneType) typeThe name of this bone.
LeapBoneType boneDesignator = bone.type;
- Return
- The anatomical type of this bone as a member of the LeapBoneType enumeration.
- Since
- 2.0
width- (float) widthThe average width of the finger along this bone in millimeters.
float width = bone.width;
- Return
- The average width of the bone including the surrounding flesh in millimeters.
- Since
- 2.0
LeapBoneType enum
Enumerates the names of the bones.
- Since 2.0
Values:
- LEAP_BONE_TYPE_METACARPAL = = 0 -
The metacarpal bone connecting to the wrist.
- LEAP_BONE_TYPE_PROXIMAL = = 1 -
The first finger phalanx bone.
- LEAP_BONE_TYPE_INTERMEDIATE = = 2 -
The middle finger phalanx bone.
- LEAP_BONE_TYPE_DISTAL = = 3 -
The finger phalanx bone at the end of the finger.