HandPose.cs
9.31 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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
using System;
using UnityEngine;
namespace UniHumanoid
{
public class HandPoseModifier : IPoseModifier
{
public class HandPose
{
public float ThumbStrech;
public float ThumbSpread;
public float IndexStrech;
public float IndexSpread;
public float MiddleStrech;
public float MiddleSpread;
public float RingStrech;
public float RingSpread;
public float LittleStrech;
public float LittleSpread;
}
public HandPose LeftHandPose
{
get;
set;
}
public HandPose RightHandPose
{
get;
set;
}
int LeftThumb1Stretched;
int LeftThumb2Stretched;
int LeftThumb3Stretched;
int LeftIndex1Stretched;
int LeftIndex2Stretched;
int LeftIndex3Stretched;
int LeftMiddle1Stretched;
int LeftMiddle2Stretched;
int LeftMiddle3Stretched;
int LeftRing1Stretched;
int LeftRing2Stretched;
int LeftRing3Stretched;
int LeftLittle1Stretched;
int LeftLittle2Stretched;
int LeftLittle3Stretched;
int LeftThumbSpread;
int LeftIndexSpread;
int LeftMiddleSpread;
int LeftRingSpread;
int LeftLittleSpread;
int RightThumb1Stretched;
int RightThumb2Stretched;
int RightThumb3Stretched;
int RightIndex1Stretched;
int RightIndex2Stretched;
int RightIndex3Stretched;
int RightMiddle1Stretched;
int RightMiddle2Stretched;
int RightMiddle3Stretched;
int RightRing1Stretched;
int RightRing2Stretched;
int RightRing3Stretched;
int RightLittle1Stretched;
int RightLittle2Stretched;
int RightLittle3Stretched;
int RightThumbSpread;
int RightIndexSpread;
int RightMiddleSpread;
int RightRingSpread;
int RightLittleSpread;
public HandPoseModifier()
{
LeftThumb1Stretched = Array.IndexOf(HumanTrait.MuscleName, "Left Thumb 1 Stretched");
LeftThumb2Stretched = Array.IndexOf(HumanTrait.MuscleName, "Left Thumb 2 Stretched");
LeftThumb3Stretched = Array.IndexOf(HumanTrait.MuscleName, "Left Thumb 3 Stretched");
LeftIndex1Stretched = Array.IndexOf(HumanTrait.MuscleName, "Left Index 1 Stretched");
LeftIndex2Stretched = Array.IndexOf(HumanTrait.MuscleName, "Left Index 2 Stretched");
LeftIndex3Stretched = Array.IndexOf(HumanTrait.MuscleName, "Left Index 3 Stretched");
LeftMiddle1Stretched = Array.IndexOf(HumanTrait.MuscleName, "Left Middle 1 Stretched");
LeftMiddle2Stretched = Array.IndexOf(HumanTrait.MuscleName, "Left Middle 2 Stretched");
LeftMiddle3Stretched = Array.IndexOf(HumanTrait.MuscleName, "Left Middle 3 Stretched");
LeftRing1Stretched = Array.IndexOf(HumanTrait.MuscleName, "Left Ring 1 Stretched");
LeftRing2Stretched = Array.IndexOf(HumanTrait.MuscleName, "Left Ring 2 Stretched");
LeftRing3Stretched = Array.IndexOf(HumanTrait.MuscleName, "Left Ring 3 Stretched");
LeftLittle1Stretched = Array.IndexOf(HumanTrait.MuscleName, "Left Little 1 Stretched");
LeftLittle2Stretched = Array.IndexOf(HumanTrait.MuscleName, "Left Little 2 Stretched");
LeftLittle3Stretched = Array.IndexOf(HumanTrait.MuscleName, "Left Little 3 Stretched");
LeftThumbSpread = Array.IndexOf(HumanTrait.MuscleName, "Left Thumb Spread");
LeftIndexSpread = Array.IndexOf(HumanTrait.MuscleName, "Left Index Spread");
LeftMiddleSpread = Array.IndexOf(HumanTrait.MuscleName, "Left Middle Spread");
LeftRingSpread = Array.IndexOf(HumanTrait.MuscleName, "Left Ring Spread");
LeftLittleSpread = Array.IndexOf(HumanTrait.MuscleName, "Left Little Spread");
RightThumb1Stretched = Array.IndexOf(HumanTrait.MuscleName, "Right Thumb 1 Stretched");
RightThumb2Stretched = Array.IndexOf(HumanTrait.MuscleName, "Right Thumb 2 Stretched");
RightThumb3Stretched = Array.IndexOf(HumanTrait.MuscleName, "Right Thumb 3 Stretched");
RightIndex1Stretched = Array.IndexOf(HumanTrait.MuscleName, "Right Index 1 Stretched");
RightIndex2Stretched = Array.IndexOf(HumanTrait.MuscleName, "Right Index 2 Stretched");
RightIndex3Stretched = Array.IndexOf(HumanTrait.MuscleName, "Right Index 3 Stretched");
RightMiddle1Stretched = Array.IndexOf(HumanTrait.MuscleName, "Right Middle 1 Stretched");
RightMiddle2Stretched = Array.IndexOf(HumanTrait.MuscleName, "Right Middle 2 Stretched");
RightMiddle3Stretched = Array.IndexOf(HumanTrait.MuscleName, "Right Middle 3 Stretched");
RightRing1Stretched = Array.IndexOf(HumanTrait.MuscleName, "Right Ring 1 Stretched");
RightRing2Stretched = Array.IndexOf(HumanTrait.MuscleName, "Right Ring 2 Stretched");
RightRing3Stretched = Array.IndexOf(HumanTrait.MuscleName, "Right Ring 3 Stretched");
RightLittle1Stretched = Array.IndexOf(HumanTrait.MuscleName, "Right Little 1 Stretched");
RightLittle2Stretched = Array.IndexOf(HumanTrait.MuscleName, "Right Little 2 Stretched");
RightLittle3Stretched = Array.IndexOf(HumanTrait.MuscleName, "Right Little 3 Stretched");
RightThumbSpread = Array.IndexOf(HumanTrait.MuscleName, "Right Thumb Spread");
RightIndexSpread = Array.IndexOf(HumanTrait.MuscleName, "Right Index Spread");
RightMiddleSpread = Array.IndexOf(HumanTrait.MuscleName, "Right Middle Spread");
RightRingSpread = Array.IndexOf(HumanTrait.MuscleName, "Right Ring Spread");
RightLittleSpread = Array.IndexOf(HumanTrait.MuscleName, "Right Little Spread");
}
public void Modify(ref HumanPose pose)
{
if (LeftHandPose != null)
{
pose.muscles[this.LeftThumb1Stretched] = LeftHandPose.ThumbStrech;
pose.muscles[this.LeftThumb2Stretched] = LeftHandPose.ThumbStrech;
pose.muscles[this.LeftThumb3Stretched] = LeftHandPose.ThumbStrech;
pose.muscles[this.LeftIndex1Stretched] = LeftHandPose.IndexStrech;
pose.muscles[this.LeftIndex2Stretched] = LeftHandPose.IndexStrech;
pose.muscles[this.LeftIndex3Stretched] = LeftHandPose.IndexStrech;
pose.muscles[this.LeftMiddle1Stretched] = LeftHandPose.MiddleStrech;
pose.muscles[this.LeftMiddle2Stretched] = LeftHandPose.MiddleStrech;
pose.muscles[this.LeftMiddle3Stretched] = LeftHandPose.MiddleStrech;
pose.muscles[this.LeftRing1Stretched] = LeftHandPose.RingStrech;
pose.muscles[this.LeftRing2Stretched] = LeftHandPose.RingStrech;
pose.muscles[this.LeftRing3Stretched] = LeftHandPose.RingStrech;
pose.muscles[this.LeftLittle1Stretched] = LeftHandPose.LittleStrech;
pose.muscles[this.LeftLittle2Stretched] = LeftHandPose.LittleStrech;
pose.muscles[this.LeftLittle3Stretched] = LeftHandPose.LittleStrech;
pose.muscles[this.LeftThumbSpread] = LeftHandPose.ThumbSpread;
pose.muscles[this.LeftIndexSpread] = LeftHandPose.IndexSpread;
pose.muscles[this.LeftMiddleSpread] = LeftHandPose.MiddleSpread;
pose.muscles[this.LeftRingSpread] = LeftHandPose.RingSpread;
pose.muscles[this.LeftLittleSpread] = LeftHandPose.LittleSpread;
}
if (RightHandPose != null)
{
pose.muscles[this.RightThumb1Stretched] = RightHandPose.ThumbStrech;
pose.muscles[this.RightThumb2Stretched] = RightHandPose.ThumbStrech;
pose.muscles[this.RightThumb3Stretched] = RightHandPose.ThumbStrech;
pose.muscles[this.RightIndex1Stretched] = RightHandPose.IndexStrech;
pose.muscles[this.RightIndex2Stretched] = RightHandPose.IndexStrech;
pose.muscles[this.RightIndex3Stretched] = RightHandPose.IndexStrech;
pose.muscles[this.RightMiddle1Stretched] = RightHandPose.MiddleStrech;
pose.muscles[this.RightMiddle2Stretched] = RightHandPose.MiddleStrech;
pose.muscles[this.RightMiddle3Stretched] = RightHandPose.MiddleStrech;
pose.muscles[this.RightRing1Stretched] = RightHandPose.RingStrech;
pose.muscles[this.RightRing2Stretched] = RightHandPose.RingStrech;
pose.muscles[this.RightRing3Stretched] = RightHandPose.RingStrech;
pose.muscles[this.RightLittle1Stretched] = RightHandPose.LittleStrech;
pose.muscles[this.RightLittle2Stretched] = RightHandPose.LittleStrech;
pose.muscles[this.RightLittle3Stretched] = RightHandPose.LittleStrech;
pose.muscles[this.RightThumbSpread] = RightHandPose.ThumbSpread;
pose.muscles[this.RightIndexSpread] = RightHandPose.IndexSpread;
pose.muscles[this.RightMiddleSpread] = RightHandPose.MiddleSpread;
pose.muscles[this.RightRingSpread] = RightHandPose.RingSpread;
pose.muscles[this.RightLittleSpread] = RightHandPose.LittleSpread;
}
}
}
}