SteamVR_Behaviour_SkeletonCustom.cs
4.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
//======= Copyright (c) Valve Corporation, All rights reserved. ===============
using UnityEngine;
using Valve.VR;
namespace Valve.VR
{
/// <summary>
/// The major difference between this component and the standard SteamVR_Behaviour_Skeleton is this one lets you
/// only use the joints you care about. You can set the transforms you're concerned with and ignore the ones you're not.
/// </summary>
public class SteamVR_Behaviour_SkeletonCustom : SteamVR_Behaviour_Skeleton
{
[SerializeField]
protected Transform _wrist;
[SerializeField]
protected Transform _thumbMetacarpal;
[SerializeField]
protected Transform _thumbProximal;
[SerializeField]
protected Transform _thumbMiddle;
[SerializeField]
protected Transform _thumbDistal;
[SerializeField]
protected Transform _thumbTip;
[SerializeField]
protected Transform _thumbAux;
[SerializeField]
protected Transform _indexMetacarpal;
[SerializeField]
protected Transform _indexProximal;
[SerializeField]
protected Transform _indexMiddle;
[SerializeField]
protected Transform _indexDistal;
[SerializeField]
protected Transform _indexTip;
[SerializeField]
protected Transform _indexAux;
[SerializeField]
protected Transform _middleMetacarpal;
[SerializeField]
protected Transform _middleProximal;
[SerializeField]
protected Transform _middleMiddle;
[SerializeField]
protected Transform _middleDistal;
[SerializeField]
protected Transform _middleTip;
[SerializeField]
protected Transform _middleAux;
[SerializeField]
protected Transform _ringMetacarpal;
[SerializeField]
protected Transform _ringProximal;
[SerializeField]
protected Transform _ringMiddle;
[SerializeField]
protected Transform _ringDistal;
[SerializeField]
protected Transform _ringTip;
[SerializeField]
protected Transform _ringAux;
[SerializeField]
protected Transform _pinkyMetacarpal;
[SerializeField]
protected Transform _pinkyProximal;
[SerializeField]
protected Transform _pinkyMiddle;
[SerializeField]
protected Transform _pinkyDistal;
[SerializeField]
protected Transform _pinkyTip;
[SerializeField]
protected Transform _pinkyAux;
protected override void AssignBonesArray()
{
bones[SteamVR_Skeleton_JointIndexes.wrist] = _wrist;
bones[SteamVR_Skeleton_JointIndexes.thumbProximal] = _thumbProximal;
bones[SteamVR_Skeleton_JointIndexes.thumbMiddle] = _thumbMiddle;
bones[SteamVR_Skeleton_JointIndexes.thumbDistal] = _thumbDistal;
bones[SteamVR_Skeleton_JointIndexes.thumbTip] = _thumbTip;
bones[SteamVR_Skeleton_JointIndexes.thumbAux] = _thumbAux;
bones[SteamVR_Skeleton_JointIndexes.indexProximal] = _indexProximal;
bones[SteamVR_Skeleton_JointIndexes.indexMiddle] = _indexMiddle;
bones[SteamVR_Skeleton_JointIndexes.indexDistal] = _indexDistal;
bones[SteamVR_Skeleton_JointIndexes.indexTip] = _indexTip;
bones[SteamVR_Skeleton_JointIndexes.indexAux] = _indexAux;
bones[SteamVR_Skeleton_JointIndexes.middleProximal] = _middleProximal;
bones[SteamVR_Skeleton_JointIndexes.middleMiddle] = _middleMiddle;
bones[SteamVR_Skeleton_JointIndexes.middleDistal] = _middleDistal;
bones[SteamVR_Skeleton_JointIndexes.middleTip] = _middleTip;
bones[SteamVR_Skeleton_JointIndexes.middleAux] = _middleAux;
bones[SteamVR_Skeleton_JointIndexes.ringProximal] = _ringProximal;
bones[SteamVR_Skeleton_JointIndexes.ringMiddle] = _ringMiddle;
bones[SteamVR_Skeleton_JointIndexes.ringDistal] = _ringDistal;
bones[SteamVR_Skeleton_JointIndexes.ringTip] = _ringTip;
bones[SteamVR_Skeleton_JointIndexes.ringAux] = _ringAux;
bones[SteamVR_Skeleton_JointIndexes.pinkyProximal] = _pinkyProximal;
bones[SteamVR_Skeleton_JointIndexes.pinkyMiddle] = _pinkyMiddle;
bones[SteamVR_Skeleton_JointIndexes.pinkyDistal] = _pinkyDistal;
bones[SteamVR_Skeleton_JointIndexes.pinkyTip] = _pinkyTip;
bones[SteamVR_Skeleton_JointIndexes.pinkyAux] = _pinkyAux;
}
}
}