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¯ČŅss˙˙}vŲ/ĻCY„‹Û9,Assets/LeapMotion/Scripts/Hands/HandModel.cs HandModel`/******************************************************************************\ * 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 hands. public abstract class HandModel : MonoBehaviour { public const int NUM_FINGERS = 5; public float handModelPalmWidth = 0.085f; public FingerModel[] fingers = new FingerModel[NUM_FINGERS]; protected Hand hand_; protected HandController controller_; protected bool mirror_z_axis_ = false; public Vector3 GetHandOffset() { if (controller_ == null || hand_ == null) return Vector3.zero; Vector3 additional_movement = controller_.handMovementScale - Vector3.one; Vector3 scaled_wrist_position = Vector3.Scale(additional_movement, hand_.WristPosition.ToUnityScaled(mirror_z_axis_)); return controller_.transform.TransformPoint(scaled_wrist_position) - controller_.transform.position; } // Returns the palm position of the hand in relation to the controller. public Vector3 GetPalmPosition() { return controller_.transform.TransformPoint(hand_.PalmPosition.ToUnityScaled(mirror_z_axis_)) + GetHandOffset(); } // Returns the palm rotation of the hand in relation to the controller. public Quaternion GetPalmRotation() { return GetController().transform.rotation * GetLeapHand().Basis.Rotation(mirror_z_axis_); } // Returns the palm direction of the hand in relation to the controller. public Vector3 GetPalmDirection() { return controller_.transform.TransformDirection(hand_.Direction.ToUnity(mirror_z_axis_)); } // Returns the palm normal of the hand in relation to the controller. public Vector3 GetPalmNormal() { return controller_.transform.TransformDirection(hand_.PalmNormal.ToUnity(mirror_z_axis_)); } // Returns the lower arm direction in relation to the controller. public Vector3 GetArmDirection() { return controller_.transform.TransformDirection(hand_.Arm.Direction.ToUnity(mirror_z_axis_)); } // Returns the lower arm center in relation to the controller. public Vector3 GetArmCenter() { Vector leap_center = 0.5f * (hand_.Arm.WristPosition + hand_.Arm.ElbowPosition); return controller_.transform.TransformPoint(leap_center.ToUnityScaled(mirror_z_axis_)) + GetHandOffset(); } // Returns the length of the forearm public float GetArmLength() { return (hand_.Arm.WristPosition - hand_.Arm.ElbowPosition).Magnitude * UnityVectorExtension.INPUT_SCALE; } // Returns the width of the forearm public float GetArmWidth() { return hand_.Arm.Width * UnityVectorExtension.INPUT_SCALE; } // Returns the lower arm elbow position in relation to the controller. public Vector3 GetElbowPosition() { Vector3 local_position = hand_.Arm.ElbowPosition.ToUnityScaled(mirror_z_axis_); return controller_.transform.TransformPoint(local_position) + GetHandOffset(); } // Returns the lower arm wrist position in relation to the controller. public Vector3 GetWristPosition() { Vector3 local_position = hand_.Arm.WristPosition.ToUnityScaled(mirror_z_axis_); return controller_.transform.TransformPoint(local_position) + GetHandOffset(); } // Returns the rotation quaternion of the arm in relation to the controller. public Quaternion GetArmRotation() { Quaternion local_rotation = hand_.Arm.Basis.Rotation(mirror_z_axis_); return controller_.transform.rotation * local_rotation; } public Hand GetLeapHand() { return hand_; } public void SetLeapHand(Hand hand) { hand_ = hand; for (int i = 0; i < fingers.Length; ++i) { if (fingers[i] != null) { fingers[i].SetLeapHand(hand_); fingers[i].SetOffset(GetHandOffset()); } } } public void MirrorZAxis(bool mirror = true) { mirror_z_axis_ = mirror; for (int i = 0; i < fingers.Length; ++i) { if (fingers[i] != null) fingers[i].MirrorZAxis(mirror); } } public bool IsMirrored() { return mirror_z_axis_; } public HandController GetController() { return controller_; } public void SetController(HandController controller) { controller_ = controller; for (int i = 0; i < fingers.Length; ++i) { if (fingers[i] != null) fingers[i].SetController(controller_); } } public abstract void InitHand(); public abstract void UpdateHand(); } HandModelAssembly-CSharp.dll