Tanoda
SkeletalFinger.cs
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (C) Ultraleap, Inc. 2011-2020. *
3 * *
4 * Use subject to the terms of the Apache License 2.0 available at *
5 * http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
6 * between Ultraleap and you, your company or other organization. *
7 ******************************************************************************/
8
9using UnityEngine;
10using System.Collections;
11using Leap;
12
13namespace Leap.Unity{
19 public class SkeletalFinger : FingerModel {
20
22 public override void InitFinger() {
24 }
25
27 public override void UpdateFinger() {
29 }
30
31 protected void SetPositions() {
32 for (int i = 0; i < bones.Length; ++i) {
33 if (bones[i] != null) {
34 bones[i].transform.position = GetBoneCenter(i);
35 bones[i].transform.rotation = GetBoneRotation(i);
36 }
37 }
38
39 for (int i = 0; i < joints.Length; ++i) {
40 if (joints[i] != null) {
41 joints[i].transform.position = GetJointPosition(i + 1);
42 joints[i].transform.rotation = GetBoneRotation(i + 1);
43 }
44 }
45 }
46 }
47}
Quaternion GetBoneRotation(int bone_type)
Definition: FingerModel.cs:140
Vector3 GetBoneCenter(int bone_type)
Definition: FingerModel.cs:116
Vector3 GetJointPosition(int joint)
Definition: FingerModel.cs:95
override void InitFinger()
override void UpdateFinger()