10using System.Collections;
101 return local_position;
104 return joints[joint].position;
119 return bone.
Center.ToVector3();
121 if (
bones [bone_type]) {
122 return bones[bone_type].position;
131 return direction.normalized;
133 if (
bones[bone_type]) {
134 return bones[bone_type].forward;
136 return Vector3.forward;
143 return local_rotation;
145 if (
bones[bone_type]) {
146 return bones[bone_type].rotation;
148 return Quaternion.identity;
169 Quaternion jointRotation = Quaternion.identity;
173 }
else if (
bones [joint_type] &&
bones [joint_type + 1]) {
178 float stretchAngle = -jointRotation.eulerAngles.x;
179 if (stretchAngle <= -180f) {
180 stretchAngle += 360f;
195 Quaternion jointRotation = Quaternion.identity;
203 float spreadAngle = 0f;
211 spreadAngle = jointRotation.eulerAngles.y;
212 if (spreadAngle > 180f) {
220 spreadAngle = -jointRotation.eulerAngles.y;
221 if (spreadAngle <= -180f) {
The Bone class represents a tracked bone.
LeapQuaternion Rotation
The orientation of this Bone as a Quaternion.
float Width
The average width of the flesh around the bone.
BoneType
Enumerates the type of bones.
Vector Center
The midpoint of the bone.
Vector PrevJoint
The base of the bone, closest to the wrist. In anatomical terms, this is the proximal end of the bone...
float Length
The estimated length of the bone.
Vector NextJoint
The end of the bone, closest to the finger tip. In anatomical terms, this is the distal end of the bo...
The Finger class represents a tracked finger.
Bone Bone(Bone.BoneType boneIx)
The bone at a given bone index on this finger.
Finger.FingerType Type
The type of this finger.
FingerType
Enumerates the names of the fingers.
The Hand class reports the physical characteristics of a detected hand.
List< Finger > Fingers
The list of Finger objects detected in this frame that are attached to this hand, given in order from...
float GetFingerJointStretchMecanim(int joint_type)
Quaternion GetBoneRotation(int bone_type)
Finger.FingerType fingerType
virtual void InitFinger()
void SetLeapHand(Hand hand)
Vector3 GetBoneCenter(int bone_type)
Vector3 GetBoneDirection(int bone_type)
float GetFingerJointSpreadMecanim()
abstract void UpdateFinger()
Vector3 GetJointPosition(int joint)
float GetBoneLength(int bone_type)
float GetBoneWidth(int bone_type)