a )5.0.0f4ž’’’s’8-l'€£ę„hŒĪA,Œ€7€’’’’€¦€²€Õ€ Ž€.€†€Ä€ Ž€.€H€«€’’’’€1€1€’’’’ @Ž€€ Q€j€ H€ź€’’’’ €1€1€’’’’ @Ž€€Q€j€ń€(’’’’€1€1€’’’’€Ž€€€j€’’’’€H€›€’’’’€1€1€’’’’@Ž€€Q€j€y€ € Ž€.€y€< Ž€.€Ž€CH€T’’’’€1€1€’’’’ @Ž€€!Q€j€"H€`’’’’#€1€1€’’’’$@Ž€€%Q€j€&H€l’’’’'€1€1€’’’’(@Ž€€)Q€j€*L€{+PPtrm_FileIDm_PathIDm_DefaultReferencesm_Iconm_ExecutionOrderm_ClassNamem_Namespacem_AssemblyNamem_IsEditorScriptČ0ÅņĆōL.`?^Ł0D7€’’’’€¦€²€Š€¦€¦€¦€#¦€+H€3’’’’€1€1€’’’’@Ž€€ Q€j€ ™€< ¦€H H€Z’’’’ €1€1€’’’’@Ž€€Q€j€Š€g¦€¦€¦€#¦€+v~ € €– €Ÿ €Ø €± €ŗ €Ć €Ģ €Õ €Ž  €ē! €ń" €ū# €$ €% €&Õ€#’’’’'€1€1€’’’’(€Ž€€)H€j€’’’’*€1€1€’’’’+@Ž€€,Q€j€-™€*.Ž€8/AssetMetaDataguiddata[0]data[1]data[2]data[3]pathNametimeCreatedoriginalChangesetoriginalNameoriginalParentHash128originalDigestbytes[0]bytes[1]bytes[2]bytes[3]bytes[4]bytes[5]bytes[6]bytes[7]bytes[8]bytes[9]bytes[10]bytes[11]bytes[12]bytes[13]bytes[14]bytes[15]labelsassetStoreReflicenseType z{ļ@īČć5^(H'7€’’’’€¦€²€ Õ€ Ž€#.€,†€Ä€ Ž€#.€,H€«€’’’’€1€1€’’’’ @Ž€€ Q€j€ Õ€5’’’’ €1€1€’’’’ €Ž€€€j€’’’’€H€›€’’’’€1€1€’’’’@Ž€€Q€j€y€ € Ž€#.€, €I@¾€X @Ž€#.€,H€]’’’’€1€1€’’’’@Ž€€Q€j€H€h’’’’€1€1€’’’’ @Ž€€!Q€j€"H€z’’’’#€1€1€’’’’$@Ž€€%Q€j€&MonoImporterPPtrm_FileIDm_PathIDm_DefaultReferencesexecutionOrdericonm_UserDatam_AssetBundleNamem_AssetBundleVariantˆ’’ˆ@  ’’ąyÆČass’’¶Éī.ėGž€ŪŽ„† Ė.Assets/LeapMotion/Scripts/Hands/FingerModel.cs FingerModelļ/******************************************************************************\ * Copyright (C) Leap Motion, Inc. 2011-2014. * * Leap Motion proprietary. Licensed under Apache 2.0 * * Available at http://www.apache.org/licenses/LICENSE-2.0.html * \******************************************************************************/ using UnityEngine; using System.Collections; using Leap; // Interface for all fingers. public abstract class FingerModel : MonoBehaviour { public const int NUM_BONES = 4; public const int NUM_JOINTS = 5; public Finger.FingerType fingerType = Finger.FingerType.TYPE_INDEX; protected Hand hand_; protected Finger finger_; protected Vector3 offset_ = Vector3.zero; protected bool mirror_z_axis_ = false; protected HandController controller_; public void SetController(HandController controller) { controller_ = controller; } public HandController GetController() { return controller_; } public void SetLeapHand(Hand hand) { hand_ = hand; if (hand_ != null) finger_ = hand.Fingers[(int)fingerType]; } public void SetOffset(Vector3 offset) { offset_ = offset; } public void MirrorZAxis(bool mirror = true) { mirror_z_axis_ = mirror; } public Hand GetLeapHand() { return hand_; } public Finger GetLeapFinger() { return finger_; } public abstract void InitFinger(); public abstract void UpdateFinger(); // Returns any additional movement the finger needs because of non-relative palm movement. public Vector3 GetOffset() { return offset_; } // Returns the location of the tip of the finger in relation to the controller. public Vector3 GetTipPosition() { Vector3 local_tip = finger_.Bone((Bone.BoneType.TYPE_DISTAL)).NextJoint.ToUnityScaled(mirror_z_axis_); return controller_.transform.TransformPoint(local_tip) + offset_; } // Returns the location of the given joint on the finger in relation to the controller. public Vector3 GetJointPosition(int joint) { if (joint >= NUM_BONES) return GetTipPosition(); Vector3 local_position = finger_.Bone((Bone.BoneType)(joint)).PrevJoint.ToUnityScaled(mirror_z_axis_); return controller_.transform.TransformPoint(local_position) + offset_; } // Returns a ray from the tip of the finger in the direction it is pointing. public Ray GetRay() { Ray ray = new Ray(GetTipPosition(), GetBoneDirection(NUM_BONES - 1)); return ray; } // Returns the center of the given bone on the finger in relation to the controller. public Vector3 GetBoneCenter(int bone_type) { Bone bone = finger_.Bone((Bone.BoneType)(bone_type)); return controller_.transform.TransformPoint(bone.Center.ToUnityScaled(mirror_z_axis_)) + offset_; } // Returns the direction the given bone is facing on the finger in relation to the controller. public Vector3 GetBoneDirection(int bone_type) { Vector3 direction = GetJointPosition(bone_type + 1) - GetJointPosition(bone_type); return direction.normalized; } // Returns the rotation quaternion of the given bone in relation to the controller. public Quaternion GetBoneRotation(int bone_type) { Quaternion local_rotation = finger_.Bone((Bone.BoneType)(bone_type)).Basis.Rotation(mirror_z_axis_); return controller_.transform.rotation * local_rotation; } // Returns the length of the finger bone public float GetBoneLength(int bone_type) { return finger_.Bone ((Bone.BoneType)(bone_type)).Length * UnityVectorExtension.INPUT_SCALE; } // Returns the width of the finger bone public float GetBoneWidth(int bone_type) { return finger_.Bone((Bone.BoneType)(bone_type)).Width * UnityVectorExtension.INPUT_SCALE; } } FingerModelAssembly-CSharp.dll