123456789101112131415161718192021222324252627282930313233343536373839 |
- using System;
- using UnityEngine;
- namespace Leap.Unity
- {
- public class SkeletalFinger : FingerModel
- {
- public override void InitFinger()
- {
- this.SetPositions();
- }
- public override void UpdateFinger()
- {
- Debug.Log("SkeletalFinger.SetPositions()");
- this.SetPositions();
- }
- protected void SetPositions()
- {
- for (int i = 0; i < this.bones.Length; i++)
- {
- if (this.bones[i] != null)
- {
- this.bones[i].transform.position = base.GetBoneCenter(i);
- this.bones[i].transform.rotation = base.GetBoneRotation(i);
- }
- }
- for (int j = 0; j < this.joints.Length; j++)
- {
- if (this.joints[j] != null)
- {
- this.joints[j].transform.position = base.GetJointPosition(j + 1);
- this.joints[j].transform.rotation = base.GetBoneRotation(j + 1);
- }
- }
- }
- }
- }
|