@algorisys/tinyfly 0.81.0 → 0.82.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/lib/addons/characters.js +1294 -1160
- package/lib/browser/tinyfly.iife.js +4 -4
- package/lib/browser/tinyfly.js +2194 -2060
- package/lib/browser/tinyfly.umd.js +4 -4
- package/lib/types/characters/dance.d.ts +47 -0
- package/lib/types/characters/index.d.ts +1 -1
- package/lib/types/characters/species/human.d.ts +8 -0
- package/package.json +1 -1
package/lib/addons/characters.js
CHANGED
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
import { b as
|
|
2
|
-
import { a as
|
|
3
|
-
import { createRandom as
|
|
4
|
-
function
|
|
5
|
-
const
|
|
6
|
-
if (
|
|
7
|
-
const
|
|
8
|
-
return e.forEach((s,
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
}), [...
|
|
12
|
-
}
|
|
13
|
-
function
|
|
14
|
-
const
|
|
15
|
-
if (
|
|
16
|
-
const l =
|
|
1
|
+
import { b as fn, s as Ge, p as It, c as rt } from "./sketch-CA8ZXhxI.js";
|
|
2
|
+
import { a as al } from "./sketch-CA8ZXhxI.js";
|
|
3
|
+
import { createRandom as cn, hashSeed as gn, getEasingFunction as _e } from "@algorisys/tinyfly";
|
|
4
|
+
function Te(e, t, n) {
|
|
5
|
+
const o = e.length;
|
|
6
|
+
if (o < 2) return [];
|
|
7
|
+
const r = [], l = [], i = (s) => t + (n - t) * s / (o - 1);
|
|
8
|
+
return e.forEach((s, a) => {
|
|
9
|
+
const h = e[Math.max(0, a - 1)], f = e[Math.min(o - 1, a + 1)], g = Math.hypot(f.x - h.x, f.y - h.y) || 1, p = i(a) / 2, c = -(f.y - h.y) / g * p, u = (f.x - h.x) / g * p;
|
|
10
|
+
r.push({ x: s.x + c, y: s.y + u }), l.push({ x: s.x - c, y: s.y - u });
|
|
11
|
+
}), [...r, ...l.reverse()];
|
|
12
|
+
}
|
|
13
|
+
function lt(e, t, n, o) {
|
|
14
|
+
const r = t.length;
|
|
15
|
+
if (r < 2) return;
|
|
16
|
+
const l = Te(t, n, o), i = (s) => n + (o - n) * s / (r - 1);
|
|
17
17
|
e.beginPath(), e.moveTo(l[0].x, l[0].y);
|
|
18
18
|
for (const s of l.slice(1)) e.lineTo(s.x, s.y);
|
|
19
|
-
e.closePath(), e.fill(), t.forEach((s,
|
|
20
|
-
|
|
19
|
+
e.closePath(), e.fill(), t.forEach((s, a) => {
|
|
20
|
+
a !== 0 && a !== r - 1 && r > 3 || (e.beginPath(), e.arc(s.x, s.y, i(a) / 2, 0, Math.PI * 2), e.fill());
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
|
-
function fe(e, t, n,
|
|
23
|
+
function fe(e, t, n, o, r = 16) {
|
|
24
24
|
const l = { x: 2 * t.x - (e.x + n.x) / 2, y: 2 * t.y - (e.y + n.y) / 2 }, i = [];
|
|
25
|
-
for (let s = 0; s <=
|
|
26
|
-
const
|
|
27
|
-
x: f * f * e.x + 2 * f *
|
|
28
|
-
y: f * f * e.y + 2 * f *
|
|
25
|
+
for (let s = 0; s <= r; s++) {
|
|
26
|
+
const a = s / r, h = a < 0.5 ? { x: e.x + (t.x - e.x) * 2 * a, y: e.y + (t.y - e.y) * 2 * a } : { x: t.x + (n.x - t.x) * (2 * a - 1), y: t.y + (n.y - t.y) * (2 * a - 1) }, f = 1 - a, g = {
|
|
27
|
+
x: f * f * e.x + 2 * f * a * l.x + a * a * n.x,
|
|
28
|
+
y: f * f * e.y + 2 * f * a * l.y + a * a * n.y
|
|
29
29
|
};
|
|
30
|
-
i.push({ x:
|
|
30
|
+
i.push({ x: h.x + (g.x - h.x) * o, y: h.y + (g.y - h.y) * o });
|
|
31
31
|
}
|
|
32
32
|
return i;
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
const
|
|
36
|
-
return Array.from({ length: s + 1 }, (f,
|
|
37
|
-
const p = l + Math.PI * 2 * i *
|
|
38
|
-
return { x: e + c *
|
|
34
|
+
function dt(e, t, n, o, r, l = 0, i = 1, s = 40) {
|
|
35
|
+
const a = Math.cos(r), h = Math.sin(r);
|
|
36
|
+
return Array.from({ length: s + 1 }, (f, g) => {
|
|
37
|
+
const p = l + Math.PI * 2 * i * g / s, c = Math.cos(p) * n, u = Math.sin(p) * o;
|
|
38
|
+
return { x: e + c * a - u * h, y: t + c * h + u * a };
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
return t.look === "pencil" ?
|
|
41
|
+
function $t(e, t) {
|
|
42
|
+
return t.look === "pencil" ? bn(e, t) : un(e, t.ink, t.look);
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function Ke(e, t, n = !1) {
|
|
45
45
|
e.beginPath(), e.moveTo(t[0].x, t[0].y);
|
|
46
|
-
for (const
|
|
46
|
+
for (const o of t.slice(1)) e.lineTo(o.x, o.y);
|
|
47
47
|
n && e.closePath();
|
|
48
48
|
}
|
|
49
|
-
function
|
|
50
|
-
const
|
|
49
|
+
function un(e, t, n) {
|
|
50
|
+
const o = n === "silhouette", r = o ? 1.25 : 1;
|
|
51
51
|
return {
|
|
52
52
|
look: n,
|
|
53
53
|
ink: t,
|
|
54
54
|
limb(l, i, s) {
|
|
55
|
-
e.fillStyle = t,
|
|
55
|
+
e.fillStyle = t, lt(e, l, i * r, s * r);
|
|
56
56
|
},
|
|
57
57
|
line(l, i) {
|
|
58
|
-
l.length < 2 || (e.strokeStyle = t, e.lineWidth = i *
|
|
58
|
+
l.length < 2 || (e.strokeStyle = t, e.lineWidth = i * r, e.lineCap = "round", e.lineJoin = "round", Ke(e, l), e.stroke());
|
|
59
59
|
},
|
|
60
60
|
shape(l, i, s) {
|
|
61
|
-
|
|
61
|
+
Ke(e, l, !0), (i !== null || o) && (e.fillStyle = o ? t : i, e.fill()), !(s <= 0) && (e.strokeStyle = t, e.lineWidth = s * r, e.lineJoin = "round", e.stroke());
|
|
62
62
|
},
|
|
63
|
-
ellipse(l, i, s,
|
|
64
|
-
e.beginPath(), e.ellipse(l, i, s,
|
|
63
|
+
ellipse(l, i, s, a, h, f, g) {
|
|
64
|
+
e.beginPath(), e.ellipse(l, i, s, a, h, 0, Math.PI * 2), (f !== null || o) && (e.fillStyle = o ? t : f, e.fill()), !(g <= 0) && (e.strokeStyle = t, e.lineWidth = g * r, e.stroke());
|
|
65
65
|
},
|
|
66
66
|
dot(l, i, s) {
|
|
67
|
-
e.fillStyle = t, e.beginPath(), e.arc(l, i, s *
|
|
67
|
+
e.fillStyle = t, e.beginPath(), e.arc(l, i, s * r, 0, Math.PI * 2), e.fill();
|
|
68
68
|
},
|
|
69
69
|
guide() {
|
|
70
70
|
},
|
|
@@ -72,101 +72,101 @@ function sn(e, t, n) {
|
|
|
72
72
|
}
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function dn(e, t) {
|
|
76
76
|
const n = [e[0]];
|
|
77
|
-
let
|
|
77
|
+
let o = 0;
|
|
78
78
|
for (let i = 1; i < e.length; i++) {
|
|
79
|
-
const s = e[i - 1],
|
|
80
|
-
let f = t -
|
|
81
|
-
for (; f <
|
|
82
|
-
const
|
|
83
|
-
n.push({ x: s.x + (
|
|
79
|
+
const s = e[i - 1], a = e[i], h = Math.hypot(a.x - s.x, a.y - s.y);
|
|
80
|
+
let f = t - o;
|
|
81
|
+
for (; f < h; ) {
|
|
82
|
+
const g = f / h;
|
|
83
|
+
n.push({ x: s.x + (a.x - s.x) * g, y: s.y + (a.y - s.y) * g }), f += t;
|
|
84
84
|
}
|
|
85
|
-
|
|
85
|
+
o = h - (f - t);
|
|
86
86
|
}
|
|
87
|
-
const
|
|
88
|
-
return Math.hypot(
|
|
87
|
+
const r = e[e.length - 1], l = n[n.length - 1];
|
|
88
|
+
return Math.hypot(r.x - l.x, r.y - l.y) > t * 0.25 ? n.push(r) : n[n.length - 1] = r, n;
|
|
89
89
|
}
|
|
90
|
-
function
|
|
90
|
+
function pn(e, t) {
|
|
91
91
|
const n = e.length;
|
|
92
|
-
return e.map((
|
|
93
|
-
const l = e[Math.max(0,
|
|
94
|
-
return { x:
|
|
92
|
+
return e.map((o, r) => {
|
|
93
|
+
const l = e[Math.max(0, r - 1)], i = e[Math.min(n - 1, r + 1)], s = Math.hypot(i.x - l.x, i.y - l.y) || 1, a = t(n === 1 ? 0 : r / (n - 1));
|
|
94
|
+
return { x: o.x - (i.y - l.y) / s * a, y: o.y + (i.x - l.x) / s * a };
|
|
95
95
|
});
|
|
96
96
|
}
|
|
97
|
-
function
|
|
98
|
-
const t = [0.6, 1.4, 2.9].map((
|
|
99
|
-
frequency:
|
|
97
|
+
function pt(e) {
|
|
98
|
+
const t = [0.6, 1.4, 2.9].map((o) => ({
|
|
99
|
+
frequency: o * (0.8 + e.next() * 0.4),
|
|
100
100
|
phase: e.next() * Math.PI * 2,
|
|
101
101
|
amount: 0.5 + e.next() * 0.5
|
|
102
|
-
})), n = t.reduce((
|
|
103
|
-
return (
|
|
104
|
-
}
|
|
105
|
-
function
|
|
106
|
-
const n = t.pencil ?? {},
|
|
107
|
-
let
|
|
108
|
-
const f = (
|
|
109
|
-
if (
|
|
110
|
-
const
|
|
111
|
-
let H =
|
|
112
|
-
if (
|
|
113
|
-
const [W,
|
|
114
|
-
H = [...H, { x:
|
|
102
|
+
})), n = t.reduce((o, r) => o + r.amount, 0);
|
|
103
|
+
return (o) => t.reduce((r, l) => r + l.amount * Math.sin(Math.PI * 2 * l.frequency * o + l.phase), 0) / n;
|
|
104
|
+
}
|
|
105
|
+
function bn(e, t) {
|
|
106
|
+
const n = t.pencil ?? {}, o = t.ink, r = n.roughness ?? Math.max(1, t.lineWidth * 0.12), l = Math.max(1, Math.round(n.passes ?? 2)), i = Math.min(1, Math.max(0, n.pressure ?? 0.25)), s = Math.min(1, Math.max(0, n.rubbedOut ?? 0.15)), a = fn(t.time, n.boil ?? 8);
|
|
107
|
+
let h = 0;
|
|
108
|
+
const f = (u, d, b = !1) => cn(gn(`${t.seed}:${b ? "paper" : a}:${u}:${d}`)), g = (u, d, b, m, w, S = 0) => {
|
|
109
|
+
if (u.length < 2) return;
|
|
110
|
+
const M = u.slice(1).reduce((W, v, y) => W + Math.hypot(v.x - u[y].x, v.y - u[y].y), 0);
|
|
111
|
+
let H = dn(u, Math.max(1.5, Math.min(t.lineWidth * 0.8, M / 24)));
|
|
112
|
+
if (S > 0 && H.length >= 2) {
|
|
113
|
+
const [W, v] = [H[H.length - 2], H[H.length - 1]], y = Math.hypot(v.x - W.x, v.y - W.y) || 1;
|
|
114
|
+
H = [...H, { x: v.x + (v.x - W.x) / y * S, y: v.y + (v.y - W.y) / y * S }];
|
|
115
115
|
}
|
|
116
|
-
const
|
|
117
|
-
H.forEach((W,
|
|
118
|
-
const y =
|
|
119
|
-
A.push({ x: Q + P * L, y: ne +
|
|
120
|
-
}), e.save(), e.globalAlpha *= m, e.fillStyle =
|
|
121
|
-
}, p = (
|
|
122
|
-
const b =
|
|
116
|
+
const k = pt(b), E = pt(b), T = H.length, A = [], I = [];
|
|
117
|
+
H.forEach((W, v) => {
|
|
118
|
+
const y = T === 1 ? 0 : v / (T - 1), x = H[Math.max(0, v - 1)], O = H[Math.min(T - 1, v + 1)], K = Math.hypot(O.x - x.x, O.y - x.y) || 1, P = -(O.y - x.y) / K, B = (O.x - x.x) / K, $ = k(y) * w, _ = Math.min(1, y / 0.08, (1 - y) / 0.08), C = (0.55 + 0.45 * Math.sqrt(Math.max(0, _))) * (1 + i * E(y)), L = Math.max(0.3, d(y) * C / 2), Q = W.x + P * $, ne = W.y + B * $;
|
|
119
|
+
A.push({ x: Q + P * L, y: ne + B * L }), I.push({ x: Q - P * L, y: ne - B * L });
|
|
120
|
+
}), e.save(), e.globalAlpha *= m, e.fillStyle = o, Ke(e, [...A, ...I.reverse()], !0), e.fill(), e.restore();
|
|
121
|
+
}, p = (u, d) => {
|
|
122
|
+
const b = h++, m = f(b, 99, !0);
|
|
123
123
|
if (m.next() < s) {
|
|
124
|
-
const H = (m.next() * 2 - 1) * t.lineWidth * 1.4,
|
|
125
|
-
|
|
124
|
+
const H = (m.next() * 2 - 1) * t.lineWidth * 1.4, k = (m.next() * 2 - 1) * t.lineWidth * 1.4, E = u.map((T) => ({ x: T.x + H, y: T.y + k }));
|
|
125
|
+
g(E, (T) => d(T) * 1.8, f(b, 98, !0), 0.035, r), g(E, (T) => d(T) * 0.45, f(b, 97, !0), 0.12, r * 1.5);
|
|
126
126
|
}
|
|
127
|
-
const
|
|
127
|
+
const w = u.slice(1).reduce((H, k, E) => H + Math.hypot(k.x - u[E].x, k.y - u[E].y), 0), S = d(0.5) > 4 && w > d(0.5) * 6, M = S ? [-0.3, 0.3, 0] : [0];
|
|
128
128
|
for (let H = 0; H < l; H++) {
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
const A = f(b, H * 10 +
|
|
132
|
-
|
|
129
|
+
const k = H === 0;
|
|
130
|
+
M.forEach((E, T) => {
|
|
131
|
+
const A = f(b, H * 10 + T), I = E === 0 ? u : pn(u, (v) => d(v) * E * Math.sqrt(Math.sin(Math.PI * v))), W = !k && E === 0 ? t.lineWidth * (0.3 + A.next() * 0.8) : 0;
|
|
132
|
+
g(I, (v) => d(v) * (S ? 0.5 : 1) * (k ? 1 : 0.6), A, k ? 0.85 : 0.45, r * (k ? 0.6 : 1), W);
|
|
133
133
|
});
|
|
134
134
|
}
|
|
135
|
-
}, c = (
|
|
136
|
-
const H = f(
|
|
137
|
-
p(
|
|
135
|
+
}, c = (u, d, b, m, w, S) => {
|
|
136
|
+
const H = f(h, 50).next() * Math.PI * 2;
|
|
137
|
+
p(dt(u, d, b, m, w, H, 1.08, 48), () => S);
|
|
138
138
|
};
|
|
139
139
|
return {
|
|
140
140
|
look: "pencil",
|
|
141
|
-
ink:
|
|
142
|
-
limb(
|
|
143
|
-
p(
|
|
141
|
+
ink: o,
|
|
142
|
+
limb(u, d, b) {
|
|
143
|
+
p(u, (m) => d + (b - d) * m);
|
|
144
144
|
},
|
|
145
|
-
line(
|
|
146
|
-
p(
|
|
145
|
+
line(u, d) {
|
|
146
|
+
p(u, () => d);
|
|
147
147
|
},
|
|
148
|
-
shape(
|
|
149
|
-
d !== null && (e.save(), e.globalAlpha *= 0.88, e.fillStyle = d,
|
|
148
|
+
shape(u, d, b) {
|
|
149
|
+
d !== null && (e.save(), e.globalAlpha *= 0.88, e.fillStyle = d, Ke(e, u, !0), e.fill(), e.restore()), b > 0 && p([...u, u[0]], () => b);
|
|
150
150
|
},
|
|
151
|
-
ellipse(
|
|
152
|
-
|
|
151
|
+
ellipse(u, d, b, m, w, S, M) {
|
|
152
|
+
S !== null && (e.save(), e.globalAlpha *= 0.9, e.fillStyle = S, e.beginPath(), e.ellipse(u, d, b, m, w, 0, Math.PI * 2), e.fill(), e.restore()), c(u, d, b, m, w, M);
|
|
153
153
|
},
|
|
154
|
-
dot(
|
|
155
|
-
e.save(), e.globalAlpha *= 0.9, e.fillStyle =
|
|
154
|
+
dot(u, d, b) {
|
|
155
|
+
e.save(), e.globalAlpha *= 0.9, e.fillStyle = o, e.beginPath(), e.arc(u, d, b, 0, Math.PI * 2), e.fill(), e.restore();
|
|
156
156
|
},
|
|
157
|
-
guide(
|
|
158
|
-
if (n.construction === !1 ||
|
|
159
|
-
const d =
|
|
160
|
-
u
|
|
157
|
+
guide(u) {
|
|
158
|
+
if (n.construction === !1 || u.length < 2) return;
|
|
159
|
+
const d = h++;
|
|
160
|
+
g(u, () => Math.max(0.6, t.lineWidth * 0.18), f(d, 0), 0.28, r * 1.2, t.lineWidth);
|
|
161
161
|
},
|
|
162
|
-
guideEllipse(
|
|
162
|
+
guideEllipse(u, d, b, m, w) {
|
|
163
163
|
if (n.construction === !1) return;
|
|
164
|
-
const
|
|
165
|
-
|
|
164
|
+
const S = h++, M = f(S, 0), H = dt(u, d, b, m, w, M.next() * Math.PI * 2, 1.12, 48);
|
|
165
|
+
g(H, () => Math.max(0.6, t.lineWidth * 0.18), M, 0.28, r * 1.5);
|
|
166
166
|
}
|
|
167
167
|
};
|
|
168
168
|
}
|
|
169
|
-
const
|
|
169
|
+
const mn = ["thumb", "index", "middle", "ring", "pinky"], R = {
|
|
170
170
|
"thumb.curl": 0.15,
|
|
171
171
|
"thumb.across": 0.15,
|
|
172
172
|
"index.curl": 0.12,
|
|
@@ -179,48 +179,48 @@ const cn = ["thumb", "index", "middle", "ring", "pinky"], R = {
|
|
|
179
179
|
tilt: 0,
|
|
180
180
|
roll: 0
|
|
181
181
|
};
|
|
182
|
-
function
|
|
182
|
+
function F(e = {}) {
|
|
183
183
|
return { ...R, ...e };
|
|
184
184
|
}
|
|
185
|
-
const
|
|
185
|
+
const q = (e, t, n, o, r) => ({
|
|
186
186
|
"thumb.curl": e,
|
|
187
187
|
"index.curl": t,
|
|
188
188
|
"middle.curl": n,
|
|
189
|
-
"ring.curl":
|
|
190
|
-
"pinky.curl":
|
|
189
|
+
"ring.curl": o,
|
|
190
|
+
"pinky.curl": r
|
|
191
191
|
}), N = {
|
|
192
192
|
relaxed: R,
|
|
193
|
-
open:
|
|
194
|
-
spread:
|
|
195
|
-
flat:
|
|
196
|
-
fist:
|
|
197
|
-
point:
|
|
193
|
+
open: F({ ...q(0, 0, 0, 0, 0), "thumb.across": 0, spread: 0.55 }),
|
|
194
|
+
spread: F({ ...q(0, 0, 0, 0, 0), "thumb.across": 0, spread: 1 }),
|
|
195
|
+
flat: F({ ...q(0, 0, 0, 0, 0), "thumb.across": 0.35, spread: 0 }),
|
|
196
|
+
fist: F({ ...q(0.7, 1, 1, 1, 1), "thumb.across": 0.9, spread: 0 }),
|
|
197
|
+
point: F({ ...q(0.75, 0, 1, 1, 1), "thumb.across": 0.9, spread: 0 }),
|
|
198
198
|
/** The fist on its side, knuckles toward the viewer, the thumb up */
|
|
199
|
-
thumbsUp:
|
|
200
|
-
peace:
|
|
201
|
-
ok:
|
|
202
|
-
pinch:
|
|
203
|
-
cupped:
|
|
204
|
-
wave:
|
|
199
|
+
thumbsUp: F({ ...q(0, 1, 1, 1, 1), "thumb.across": 0, spread: 0, roll: 70 }),
|
|
200
|
+
peace: F({ ...q(0.75, 0, 0, 1, 1), "thumb.across": 0.9, spread: 1 }),
|
|
201
|
+
ok: F({ ...q(0.12, 0.6, 0.1, 0.15, 0.2), "thumb.across": 0.55, spread: 0.6 }),
|
|
202
|
+
pinch: F({ ...q(0.1, 0.65, 0.75, 0.85, 0.9), "thumb.across": 0.55, spread: 0 }),
|
|
203
|
+
cupped: F({ ...q(0.25, 0.4, 0.4, 0.4, 0.4), "thumb.across": 0.4, spread: 0.05, turn: 2 }),
|
|
204
|
+
wave: F({ ...q(0, 0.05, 0.05, 0.1, 0.12), "thumb.across": 0, spread: 0.7, turn: 2 }),
|
|
205
205
|
/** Holding a pencil to write: thumb and middle finger pinch it, the index finger rests on top */
|
|
206
|
-
pencilGrip:
|
|
206
|
+
pencilGrip: F({ ...q(0.1, 0.6, 0.72, 0.88, 0.95), "thumb.across": 0.5, spread: 0, turn: 0.8, bend: 10 }),
|
|
207
207
|
/** Holding a handle, a cup or a bar: every finger wrapped round it */
|
|
208
|
-
hold:
|
|
208
|
+
hold: F({ ...q(0.5, 0.7, 0.72, 0.74, 0.76), "thumb.across": 0.75, spread: 0, turn: 1 })
|
|
209
209
|
};
|
|
210
|
-
function
|
|
211
|
-
const
|
|
212
|
-
for (const [
|
|
213
|
-
const i = e[
|
|
214
|
-
r
|
|
210
|
+
function ye(e, t, n) {
|
|
211
|
+
const o = { ...e };
|
|
212
|
+
for (const [r, l] of Object.entries(t)) {
|
|
213
|
+
const i = e[r] ?? l;
|
|
214
|
+
o[r] = i + (l - i) * n;
|
|
215
215
|
}
|
|
216
|
-
return
|
|
216
|
+
return o;
|
|
217
217
|
}
|
|
218
|
-
const
|
|
218
|
+
const yn = {
|
|
219
219
|
index: { knuckle: [-0.16, 0.47, -0.02], bones: [0.2, 0.125, 0.1], width: 0.125, fan: -1 },
|
|
220
220
|
middle: { knuckle: [-0.055, 0.49, -0.02], bones: [0.22, 0.135, 0.1], width: 0.13, fan: -0.2 },
|
|
221
221
|
ring: { knuckle: [0.05, 0.475, -0.02], bones: [0.2, 0.125, 0.1], width: 0.122, fan: 0.55 },
|
|
222
222
|
pinky: { knuckle: [0.15, 0.43, -0.02], bones: [0.16, 0.1, 0.085], width: 0.108, fan: 1.25 }
|
|
223
|
-
},
|
|
223
|
+
}, wn = {
|
|
224
224
|
index: { knuckle: [-0.14, 0.47, -0.02], bones: [0.2, 0.125, 0.1], width: 0.15, fan: -1 },
|
|
225
225
|
middle: { knuckle: [0, 0.49, -0.02], bones: [0.22, 0.135, 0.1], width: 0.155, fan: 0 },
|
|
226
226
|
pinky: { knuckle: [0.14, 0.45, -0.02], bones: [0.19, 0.115, 0.095], width: 0.145, fan: 1 }
|
|
@@ -231,7 +231,7 @@ const gn = {
|
|
|
231
231
|
/** Where the thumb points with `across` 0 and 1 */
|
|
232
232
|
out: [-0.7, 0.68, -0.22],
|
|
233
233
|
across: [0.35, 0.5, -0.8]
|
|
234
|
-
},
|
|
234
|
+
}, kn = [82, 100, 62], Sn = [48, 72], En = 3, Hn = 13, Mn = 0.035, vn = -0.075, Tn = [
|
|
235
235
|
[-0.17, 0],
|
|
236
236
|
[-0.215, 0.12],
|
|
237
237
|
[-0.235, 0.26],
|
|
@@ -244,182 +244,182 @@ const gn = {
|
|
|
244
244
|
[0.225, 0.26],
|
|
245
245
|
[0.2, 0.1],
|
|
246
246
|
[0.16, 0]
|
|
247
|
-
], le = (e) => e * Math.PI / 180,
|
|
247
|
+
], le = (e) => e * Math.PI / 180, Je = (e, t) => [e[0] + t[0], e[1] + t[1], e[2] + t[2]], xe = (e, t) => [e[0] * t, e[1] * t, e[2] * t], Ze = (e, t) => [e[1] * t[2] - e[2] * t[1], e[2] * t[0] - e[0] * t[2], e[0] * t[1] - e[1] * t[0]], ge = (e) => {
|
|
248
248
|
const t = Math.hypot(e[0], e[1], e[2]) || 1;
|
|
249
249
|
return [e[0] / t, e[1] / t, e[2] / t];
|
|
250
250
|
};
|
|
251
251
|
function ie(e, t, n) {
|
|
252
|
-
const
|
|
252
|
+
const o = Math.cos(n), r = Math.sin(n), l = Ze(t, e), i = t[0] * e[0] + t[1] * e[1] + t[2] * e[2];
|
|
253
253
|
return [
|
|
254
|
-
e[0] *
|
|
255
|
-
e[1] *
|
|
256
|
-
e[2] *
|
|
254
|
+
e[0] * o + l[0] * r + t[0] * i * (1 - o),
|
|
255
|
+
e[1] * o + l[1] * r + t[1] * i * (1 - o),
|
|
256
|
+
e[2] * o + l[2] * r + t[2] * i * (1 - o)
|
|
257
257
|
];
|
|
258
258
|
}
|
|
259
|
-
const
|
|
260
|
-
function
|
|
261
|
-
const
|
|
259
|
+
const bt = [1, 0, 0], mt = [0, 1, 0], pe = [0, 0, 1];
|
|
260
|
+
function xn(e, t, n) {
|
|
261
|
+
const o = le(e.fan * (En + Hn * n)), r = [Math.sin(o), Math.cos(o), 0], l = [Math.cos(o), -Math.sin(o), 0], i = [e.knuckle];
|
|
262
262
|
let s = 0;
|
|
263
|
-
e.bones.forEach((f,
|
|
264
|
-
s += le(
|
|
263
|
+
e.bones.forEach((f, g) => {
|
|
264
|
+
s += le(kn[g] * t), i.push(Je(i[g], xe(ie(r, l, -s), f)));
|
|
265
265
|
});
|
|
266
|
-
const
|
|
267
|
-
return { joints: i, back:
|
|
266
|
+
const a = ie(pe, l, -s), h = i.map((f, g) => e.width * (1 - 0.14 * (g / (i.length - 1))));
|
|
267
|
+
return { joints: i, back: a, widths: h };
|
|
268
268
|
}
|
|
269
|
-
function
|
|
270
|
-
const
|
|
271
|
-
let
|
|
269
|
+
function An(e, t, n = 1, o = 1) {
|
|
270
|
+
const r = Math.min(1, Math.max(0, t)), l = ge(Je(xe(ge(V.out), 1 - r), xe(ge(V.across), r))), i = ge(Ze(pe, l)), s = ge(Ze(l, i)), a = [[V.base[0] * o, V.base[1], V.base[2]]];
|
|
271
|
+
let h = 0;
|
|
272
272
|
V.bones.forEach((p, c) => {
|
|
273
|
-
c > 0 && (
|
|
273
|
+
c > 0 && (h += le(Sn[c - 1] * e)), a.push(Je(a[c], xe(ie(l, i, h), p)));
|
|
274
274
|
});
|
|
275
|
-
const f = ie(s, i,
|
|
276
|
-
return { joints:
|
|
277
|
-
}
|
|
278
|
-
function
|
|
279
|
-
const n = { ...R, ...e },
|
|
280
|
-
...
|
|
281
|
-
knuckle: [
|
|
282
|
-
width:
|
|
283
|
-
}),
|
|
284
|
-
const y =
|
|
275
|
+
const f = ie(s, i, h), g = [...V.widths, V.widths[V.widths.length - 1] * 0.92].map((p) => p * n);
|
|
276
|
+
return { joints: a, back: f, widths: g };
|
|
277
|
+
}
|
|
278
|
+
function je(e, t = {}) {
|
|
279
|
+
const n = { ...R, ...e }, o = t.size ?? 100, r = t.side ?? "right", l = r === "left" ? -1 : 1, i = le(t.angle ?? 0), s = t.fingers === 4, a = Math.max(0.5, t.plump ?? 1), h = 1 + (a - 1) * 0.7, f = (v) => ({
|
|
280
|
+
...v,
|
|
281
|
+
knuckle: [v.knuckle[0] * h, v.knuckle[1], v.knuckle[2]],
|
|
282
|
+
width: v.width * a
|
|
283
|
+
}), g = le(n.bend ?? 0), p = le(n.tilt ?? 0), c = le(90 * (n.turn ?? 0)), u = (v) => ie(ie(ie(v, bt, -g), pe, -p), mt, c), d = Math.cos(i), b = Math.sin(i), m = le(n.roll ?? 0), w = Math.cos(m), S = Math.sin(m), M = (v) => {
|
|
284
|
+
const y = v[0] * o, x = -v[1] * o, O = (y * w - x * S) * l, K = y * S + x * w;
|
|
285
285
|
return { x: O * d - K * b, y: O * b + K * d };
|
|
286
|
-
}, H = (
|
|
287
|
-
const y =
|
|
288
|
-
return x > 1e-6 *
|
|
289
|
-
},
|
|
290
|
-
thumb:
|
|
291
|
-
}, E = s ?
|
|
292
|
-
for (const
|
|
293
|
-
const y = E[
|
|
294
|
-
y && (
|
|
286
|
+
}, H = (v) => {
|
|
287
|
+
const y = M(v), x = Math.hypot(y.x, y.y);
|
|
288
|
+
return x > 1e-6 * o ? { x: y.x / x, y: y.y / x } : { x: 0, y: 0 };
|
|
289
|
+
}, k = {
|
|
290
|
+
thumb: An(n["thumb.curl"] ?? 0, n["thumb.across"] ?? 0, a, h)
|
|
291
|
+
}, E = s ? wn : yn;
|
|
292
|
+
for (const v of mn) {
|
|
293
|
+
const y = E[v];
|
|
294
|
+
y && (k[v] = xn(f(y), n[`${v}.curl`] ?? 0, n.spread ?? 0));
|
|
295
295
|
}
|
|
296
|
-
const
|
|
297
|
-
for (const [
|
|
298
|
-
const x = y.joints.map(
|
|
299
|
-
v
|
|
300
|
-
points: x.map(
|
|
301
|
-
depths: x.map((K) => K[2] *
|
|
302
|
-
widths: y.widths.map((K) => K *
|
|
296
|
+
const T = {};
|
|
297
|
+
for (const [v, y] of Object.entries(k)) {
|
|
298
|
+
const x = y.joints.map(u), O = u(y.back);
|
|
299
|
+
T[v] = {
|
|
300
|
+
points: x.map(M),
|
|
301
|
+
depths: x.map((K) => K[2] * o),
|
|
302
|
+
widths: y.widths.map((K) => K * o),
|
|
303
303
|
nail: O[2],
|
|
304
304
|
back: H(O)
|
|
305
305
|
};
|
|
306
306
|
}
|
|
307
|
-
const A =
|
|
307
|
+
const A = Tn.flatMap(([v, y]) => [u([v * h, y, Mn]), u([v * h, y, vn])]), I = Pn(A.map(M)), W = A.reduce((v, y) => v + y[2], 0) / A.length * o;
|
|
308
308
|
return {
|
|
309
|
-
size:
|
|
310
|
-
side:
|
|
309
|
+
size: o,
|
|
310
|
+
side: r,
|
|
311
311
|
wrist: { x: 0, y: 0 },
|
|
312
312
|
palm: I,
|
|
313
313
|
palmDepth: W,
|
|
314
|
-
palmFacing: -
|
|
315
|
-
fingers:
|
|
316
|
-
axes: { up: H(
|
|
317
|
-
curls: Object.fromEntries(Object.keys(
|
|
314
|
+
palmFacing: -u(pe)[2],
|
|
315
|
+
fingers: T,
|
|
316
|
+
axes: { up: H(u(mt)), across: H(u(bt)), out: H(u(pe)) },
|
|
317
|
+
curls: Object.fromEntries(Object.keys(T).map((v) => [v, n[`${v}.curl`] ?? 0]))
|
|
318
318
|
};
|
|
319
319
|
}
|
|
320
|
-
function
|
|
321
|
-
const n = (
|
|
322
|
-
for (const [
|
|
323
|
-
r
|
|
324
|
-
return { ...e, wrist: n(e.wrist), palm: e.palm.map(n), fingers:
|
|
320
|
+
function Kn(e, t) {
|
|
321
|
+
const n = (r) => ({ x: r.x + t.x - e.wrist.x, y: r.y + t.y - e.wrist.y }), o = {};
|
|
322
|
+
for (const [r, l] of Object.entries(e.fingers))
|
|
323
|
+
o[r] = { ...l, points: l.points.map(n) };
|
|
324
|
+
return { ...e, wrist: n(e.wrist), palm: e.palm.map(n), fingers: o };
|
|
325
325
|
}
|
|
326
|
-
function
|
|
326
|
+
function Pn(e) {
|
|
327
327
|
const t = [...e].sort((l, i) => l.x - i.x || l.y - i.y);
|
|
328
328
|
if (t.length < 3) return t;
|
|
329
|
-
const n = (l, i, s) => (i.x - l.x) * (s.y - l.y) - (i.y - l.y) * (s.x - l.x),
|
|
329
|
+
const n = (l, i, s) => (i.x - l.x) * (s.y - l.y) - (i.y - l.y) * (s.x - l.x), o = [];
|
|
330
330
|
for (const l of t) {
|
|
331
|
-
for (; r.length >= 2 && n(r[r.length - 2], r[r.length - 1], l) <= 0; ) r.pop();
|
|
332
|
-
r.push(l);
|
|
333
|
-
}
|
|
334
|
-
const o = [];
|
|
335
|
-
for (const l of [...t].reverse()) {
|
|
336
331
|
for (; o.length >= 2 && n(o[o.length - 2], o[o.length - 1], l) <= 0; ) o.pop();
|
|
337
332
|
o.push(l);
|
|
338
333
|
}
|
|
339
|
-
|
|
334
|
+
const r = [];
|
|
335
|
+
for (const l of [...t].reverse()) {
|
|
336
|
+
for (; r.length >= 2 && n(r[r.length - 2], r[r.length - 1], l) <= 0; ) r.pop();
|
|
337
|
+
r.push(l);
|
|
338
|
+
}
|
|
339
|
+
return [...o.slice(0, -1), ...r.slice(0, -1)];
|
|
340
340
|
}
|
|
341
|
-
const
|
|
342
|
-
function
|
|
343
|
-
const l =
|
|
344
|
-
look:
|
|
341
|
+
const Wn = "#f1c9a5", On = "#2f2f33";
|
|
342
|
+
function st(e, t, n, o = {}, r = 0) {
|
|
343
|
+
const l = Kn(je(n, o), t), i = o.ink ?? On, s = o.lineWidth ?? l.size * 0.035, a = o.pen ?? $t(e, {
|
|
344
|
+
look: o.look ?? "clean",
|
|
345
345
|
ink: i,
|
|
346
346
|
lineWidth: s,
|
|
347
|
-
seed:
|
|
348
|
-
time:
|
|
349
|
-
pencil: { construction: !1, ...
|
|
350
|
-
}),
|
|
347
|
+
seed: o.seed ?? 1,
|
|
348
|
+
time: r,
|
|
349
|
+
pencil: { construction: !1, ...o.pencil }
|
|
350
|
+
}), h = o.skin ?? Wn, f = o.nails ?? !0, g = [
|
|
351
351
|
{
|
|
352
352
|
depth: l.palmDepth,
|
|
353
|
-
draw: () =>
|
|
353
|
+
draw: () => In(a, l, h, s)
|
|
354
354
|
}
|
|
355
355
|
];
|
|
356
356
|
for (const p of Object.values(l.fingers)) {
|
|
357
|
-
const c = p.depths.reduce((
|
|
358
|
-
|
|
357
|
+
const c = p.depths.reduce((u, d) => u + d, 0) / p.depths.length;
|
|
358
|
+
g.push({
|
|
359
359
|
depth: c,
|
|
360
|
-
draw: () =>
|
|
360
|
+
draw: () => $n(e, a, p, h, s, f)
|
|
361
361
|
});
|
|
362
362
|
}
|
|
363
|
-
if (
|
|
364
|
-
const p =
|
|
365
|
-
|
|
363
|
+
if (o.prop) {
|
|
364
|
+
const p = o.prop;
|
|
365
|
+
g.push({ depth: p.depth, draw: () => p.draw(a) });
|
|
366
366
|
}
|
|
367
367
|
e.save(), e.lineCap = "round", e.lineJoin = "round";
|
|
368
|
-
for (const p of [...
|
|
368
|
+
for (const p of [...g].sort((c, u) => c.depth - u.depth)) p.draw();
|
|
369
369
|
return e.restore(), l;
|
|
370
370
|
}
|
|
371
|
-
function
|
|
372
|
-
if (e.shape(t.palm, n,
|
|
373
|
-
const { up:
|
|
371
|
+
function In(e, t, n, o) {
|
|
372
|
+
if (e.shape(t.palm, n, o), t.palmFacing < -0.3 && e.look !== "silhouette") {
|
|
373
|
+
const { up: r } = t.axes;
|
|
374
374
|
for (const [l, i] of Object.entries(t.fingers)) {
|
|
375
375
|
const s = t.curls[l] ?? 0;
|
|
376
376
|
if (l === "thumb" || s < 0.5) continue;
|
|
377
|
-
const
|
|
378
|
-
const d =
|
|
379
|
-
return { x: f.x + Math.cos(d) *
|
|
377
|
+
const a = i.points[0], h = i.widths[0] * 0.42, f = { x: a.x - r.x * h * 0.2, y: a.y - r.y * h * 0.2 }, g = Math.atan2(r.y, r.x), p = Array.from({ length: 7 }, (c, u) => {
|
|
378
|
+
const d = g - Math.PI / 2 + Math.PI * u / 6;
|
|
379
|
+
return { x: f.x + Math.cos(d) * h, y: f.y + Math.sin(d) * h };
|
|
380
380
|
});
|
|
381
|
-
e.line(p,
|
|
381
|
+
e.line(p, o * 0.6);
|
|
382
382
|
}
|
|
383
383
|
}
|
|
384
384
|
if (t.palmFacing > 0.45 && e.look !== "silhouette") {
|
|
385
|
-
const { up:
|
|
386
|
-
x: s.x + (l.x * f +
|
|
387
|
-
y: s.y + (l.y * f +
|
|
388
|
-
}),
|
|
389
|
-
e.line([
|
|
385
|
+
const { up: r, across: l } = t.axes, i = t.size, s = t.wrist, a = (f, g) => ({
|
|
386
|
+
x: s.x + (l.x * f + r.x * g) * i,
|
|
387
|
+
y: s.y + (l.y * f + r.y * g) * i
|
|
388
|
+
}), h = t.side === "left" ? -1 : 1;
|
|
389
|
+
e.line([a(-0.15 * h, 0.36), a(-0.04 * h, 0.3), a(0.1 * h, 0.33)], o * 0.5);
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
|
-
function
|
|
393
|
-
const { widths: i } = n, s =
|
|
392
|
+
function $n(e, t, n, o, r, l) {
|
|
393
|
+
const { widths: i } = n, s = Bn(n.points, 2), a = n.points[0], h = s[s.length - 1], f = i[0], g = i[i.length - 1];
|
|
394
394
|
if (e.save(), t.look !== "silhouette") {
|
|
395
|
-
e.beginPath(), e.rect(
|
|
396
|
-
const d = f / 2 +
|
|
397
|
-
e.moveTo(
|
|
395
|
+
e.beginPath(), e.rect(a.x - 1e5, a.y - 1e5, 2e5, 2e5);
|
|
396
|
+
const d = f / 2 + r * 1.6;
|
|
397
|
+
e.moveTo(a.x + d, a.y), e.arc(a.x, a.y, d, 0, Math.PI * 2), e.clip("evenodd");
|
|
398
398
|
}
|
|
399
|
-
if (t.limb(s, f + 2 *
|
|
400
|
-
const p = s[s.length - 2], c =
|
|
399
|
+
if (t.limb(s, f + 2 * r, g + 2 * r), e.restore(), t.look !== "silhouette" && (e.fillStyle = o, lt(e, s, f, g)), t.look === "silhouette" || !l || n.nail < 0.25) return;
|
|
400
|
+
const p = s[s.length - 2], c = _n({ x: h.x - p.x, y: h.y - p.y }) ?? {
|
|
401
401
|
x: 0,
|
|
402
402
|
y: -1
|
|
403
|
-
},
|
|
404
|
-
x:
|
|
405
|
-
y:
|
|
403
|
+
}, u = {
|
|
404
|
+
x: h.x - c.x * g * 0.22 + n.back.x * g * 0.1,
|
|
405
|
+
y: h.y - c.y * g * 0.22 + n.back.y * g * 0.1
|
|
406
406
|
};
|
|
407
|
-
t.ellipse(
|
|
407
|
+
t.ellipse(u.x, u.y, g * 0.24 * Math.max(0.35, n.nail), g * 0.19, Math.atan2(c.y, c.x), "#f8e3d3", r * 0.45);
|
|
408
408
|
}
|
|
409
|
-
function
|
|
409
|
+
function Bn(e, t) {
|
|
410
410
|
let n = e;
|
|
411
|
-
for (let
|
|
411
|
+
for (let o = 0; o < t; o++) {
|
|
412
412
|
if (n.length < 3) return n;
|
|
413
|
-
const
|
|
413
|
+
const r = [n[0]];
|
|
414
414
|
for (let l = 0; l < n.length - 1; l++) {
|
|
415
415
|
const i = n[l], s = n[l + 1];
|
|
416
|
-
l > 0 &&
|
|
416
|
+
l > 0 && r.push({ x: i.x * 0.75 + s.x * 0.25, y: i.y * 0.75 + s.y * 0.25 }), l < n.length - 2 && r.push({ x: i.x * 0.25 + s.x * 0.75, y: i.y * 0.25 + s.y * 0.75 });
|
|
417
417
|
}
|
|
418
|
-
|
|
418
|
+
r.push(n[n.length - 1]), n = r;
|
|
419
419
|
}
|
|
420
420
|
return n;
|
|
421
421
|
}
|
|
422
|
-
const
|
|
422
|
+
const _n = (e) => {
|
|
423
423
|
const t = Math.hypot(e.x, e.y);
|
|
424
424
|
return t > 1e-6 ? { x: e.x / t, y: e.y / t } : null;
|
|
425
425
|
}, z = {
|
|
@@ -459,7 +459,7 @@ const Pn = (e) => {
|
|
|
459
459
|
function D(e) {
|
|
460
460
|
return { ...z, ...e };
|
|
461
461
|
}
|
|
462
|
-
const
|
|
462
|
+
const Bt = {
|
|
463
463
|
mouth: 0,
|
|
464
464
|
smile: 0,
|
|
465
465
|
mouthWidth: 1,
|
|
@@ -470,8 +470,8 @@ const Wt = {
|
|
|
470
470
|
browTilt: 0,
|
|
471
471
|
lookX: 0,
|
|
472
472
|
lookY: 0
|
|
473
|
-
}, Y = (e) => ({ ...
|
|
474
|
-
neutral:
|
|
473
|
+
}, Y = (e) => ({ ...Bt, ...e }), J = {
|
|
474
|
+
neutral: Bt,
|
|
475
475
|
happy: Y({ smile: 0.9, leftBrow: 0.2, rightBrow: 0.2 }),
|
|
476
476
|
joyful: Y({ mouth: 0.6, smile: 1, mouthWidth: 1.2, leftEye: 0, rightEye: 0, leftBrow: 0.4, rightBrow: 0.4 }),
|
|
477
477
|
sad: Y({ smile: -0.8, leftEye: 0.8, rightEye: 0.8, browTilt: 0.9, leftBrow: -0.1, rightBrow: -0.1, lookY: 0.6 }),
|
|
@@ -490,10 +490,10 @@ const Wt = {
|
|
|
490
490
|
smug: Y({ smile: 0.6, mouthWidth: 0.9, leftEye: 0.6, rightEye: 0.6, leftBrow: 0.1, rightBrow: 0.5, lookX: 0.5 }),
|
|
491
491
|
wink: Y({ smile: 0.9, leftEye: 0, rightEye: 1, leftBrow: -0.2, rightBrow: 0.3 })
|
|
492
492
|
};
|
|
493
|
-
function
|
|
493
|
+
function _t(e, t) {
|
|
494
494
|
return { ...e, ...typeof t == "string" ? J[t] : t };
|
|
495
495
|
}
|
|
496
|
-
const
|
|
496
|
+
const Fn = {
|
|
497
497
|
rest: z,
|
|
498
498
|
wave: D({ rightShoulder: 135, rightElbow: 30, headTilt: 6, ...J.happy }),
|
|
499
499
|
cheer: D({ leftShoulder: 125, leftElbow: 20, rightShoulder: 125, rightElbow: 20, ...J.joyful }),
|
|
@@ -515,127 +515,127 @@ const Wn = {
|
|
|
515
515
|
sideSplit: D({ leftHip: 90, rightHip: 90, leftAnkle: -45, rightAnkle: -45, leftShoulder: 120, rightShoulder: 120, leftElbow: 10, rightElbow: 10, ...J.happy }),
|
|
516
516
|
// Front split, in profile: the left leg forward (+x), the right leg back.
|
|
517
517
|
frontSplit: D({ turn: 1, leftHip: -90, rightHip: -90, leftAnkle: -45, rightAnkle: -45, leftShoulder: -150, rightShoulder: 150, leftElbow: 10, rightElbow: -10, ...J.happy })
|
|
518
|
-
},
|
|
519
|
-
function
|
|
520
|
-
const
|
|
521
|
-
for (const
|
|
522
|
-
return
|
|
523
|
-
}
|
|
524
|
-
const
|
|
525
|
-
function
|
|
526
|
-
const
|
|
518
|
+
}, Ft = Object.keys(z);
|
|
519
|
+
function we(e, t, n) {
|
|
520
|
+
const o = { ...e };
|
|
521
|
+
for (const r of Ft) o[r] = e[r] + (t[r] - e[r]) * n;
|
|
522
|
+
return o;
|
|
523
|
+
}
|
|
524
|
+
const Qe = 24, yt = 4, wt = 28, Rn = 40;
|
|
525
|
+
function Yn(e, t = z, n = 1) {
|
|
526
|
+
const o = Math.sin(e * Math.PI * 2) * n, r = Math.cos(e * Math.PI * 2) * n, l = (h) => h <= Rn, i = (h) => l(h) ? 22 * o : h, s = l(t.leftShoulder) ? t.leftElbow - wt * Math.max(0, -o) : t.leftElbow, a = l(t.rightShoulder) ? t.rightElbow + wt * Math.max(0, o) : t.rightElbow;
|
|
527
527
|
return {
|
|
528
528
|
...t,
|
|
529
529
|
// Lean into the walk, and keep the head a little more level than the body.
|
|
530
|
-
lean: t.lean +
|
|
531
|
-
headTilt: t.headTilt -
|
|
530
|
+
lean: t.lean + yt * n,
|
|
531
|
+
headTilt: t.headTilt - yt * 0.5 * n,
|
|
532
532
|
leftElbow: s,
|
|
533
|
-
rightElbow:
|
|
533
|
+
rightElbow: a,
|
|
534
534
|
// Left foot forward while swing > 0, right foot back; then the other way.
|
|
535
|
-
leftHip: -
|
|
536
|
-
rightHip: -
|
|
535
|
+
leftHip: -Qe * o,
|
|
536
|
+
rightHip: -Qe * o,
|
|
537
537
|
// The leg swinging forward lifts, its shin trailing backward (-x). A positive
|
|
538
538
|
// knee folds toward the centre, which is backward only for the right leg.
|
|
539
|
-
leftKnee: -30 * Math.max(0,
|
|
540
|
-
rightKnee: 30 * Math.max(0, -
|
|
539
|
+
leftKnee: -30 * Math.max(0, r),
|
|
540
|
+
rightKnee: 30 * Math.max(0, -r),
|
|
541
541
|
// Arms swing against the legs: left arm back while the left foot is forward.
|
|
542
542
|
leftShoulder: i(t.leftShoulder),
|
|
543
543
|
rightShoulder: i(t.rightShoulder)
|
|
544
544
|
};
|
|
545
545
|
}
|
|
546
|
-
function
|
|
547
|
-
return 4 * ((
|
|
546
|
+
function Kr(e, t = 1) {
|
|
547
|
+
return 4 * ((Ve + Pe) * e) * Math.sin(Qe * t * Math.PI / 180);
|
|
548
548
|
}
|
|
549
|
-
function
|
|
549
|
+
function Ln(e) {
|
|
550
550
|
const t = Math.abs(Math.sin(e / 65)), n = 0.55 + 0.45 * Math.sin(e / 310);
|
|
551
551
|
return t * n;
|
|
552
552
|
}
|
|
553
|
-
const
|
|
554
|
-
function
|
|
555
|
-
return
|
|
553
|
+
const Rt = 0.12, kt = 0.46, Nn = 1 - 2 * Rt, Cn = 0.1, Dn = 0.21, Xn = 0.19, Ve = 0.24, Pe = 0.22, Yt = 0.12, qn = 0.14, Lt = 0.33, St = 0.7, Et = 0.3, Un = 0.35, zn = [1.7, 1.05], Gn = [1.3, 0.75], Ht = [1.45, 0.85], Jn = [1.15, 0.75], Mt = 0.06, Zn = 0.7, jn = 0.65, Nt = 0.075, Qn = 0.3, Vn = 0.02, eo = 0.012, to = 12, no = 0.25, ke = 90, oo = 0.25, ro = 0.04, Ct = 0.01, se = (e) => Math.min(1, Math.max(0, e ?? 0));
|
|
554
|
+
function Pr(e, t = 1) {
|
|
555
|
+
return Pe * e * t;
|
|
556
556
|
}
|
|
557
|
-
const
|
|
558
|
-
function
|
|
559
|
-
const i = Math.max(1, Math.min(l * 0.6,
|
|
557
|
+
const et = -0.12, Dt = 0.4, Z = (e) => e * Math.PI / 180, lo = (e, t) => ({ x: t * Math.sin(Z(e)), y: Math.cos(Z(e)) }), Xt = (e, t) => Math.max(0, e) * (1 - Math.min(1, Math.max(0, t))), qt = (e, t, n, o) => e - 0.3 * t - n * 0.14 * t - Math.max(0, o - 1) * 0.12 * t;
|
|
558
|
+
function so(e, t, n, o, r, l) {
|
|
559
|
+
const i = Math.max(1, Math.min(l * 0.6, qn * n)), s = se(t.turn), a = (Yt + Lt * s) * n, h = o + et * n, f = a + t.lookX * 0.08 * n, g = t.lookY * 0.07 * n, p = [
|
|
560
560
|
// The left eye is on the far side; turning closes it up more than the near one.
|
|
561
|
-
{ x: -0.34 * n * (1 -
|
|
562
|
-
{ x: 0.34 * n * (1 -
|
|
561
|
+
{ x: -0.34 * n * (1 - St * s), squeeze: 1 - St * s, open: t.leftEye, brow: t.leftBrow, side: -1 },
|
|
562
|
+
{ x: 0.34 * n * (1 - Et * s), squeeze: 1 - Et * s, open: t.rightEye, brow: t.rightBrow, side: 1 }
|
|
563
563
|
];
|
|
564
|
-
e.fillStyle =
|
|
564
|
+
e.fillStyle = r, e.strokeStyle = r, e.lineWidth = i;
|
|
565
565
|
for (const m of p) {
|
|
566
|
-
const
|
|
567
|
-
if (
|
|
568
|
-
const
|
|
569
|
-
e.beginPath(), e.moveTo(m.x +
|
|
566
|
+
const w = Xt(m.open, t.blink);
|
|
567
|
+
if (w < 0.2) {
|
|
568
|
+
const k = t.smile > 0.5 ? -0.12 * n : 0.06 * n;
|
|
569
|
+
e.beginPath(), e.moveTo(m.x + a - 0.12 * n, h), e.quadraticCurveTo(m.x + a, h + k, m.x + a + 0.12 * n, h), e.stroke();
|
|
570
570
|
} else {
|
|
571
|
-
if (
|
|
572
|
-
const E = 0.13 * n *
|
|
573
|
-
e.beginPath(), e.ellipse(m.x +
|
|
571
|
+
if (w > 1.2) {
|
|
572
|
+
const E = 0.13 * n * w;
|
|
573
|
+
e.beginPath(), e.ellipse(m.x + a, h, E * 0.85, E, 0, 0, Math.PI * 2), e.fillStyle = "#ffffff", e.fill(), e.stroke(), e.fillStyle = r;
|
|
574
574
|
}
|
|
575
|
-
const
|
|
576
|
-
e.beginPath(), e.ellipse(m.x + f,
|
|
575
|
+
const k = w > 1.2 ? 0.075 * n : 0.1 * n;
|
|
576
|
+
e.beginPath(), e.ellipse(m.x + f, h + g, k, k * 1.1 * Math.min(w, 1), 0, 0, Math.PI * 2), e.fill();
|
|
577
577
|
}
|
|
578
|
-
const
|
|
579
|
-
e.beginPath(), e.moveTo(H,
|
|
578
|
+
const S = qt(h, n, m.brow, w), M = m.x + a - m.side * 0.13 * n * m.squeeze, H = m.x + a + m.side * 0.13 * n * m.squeeze;
|
|
579
|
+
e.beginPath(), e.moveTo(H, S), e.lineTo(M, S - t.browTilt * 0.1 * n), e.stroke();
|
|
580
580
|
}
|
|
581
|
-
const c =
|
|
581
|
+
const c = o + Dt * n, u = 0.25 * n * Math.max(0.3, t.mouthWidth) * (1 - Un * s), d = Math.min(1, Math.max(0, t.mouth));
|
|
582
582
|
if (e.beginPath(), d <= 0.05) {
|
|
583
|
-
e.moveTo(
|
|
583
|
+
e.moveTo(a - u, c), e.quadraticCurveTo(a, c + t.smile * 0.25 * n, a + u, c), e.stroke();
|
|
584
584
|
return;
|
|
585
585
|
}
|
|
586
586
|
const b = 0.3 * n * d;
|
|
587
|
-
t.smile > 0.3 ? (e.moveTo(
|
|
587
|
+
t.smile > 0.3 ? (e.moveTo(a - u, c - 0.05 * n), e.lineTo(a + u, c - 0.05 * n), e.quadraticCurveTo(a, c + b * 2, a - u, c - 0.05 * n)) : t.smile < -0.3 ? (e.moveTo(a - u, c + b * 0.6), e.lineTo(a + u, c + b * 0.6), e.quadraticCurveTo(a, c - b * 1.4, a - u, c + b * 0.6)) : e.ellipse(a, c, u * 0.8, b, 0, 0, Math.PI * 2), e.fill();
|
|
588
588
|
}
|
|
589
|
-
function
|
|
590
|
-
const n = t.height ?? 300,
|
|
591
|
-
const C = Math.max(-Math.PI / 2, Math.min(Math.PI / 2, Math.abs(Z(P -
|
|
592
|
-
return c ? { x: 0, y: 0 } : { x: Math.cos(C) *
|
|
589
|
+
function Ut(e, t) {
|
|
590
|
+
const n = t.height ?? 300, o = Math.min(3, Math.max(0.3, e.stretch ?? 1)), r = Math.sqrt(o), l = (t.headSize ?? 2 * Rt) / 2, i = t.headSize === void 0 ? Nn : 1 - 2 * l, s = l * n, a = se(e.sit), h = e.leftHip + (-ke - e.leftHip) * a, f = e.leftKnee + (-ke - e.leftKnee) * a, g = e.rightHip + (ke - e.rightHip) * a, p = e.rightKnee + (ke - e.rightKnee) * a, c = t.classic === !0, u = se(e.turn), d = (K, P, B, $, _) => {
|
|
591
|
+
const C = Math.max(-Math.PI / 2, Math.min(Math.PI / 2, Math.abs(Z(P - B) / 2) + Z($))), L = Math.max(-1, Math.min(1, Zn + _)), Q = u + (1 - u) * K * L;
|
|
592
|
+
return c ? { x: 0, y: 0 } : { x: Math.cos(C) * Mt * Q, y: Math.sin(C) * Mt };
|
|
593
593
|
}, b = { left: e.leftAnkle ?? 0, right: e.rightAnkle ?? 0 }, m = { left: e.leftFootOut ?? 0, right: e.rightFootOut ?? 0 };
|
|
594
|
-
let
|
|
595
|
-
if (
|
|
596
|
-
const K = (
|
|
597
|
-
K(-1,
|
|
598
|
-
K(1,
|
|
599
|
-
),
|
|
600
|
-
|
|
594
|
+
let w = 0;
|
|
595
|
+
if (a > 0 || !c) {
|
|
596
|
+
const K = (_, C, L, Q, ne) => Ve * Math.cos(Z(C)) + Pe * Math.cos(Z(C - L)) + Math.max(0, d(_, C, L, Q, ne).y), P = Math.max(
|
|
597
|
+
K(-1, h, f, b.left, m.left),
|
|
598
|
+
K(1, g, p, b.right, m.right)
|
|
599
|
+
), B = 1 - se((e.rise ?? 0) / ro), $ = (c ? Math.min(1, a / oo) : 1) * B;
|
|
600
|
+
w = (kt - P) * $ * n * o;
|
|
601
601
|
}
|
|
602
|
-
const
|
|
603
|
-
const C =
|
|
604
|
-
return { x: K + C.x *
|
|
605
|
-
}, I = (K, P,
|
|
606
|
-
const
|
|
607
|
-
return { root: { x: 0, y:
|
|
608
|
-
}, W = (K, P,
|
|
609
|
-
const
|
|
610
|
-
return { root:
|
|
611
|
-
},
|
|
612
|
-
const L = d(K,
|
|
613
|
-
return { x: P.end.x + L.x * n *
|
|
614
|
-
}, x = (K, P,
|
|
602
|
+
const S = -kt * n * o + w, M = -i * n * o + w, H = c ? 0 : (Vn * se(e.turn) + eo * a) * n * o, k = H === 0 ? [{ x: 0, y: S }, { x: 0, y: M }] : fe({ x: 0, y: S }, { x: -H, y: (S + M) / 2 }, { x: 0, y: M }, 1, 8), E = M + Cn * n * o, T = (t.shoulderWidth ?? 0) * n * Math.cos(u * Math.PI / 2), A = (K, P, B, $, _) => {
|
|
603
|
+
const C = lo(B, $);
|
|
604
|
+
return { x: K + C.x * _ * n, y: P + C.y * _ * n };
|
|
605
|
+
}, I = (K, P, B) => {
|
|
606
|
+
const $ = A(0, S, P, K, Ve * o);
|
|
607
|
+
return { root: { x: 0, y: S }, joint: $, end: A($.x, $.y, P - B, K, Pe * o) };
|
|
608
|
+
}, W = (K, P, B) => {
|
|
609
|
+
const $ = { x: K * T, y: E }, _ = A($.x, $.y, P, K, Dn * r);
|
|
610
|
+
return { root: $, joint: _, end: A(_.x, _.y, P + B, K, Xn * r) };
|
|
611
|
+
}, v = { left: I(-1, h, f), right: I(1, g, p) }, y = (K, P, B, $, _, C) => {
|
|
612
|
+
const L = d(K, B, $, _, C);
|
|
613
|
+
return { x: P.end.x + L.x * n * o, y: P.end.y + L.y * n * o };
|
|
614
|
+
}, x = (K, P, B, $, _) => A(P.end.x, P.end.y, B + $ + _, K, Nt * r), O = {
|
|
615
615
|
left: W(-1, e.leftShoulder, e.leftElbow),
|
|
616
616
|
right: W(1, e.rightShoulder, e.rightElbow)
|
|
617
617
|
};
|
|
618
618
|
return {
|
|
619
619
|
height: n,
|
|
620
620
|
facing: (t.facing ?? 1) < 0 ? -1 : 1,
|
|
621
|
-
stretch:
|
|
621
|
+
stretch: o,
|
|
622
622
|
lineWidth: t.lineWidth ?? n * 0.025,
|
|
623
|
-
rubber: Math.min(1, Math.max(c ? 0 :
|
|
623
|
+
rubber: Math.min(1, Math.max(c ? 0 : Qn, t.rubber ?? 0)),
|
|
624
624
|
r: s,
|
|
625
625
|
// The head keeps its area: taller and narrower when stretched.
|
|
626
|
-
headRx: s / Math.sqrt(
|
|
627
|
-
headRy: s * Math.sqrt(
|
|
628
|
-
hipY:
|
|
629
|
-
neckY:
|
|
630
|
-
drop:
|
|
631
|
-
lean: c ? e.lean : e.lean +
|
|
626
|
+
headRx: s / Math.sqrt(o),
|
|
627
|
+
headRy: s * Math.sqrt(o),
|
|
628
|
+
hipY: S,
|
|
629
|
+
neckY: M,
|
|
630
|
+
drop: w,
|
|
631
|
+
lean: c ? e.lean : e.lean + to * Math.sin(Math.PI * a),
|
|
632
632
|
classic: c,
|
|
633
|
-
legs:
|
|
633
|
+
legs: v,
|
|
634
634
|
toes: {
|
|
635
|
-
left: y(-1,
|
|
636
|
-
right: y(1,
|
|
635
|
+
left: y(-1, v.left, h, f, b.left, m.left),
|
|
636
|
+
right: y(1, v.right, g, p, b.right, m.right)
|
|
637
637
|
},
|
|
638
|
-
spine:
|
|
638
|
+
spine: k,
|
|
639
639
|
arms: O,
|
|
640
640
|
handTips: {
|
|
641
641
|
left: x(-1, O.left, e.leftShoulder, e.leftElbow, e.leftWrist ?? 0),
|
|
@@ -643,36 +643,36 @@ function Ct(e, t) {
|
|
|
643
643
|
}
|
|
644
644
|
};
|
|
645
645
|
}
|
|
646
|
-
const
|
|
647
|
-
function
|
|
648
|
-
const
|
|
649
|
-
return { x: t.x + l *
|
|
646
|
+
const ue = (e, t) => t === 0 ? [e.root, e.joint, e.end] : fe(e.root, e.joint, e.end, t);
|
|
647
|
+
function We(e, t, n) {
|
|
648
|
+
const o = Math.cos(n), r = Math.sin(n), l = e.x - t.x, i = e.y - t.y;
|
|
649
|
+
return { x: t.x + l * o - i * r, y: t.y + l * r + i * o };
|
|
650
650
|
}
|
|
651
|
-
function
|
|
652
|
-
const
|
|
653
|
-
return n && (
|
|
651
|
+
function zt(e, t, n = !0) {
|
|
652
|
+
const o = ao(e, t), r = t.spin ?? 0, l = t.rise ?? 0;
|
|
653
|
+
return n && (r !== 0 || l !== 0) ? io(o, e, r, l) : o;
|
|
654
654
|
}
|
|
655
|
-
function
|
|
655
|
+
function Gt(e, t, n) {
|
|
656
656
|
return { pivot: { x: 0, y: e.hipY }, angle: e.facing * Z(t), lift: n * e.height };
|
|
657
657
|
}
|
|
658
|
-
function
|
|
659
|
-
const { pivot:
|
|
660
|
-
const c =
|
|
658
|
+
function io(e, t, n, o) {
|
|
659
|
+
const { pivot: r, angle: l, lift: i } = Gt(t, n, o), s = (p) => {
|
|
660
|
+
const c = We(p, r, l);
|
|
661
661
|
return { x: c.x, y: c.y - i };
|
|
662
|
-
},
|
|
662
|
+
}, a = (p) => ({ left: s(p.left), right: s(p.right) }), h = { left: Math.max(s(e.feet.left).y, s(e.toes.left).y), right: Math.max(s(e.feet.right).y, s(e.toes.right).y) }, f = Math.max(h.left, h.right), g = Ct * t.height;
|
|
663
663
|
return {
|
|
664
664
|
...e,
|
|
665
665
|
hip: s(e.hip),
|
|
666
666
|
neck: s(e.neck),
|
|
667
|
-
shoulders:
|
|
668
|
-
elbows:
|
|
669
|
-
hands:
|
|
670
|
-
fingertips:
|
|
671
|
-
knees:
|
|
672
|
-
feet:
|
|
673
|
-
toes:
|
|
667
|
+
shoulders: a(e.shoulders),
|
|
668
|
+
elbows: a(e.elbows),
|
|
669
|
+
hands: a(e.hands),
|
|
670
|
+
fingertips: a(e.fingertips),
|
|
671
|
+
knees: a(e.knees),
|
|
672
|
+
feet: a(e.feet),
|
|
673
|
+
toes: a(e.toes),
|
|
674
674
|
feetY: f,
|
|
675
|
-
grounded: { left:
|
|
675
|
+
grounded: { left: h.left >= f - g, right: h.right >= f - g },
|
|
676
676
|
handAngle: { left: e.handAngle.left + l, right: e.handAngle.right + l },
|
|
677
677
|
limbs: {
|
|
678
678
|
leftArm: e.limbs.leftArm.map(s),
|
|
@@ -684,42 +684,42 @@ function to(e, t, n, r) {
|
|
|
684
684
|
head: { ...e.head, center: s(e.head.center), angle: e.head.angle + l }
|
|
685
685
|
};
|
|
686
686
|
}
|
|
687
|
-
function
|
|
688
|
-
const n = Z(e.lean),
|
|
689
|
-
const [H,
|
|
690
|
-
return f(H,
|
|
687
|
+
function ao(e, t) {
|
|
688
|
+
const n = Z(e.lean), o = Z(t.headTilt), r = { x: 0, y: e.hipY }, l = (S) => ({ x: e.facing * S.x, y: S.y }), i = (S) => l(We(S, r, n)), s = (S) => i(We({ x: S.x, y: S.y + e.neckY }, { x: 0, y: e.neckY }, o)), a = ue(e.arms.left, e.rubber).map(i), h = ue(e.arms.right, e.rubber).map(i), f = (S, M) => Math.atan2(M.y - S.y, M.x - S.x), g = { left: i(e.handTips.left), right: i(e.handTips.right) }, p = (S, M) => {
|
|
689
|
+
const [H, k] = S.slice(-2), E = e.arms[M], T = f(i(E.end), g[M]) - f(i(E.joint), i(E.end));
|
|
690
|
+
return f(H, k) + T;
|
|
691
691
|
};
|
|
692
692
|
let c = 1 / 0;
|
|
693
|
-
for (const [
|
|
693
|
+
for (const [S, M] of [
|
|
694
694
|
[t.leftBrow, t.leftEye],
|
|
695
695
|
[t.rightBrow, t.rightEye]
|
|
696
696
|
]) {
|
|
697
|
-
const H =
|
|
697
|
+
const H = qt(et, 1, S, Xt(M, t.blink));
|
|
698
698
|
c = Math.min(c, H, H - t.browTilt * 0.1);
|
|
699
699
|
}
|
|
700
|
-
const
|
|
700
|
+
const u = { left: l(e.legs.left.end), right: l(e.legs.right.end) }, d = { left: l(e.toes.left), right: l(e.toes.right) }, b = { left: Math.max(u.left.y, d.left.y), right: Math.max(u.right.y, d.right.y) }, m = Math.max(b.left, b.right), w = Ct * e.height;
|
|
701
701
|
return {
|
|
702
702
|
facing: e.facing,
|
|
703
703
|
height: e.height,
|
|
704
704
|
stretch: e.stretch,
|
|
705
705
|
lineWidth: e.lineWidth,
|
|
706
|
-
hip:
|
|
706
|
+
hip: r,
|
|
707
707
|
neck: i({ x: 0, y: e.neckY }),
|
|
708
708
|
shoulders: { left: i(e.arms.left.root), right: i(e.arms.right.root) },
|
|
709
709
|
elbows: { left: i(e.arms.left.joint), right: i(e.arms.right.joint) },
|
|
710
710
|
hands: { left: i(e.arms.left.end), right: i(e.arms.right.end) },
|
|
711
711
|
knees: { left: l(e.legs.left.joint), right: l(e.legs.right.joint) },
|
|
712
|
-
feet:
|
|
712
|
+
feet: u,
|
|
713
713
|
toes: d,
|
|
714
714
|
feetY: m,
|
|
715
|
-
grounded: { left: b.left >= m -
|
|
716
|
-
fingertips:
|
|
717
|
-
handAngle: { left: p(
|
|
715
|
+
grounded: { left: b.left >= m - w, right: b.right >= m - w },
|
|
716
|
+
fingertips: g,
|
|
717
|
+
handAngle: { left: p(a, "left"), right: p(h, "right") },
|
|
718
718
|
limbs: {
|
|
719
|
-
leftArm:
|
|
720
|
-
rightArm:
|
|
721
|
-
leftLeg:
|
|
722
|
-
rightLeg:
|
|
719
|
+
leftArm: a,
|
|
720
|
+
rightArm: h,
|
|
721
|
+
leftLeg: ue(e.legs.left, e.rubber).map(l),
|
|
722
|
+
rightLeg: ue(e.legs.right, e.rubber).map(l),
|
|
723
723
|
spine: e.spine.map(i)
|
|
724
724
|
},
|
|
725
725
|
head: {
|
|
@@ -727,242 +727,242 @@ function no(e, t) {
|
|
|
727
727
|
rx: e.headRx,
|
|
728
728
|
ry: e.headRy,
|
|
729
729
|
// Mirroring a turn reverses it.
|
|
730
|
-
angle: e.facing * (n +
|
|
731
|
-
eyeY:
|
|
730
|
+
angle: e.facing * (n + o),
|
|
731
|
+
eyeY: et,
|
|
732
732
|
browTopY: c,
|
|
733
|
-
mouthY:
|
|
734
|
-
faceX: e.facing * (
|
|
733
|
+
mouthY: Dt,
|
|
734
|
+
faceX: e.facing * (Yt + Lt * se(t.turn))
|
|
735
735
|
}
|
|
736
736
|
};
|
|
737
737
|
}
|
|
738
|
-
function
|
|
739
|
-
return
|
|
738
|
+
function ho(e, t = {}) {
|
|
739
|
+
return zt(Ut(e, t), e);
|
|
740
740
|
}
|
|
741
|
-
function
|
|
742
|
-
return
|
|
741
|
+
function Wr(e, t, n) {
|
|
742
|
+
return We({ x: e.center.x + t * e.rx, y: e.center.y + n * e.ry }, e.center, e.angle);
|
|
743
743
|
}
|
|
744
|
-
function
|
|
745
|
-
const
|
|
744
|
+
function fo(e, t, n) {
|
|
745
|
+
const o = (l) => ({ x: l.x + t, y: l.y + n }), r = (l) => ({ left: o(l.left), right: o(l.right) });
|
|
746
746
|
return {
|
|
747
747
|
...e,
|
|
748
|
-
hip:
|
|
749
|
-
neck:
|
|
750
|
-
shoulders:
|
|
751
|
-
elbows:
|
|
752
|
-
hands:
|
|
753
|
-
knees:
|
|
754
|
-
feet:
|
|
755
|
-
toes:
|
|
748
|
+
hip: o(e.hip),
|
|
749
|
+
neck: o(e.neck),
|
|
750
|
+
shoulders: r(e.shoulders),
|
|
751
|
+
elbows: r(e.elbows),
|
|
752
|
+
hands: r(e.hands),
|
|
753
|
+
knees: r(e.knees),
|
|
754
|
+
feet: r(e.feet),
|
|
755
|
+
toes: r(e.toes),
|
|
756
756
|
feetY: e.feetY + n,
|
|
757
757
|
grounded: { ...e.grounded },
|
|
758
758
|
handAngle: { ...e.handAngle },
|
|
759
759
|
limbs: {
|
|
760
|
-
leftArm: e.limbs.leftArm.map(
|
|
761
|
-
rightArm: e.limbs.rightArm.map(
|
|
762
|
-
leftLeg: e.limbs.leftLeg.map(
|
|
763
|
-
rightLeg: e.limbs.rightLeg.map(
|
|
764
|
-
spine: e.limbs.spine.map(
|
|
760
|
+
leftArm: e.limbs.leftArm.map(o),
|
|
761
|
+
rightArm: e.limbs.rightArm.map(o),
|
|
762
|
+
leftLeg: e.limbs.leftLeg.map(o),
|
|
763
|
+
rightLeg: e.limbs.rightLeg.map(o),
|
|
764
|
+
spine: e.limbs.spine.map(o)
|
|
765
765
|
},
|
|
766
|
-
head: { ...e.head, center:
|
|
766
|
+
head: { ...e.head, center: o(e.head.center) }
|
|
767
767
|
};
|
|
768
768
|
}
|
|
769
|
-
function
|
|
770
|
-
const
|
|
771
|
-
e.save(),
|
|
772
|
-
},
|
|
773
|
-
|
|
774
|
-
}, p = () => e.scale(
|
|
775
|
-
p(), e.translate(0,
|
|
776
|
-
},
|
|
777
|
-
if (
|
|
778
|
-
if (
|
|
779
|
-
e.beginPath(), e.moveTo(
|
|
780
|
-
for (const A of
|
|
769
|
+
function co(e, t, n = {}, o = 0) {
|
|
770
|
+
const r = Ut(t, n), l = n.color ?? "#1e293b", i = n.layers ?? {}, s = n.layers ? zt(r, t, !1) : void 0, a = n.sketch ? Ge(e, n.sketch, o) : void 0, h = n.sketch && n.layers ? Ge(e, n.sketch, o) : void 0, f = (k) => {
|
|
771
|
+
e.save(), k(), e.restore();
|
|
772
|
+
}, g = (k) => {
|
|
773
|
+
k && s && f(() => k(e, s, o, h));
|
|
774
|
+
}, p = () => e.scale(r.facing, 1), c = () => {
|
|
775
|
+
p(), e.translate(0, r.hipY), e.rotate(Z(r.lean)), e.translate(0, -r.hipY);
|
|
776
|
+
}, u = (k, E, T) => {
|
|
777
|
+
if (a) return E ? a.curve(k) : a.line(k);
|
|
778
|
+
if (r.classic) {
|
|
779
|
+
e.beginPath(), e.moveTo(k[0].x, k[0].y);
|
|
780
|
+
for (const A of k.slice(1)) e.lineTo(A.x, A.y);
|
|
781
781
|
e.stroke();
|
|
782
782
|
return;
|
|
783
783
|
}
|
|
784
|
-
|
|
785
|
-
}, d = (
|
|
786
|
-
|
|
787
|
-
}, m = (
|
|
788
|
-
if (n.hands && !
|
|
789
|
-
if (
|
|
790
|
-
const E =
|
|
791
|
-
e.beginPath(), e.arc(E.x, E.y,
|
|
784
|
+
lt(e, k, T[0] * r.lineWidth, T[1] * r.lineWidth);
|
|
785
|
+
}, d = (k, E) => u(ue(k, r.rubber), r.rubber > 0, E), b = (k) => {
|
|
786
|
+
r.classic || u([r.legs[k].end, r.toes[k]], !1, Jn);
|
|
787
|
+
}, m = (k) => {
|
|
788
|
+
if (n.hands && !r.classic) return S(k);
|
|
789
|
+
if (r.classic || a) return;
|
|
790
|
+
const E = r.arms[k].end;
|
|
791
|
+
e.beginPath(), e.arc(E.x, E.y, jn * r.lineWidth, 0, Math.PI * 2), e.fill();
|
|
792
792
|
};
|
|
793
|
-
e.save(), e.strokeStyle = l, e.fillStyle = l, e.lineWidth =
|
|
794
|
-
const
|
|
795
|
-
(
|
|
796
|
-
function k
|
|
797
|
-
const E = n.hands ?? {},
|
|
798
|
-
|
|
799
|
-
side:
|
|
793
|
+
e.save(), e.strokeStyle = l, e.fillStyle = l, e.lineWidth = r.lineWidth, e.lineCap = "round", e.lineJoin = "round";
|
|
794
|
+
const w = Gt(r, t.spin ?? 0, t.rise ?? 0);
|
|
795
|
+
(w.angle !== 0 || w.lift !== 0) && (e.translate(0, -w.lift), e.translate(w.pivot.x, w.pivot.y), e.rotate(w.angle), e.translate(-w.pivot.x, -w.pivot.y));
|
|
796
|
+
function S(k) {
|
|
797
|
+
const E = n.hands ?? {}, T = r.arms[k].end, A = r.handTips[k], I = n.headFill ?? "#ffffff";
|
|
798
|
+
st(e, T, E[k] ?? R, {
|
|
799
|
+
side: k,
|
|
800
800
|
// Degrees clockwise from straight up, in the frame the hand is drawn in.
|
|
801
|
-
angle: Math.atan2(A.x -
|
|
802
|
-
size: (E.size ??
|
|
801
|
+
angle: Math.atan2(A.x - T.x, T.y - A.y) * 180 / Math.PI,
|
|
802
|
+
size: (E.size ?? Nt) * r.height * Math.sqrt(r.stretch),
|
|
803
803
|
skin: E.skin ?? (I === "none" ? void 0 : I),
|
|
804
804
|
ink: l,
|
|
805
|
-
lineWidth:
|
|
805
|
+
lineWidth: r.lineWidth * 0.45,
|
|
806
806
|
fingers: E.fingers,
|
|
807
807
|
plump: E.plump,
|
|
808
808
|
look: n.sketch ? "pencil" : "clean",
|
|
809
809
|
seed: n.sketch?.seed
|
|
810
|
-
},
|
|
810
|
+
}, o);
|
|
811
811
|
}
|
|
812
|
-
const
|
|
812
|
+
const M = (k) => {
|
|
813
813
|
f(() => {
|
|
814
|
-
c(), d(
|
|
814
|
+
c(), d(r.arms[k], Gn), m(k);
|
|
815
815
|
});
|
|
816
816
|
const E = i.sleeve;
|
|
817
|
-
E && s && f(() => E(e, s,
|
|
818
|
-
}, H = se(t.turn) >
|
|
819
|
-
|
|
820
|
-
p(), d(
|
|
821
|
-
}), H &&
|
|
822
|
-
c(),
|
|
823
|
-
const { left:
|
|
824
|
-
if (
|
|
825
|
-
if (
|
|
817
|
+
E && s && f(() => E(e, s, k, o, h));
|
|
818
|
+
}, H = se(t.turn) > no;
|
|
819
|
+
g(i.behind), f(() => {
|
|
820
|
+
p(), d(r.legs.left, Ht), b("left"), d(r.legs.right, Ht), b("right");
|
|
821
|
+
}), H && M("left"), f(() => {
|
|
822
|
+
c(), u(r.spine, r.spine.length > 2, zn);
|
|
823
|
+
const { left: k, right: E } = { left: r.arms.left.root, right: r.arms.right.root };
|
|
824
|
+
if (k.x !== E.x)
|
|
825
|
+
if (r.classic) u([k, E], !1, [1, 1]);
|
|
826
826
|
else {
|
|
827
|
-
const
|
|
828
|
-
|
|
827
|
+
const T = { x: (k.x + E.x) / 2, y: k.y - 0.3 * Math.abs(E.x - k.x) };
|
|
828
|
+
u(fe(k, T, E, 1, 8), !0, [1.1, 1.1]);
|
|
829
829
|
}
|
|
830
|
-
}),
|
|
831
|
-
c(), e.translate(0,
|
|
832
|
-
const
|
|
833
|
-
e.beginPath(), e.ellipse(0,
|
|
830
|
+
}), g(i.body), H || M("left"), M("right"), g(i.behindHead), f(() => {
|
|
831
|
+
c(), e.translate(0, r.neckY), e.rotate(Z(t.headTilt));
|
|
832
|
+
const k = -r.headRy;
|
|
833
|
+
e.beginPath(), e.ellipse(0, k, r.headRx, r.headRy, 0, 0, Math.PI * 2);
|
|
834
834
|
const E = n.headFill ?? "#ffffff";
|
|
835
|
-
if (E !== "none" && (e.fillStyle = E, e.fill()),
|
|
836
|
-
|
|
837
|
-
const
|
|
838
|
-
e.translate(
|
|
835
|
+
if (E !== "none" && (e.fillStyle = E, e.fill()), a) {
|
|
836
|
+
a.ellipse(0, k, r.headRx, r.headRy);
|
|
837
|
+
const T = a.nudge();
|
|
838
|
+
e.translate(T.x, T.y);
|
|
839
839
|
} else
|
|
840
840
|
e.stroke();
|
|
841
|
-
e.translate(0,
|
|
842
|
-
}),
|
|
841
|
+
e.translate(0, k), e.scale(r.headRx / r.r, r.headRy / r.r), so(e, t, r.r, 0, l, r.lineWidth);
|
|
842
|
+
}), g(i.overHead), g(i.front), e.restore(), n.label && (e.save(), e.fillStyle = l, e.font = n.labelFont ?? `700 ${Math.round(r.height * 0.11)}px sans-serif`, e.textAlign = "center", e.textBaseline = "bottom", e.fillText(n.label, 0, -r.height * r.stretch - 0.04 * r.height + r.drop), e.restore());
|
|
843
843
|
}
|
|
844
|
-
function
|
|
845
|
-
const
|
|
846
|
-
let
|
|
844
|
+
function Jt(e, t, n) {
|
|
845
|
+
const o = { ...e };
|
|
846
|
+
let r = e.walking > 0 ? we(o, Yn(e.walk, o), e.walking) : o, l = uo(e);
|
|
847
847
|
const i = e.dancing ?? 0;
|
|
848
848
|
if (n && i > 0) {
|
|
849
849
|
const s = n(e.beat ?? 0);
|
|
850
|
-
if (
|
|
851
|
-
const
|
|
852
|
-
l = { left:
|
|
850
|
+
if (r = we(r, s.pose, i), s.hands) {
|
|
851
|
+
const a = (h, f) => f ? ye(h ?? R, f, i) : h;
|
|
852
|
+
l = { left: a(l?.left, s.hands.left), right: a(l?.right, s.hands.right) };
|
|
853
853
|
}
|
|
854
854
|
}
|
|
855
|
-
return e.talk > 0 && (
|
|
855
|
+
return e.talk > 0 && (r = { ...r, mouth: Math.max(r.mouth, e.talk * Ln(t)) }), { pose: r, hands: l };
|
|
856
856
|
}
|
|
857
|
-
function
|
|
858
|
-
return
|
|
857
|
+
function go(e, t, n) {
|
|
858
|
+
return Jt(e, t, n).pose;
|
|
859
859
|
}
|
|
860
|
-
const
|
|
861
|
-
function
|
|
862
|
-
const t = (
|
|
863
|
-
if (typeof e[
|
|
864
|
-
return Object.fromEntries(Object.keys(R).map((l) => [l, e[
|
|
865
|
-
}, n = t("left"),
|
|
866
|
-
return n ||
|
|
860
|
+
const Oe = (e, t) => `hand.${e}.${t}`;
|
|
861
|
+
function uo(e) {
|
|
862
|
+
const t = (r) => {
|
|
863
|
+
if (typeof e[Oe(r, "spread")] == "number")
|
|
864
|
+
return Object.fromEntries(Object.keys(R).map((l) => [l, e[Oe(r, l)]]));
|
|
865
|
+
}, n = t("left"), o = t("right");
|
|
866
|
+
return n || o ? { left: n, right: o } : void 0;
|
|
867
867
|
}
|
|
868
|
-
function
|
|
868
|
+
function po(e, t) {
|
|
869
869
|
return !t || !e.hands ? e : { ...e, hands: { ...e.hands, left: t.left ?? e.hands.left, right: t.right ?? e.hands.right } };
|
|
870
870
|
}
|
|
871
|
-
function
|
|
872
|
-
const t = e.style ?? {}, n = t.height ?? 300,
|
|
871
|
+
function Or(e) {
|
|
872
|
+
const t = e.style ?? {}, n = t.height ?? 300, o = n * 0.8, r = { ...D(e.pose ?? {}), walk: 0, walking: 0, talk: 0, rubber: t.rubber ?? 0, beat: 0, dancing: 0 }, l = {};
|
|
873
873
|
if (t.hands)
|
|
874
874
|
for (const i of ["left", "right"]) {
|
|
875
875
|
const s = t.hands[i] ?? R;
|
|
876
|
-
for (const
|
|
876
|
+
for (const a of Object.keys(R)) l[Oe(i, a)] = s[a] ?? R[a];
|
|
877
877
|
}
|
|
878
878
|
return {
|
|
879
879
|
type: "custom",
|
|
880
|
-
x: e.x -
|
|
880
|
+
x: e.x - o / 2,
|
|
881
881
|
y: e.y - n,
|
|
882
|
-
width:
|
|
882
|
+
width: o,
|
|
883
883
|
height: n,
|
|
884
|
-
props: { ...
|
|
884
|
+
props: { ...r, ...l },
|
|
885
885
|
figureStyle: t,
|
|
886
886
|
figureDance: e.dance,
|
|
887
|
-
draw(i, s,
|
|
888
|
-
const
|
|
889
|
-
i.translate(
|
|
887
|
+
draw(i, s, a) {
|
|
888
|
+
const h = s.props, f = Jt(h, a, e.dance);
|
|
889
|
+
i.translate(o / 2, n), co(i, f.pose, po({ ...t, rubber: h.rubber }, f.hands), a);
|
|
890
890
|
}
|
|
891
891
|
};
|
|
892
892
|
}
|
|
893
|
-
function
|
|
894
|
-
const
|
|
895
|
-
if (!
|
|
896
|
-
const
|
|
893
|
+
function Ir(e, t, n) {
|
|
894
|
+
const o = e.figureStyle;
|
|
895
|
+
if (!o) throw new Error("stickFigureAt: the target was not made by stickFigureTarget");
|
|
896
|
+
const r = { ...e.props };
|
|
897
897
|
let l = 0, i = 0;
|
|
898
|
-
for (const [
|
|
899
|
-
typeof f == "number" && (
|
|
900
|
-
const s =
|
|
901
|
-
return { pose: s, joints:
|
|
898
|
+
for (const [h, f] of t.state?.values.get(n) ?? [])
|
|
899
|
+
typeof f == "number" && (h === "x" || h === "motionPathX" ? l = f : h === "y" || h === "motionPathY" ? i = f : h in r && (r[h] = f));
|
|
900
|
+
const s = go(r, t.time, e.figureDance), a = ho(s, { ...o, rubber: r.rubber });
|
|
901
|
+
return { pose: s, joints: fo(a, e.x + l + e.width / 2, e.y + i + e.height) };
|
|
902
902
|
}
|
|
903
|
-
function
|
|
903
|
+
function $r(e, t) {
|
|
904
904
|
const n = [];
|
|
905
|
-
return t.forEach((
|
|
906
|
-
const l =
|
|
907
|
-
n.push(
|
|
908
|
-
}),
|
|
909
|
-
id: `${e}-${
|
|
905
|
+
return t.forEach((o, r) => {
|
|
906
|
+
const l = r === 0 ? z : n[r - 1], i = typeof o.pose == "string" ? Fn[o.pose] : { ...l, ...o.pose };
|
|
907
|
+
n.push(o.expression ? _t(i, o.expression) : i);
|
|
908
|
+
}), Ft.filter((o) => n.some((r) => r[o] !== z[o])).map((o) => ({
|
|
909
|
+
id: `${e}-${o}`,
|
|
910
910
|
target: e,
|
|
911
|
-
property:
|
|
912
|
-
keyframes: t.map((
|
|
913
|
-
time:
|
|
914
|
-
value: n[l][
|
|
915
|
-
...
|
|
911
|
+
property: o,
|
|
912
|
+
keyframes: t.map((r, l) => ({
|
|
913
|
+
time: r.time,
|
|
914
|
+
value: n[l][o],
|
|
915
|
+
...r.easing ? { easing: r.easing } : {}
|
|
916
916
|
}))
|
|
917
917
|
}));
|
|
918
918
|
}
|
|
919
|
-
const
|
|
919
|
+
const Ye = 0.5, vt = {
|
|
920
920
|
/** Flag: fingers together and straight, thumb bent in */
|
|
921
|
-
pataka:
|
|
921
|
+
pataka: F({ "thumb.curl": 0.3, "thumb.across": 0.6, "index.curl": 0, "middle.curl": 0, "ring.curl": 0, "pinky.curl": 0, spread: 0, turn: 2 }),
|
|
922
922
|
/** Pataka with the ring finger bent */
|
|
923
|
-
tripataka:
|
|
923
|
+
tripataka: F({ "thumb.curl": 0.3, "thumb.across": 0.6, "index.curl": 0, "middle.curl": 0, "ring.curl": 1, "pinky.curl": 0, spread: 0, turn: 2 }),
|
|
924
924
|
/** Lotus in bloom: fingers fanned, each a little more curled than the last */
|
|
925
|
-
alapadma:
|
|
925
|
+
alapadma: F({ "thumb.curl": 0.1, "thumb.across": 0, "index.curl": 0.05, "middle.curl": 0.15, "ring.curl": 0.25, "pinky.curl": 0.35, spread: 1, turn: 2 }),
|
|
926
926
|
/** Fist */
|
|
927
927
|
mushti: N.fist,
|
|
928
928
|
/** Fist, thumb up */
|
|
929
929
|
shikhara: N.thumbsUp,
|
|
930
930
|
/** Swan's beak: thumb and index touch, the others fanned */
|
|
931
|
-
hamsasya:
|
|
931
|
+
hamsasya: F({ "thumb.curl": 0.15, "thumb.across": 0.6, "index.curl": 0.6, "middle.curl": 0, "ring.curl": 0, "pinky.curl": 0, spread: 0.7, turn: 2 }),
|
|
932
932
|
/** Bracelet: thumb, index and middle meet, ring and little finger out */
|
|
933
|
-
katakamukha:
|
|
933
|
+
katakamukha: F({ "thumb.curl": 0.2, "thumb.across": 0.6, "index.curl": 0.65, "middle.curl": 0.7, "ring.curl": 0, "pinky.curl": 0, spread: 0.4, turn: 2 })
|
|
934
934
|
};
|
|
935
|
-
function
|
|
936
|
-
return typeof e != "string" ? e : e in
|
|
935
|
+
function Ie(e) {
|
|
936
|
+
return typeof e != "string" ? e : e in vt ? vt[e] : N[e];
|
|
937
937
|
}
|
|
938
|
-
function
|
|
939
|
-
const
|
|
940
|
-
for (const
|
|
941
|
-
const l =
|
|
942
|
-
|
|
943
|
-
beat:
|
|
944
|
-
pose: { ...i.pose, ...
|
|
945
|
-
left:
|
|
946
|
-
right:
|
|
947
|
-
easing:
|
|
938
|
+
function Zt(e, t, n) {
|
|
939
|
+
const o = [];
|
|
940
|
+
for (const r of e.keys) {
|
|
941
|
+
const l = o[o.length - 1], i = !l || r.reset ? { pose: t, ...n } : l;
|
|
942
|
+
o.push({
|
|
943
|
+
beat: r.beat,
|
|
944
|
+
pose: { ...i.pose, ...r.pose },
|
|
945
|
+
left: r.hands?.left ? Ie(r.hands.left) : i.left,
|
|
946
|
+
right: r.hands?.right ? Ie(r.hands.right) : i.right,
|
|
947
|
+
easing: r.easing ?? e.easing
|
|
948
948
|
});
|
|
949
949
|
}
|
|
950
|
-
return
|
|
951
|
-
}
|
|
952
|
-
const
|
|
953
|
-
function
|
|
954
|
-
const
|
|
955
|
-
if (
|
|
956
|
-
const l =
|
|
957
|
-
let i =
|
|
958
|
-
for (let c = 0; c <
|
|
959
|
-
const s =
|
|
950
|
+
return o;
|
|
951
|
+
}
|
|
952
|
+
const it = (e, t) => (e % t + t) % t;
|
|
953
|
+
function bo(e, t, n, o) {
|
|
954
|
+
const r = Zt(e, n, o);
|
|
955
|
+
if (r.length === 0) return { pose: n, hands: o };
|
|
956
|
+
const l = it(t, e.beats);
|
|
957
|
+
let i = r.length - 1;
|
|
958
|
+
for (let c = 0; c < r.length; c++) r[c].beat <= l && (i = c);
|
|
959
|
+
const s = r[i], a = r[(i + 1) % r.length], h = s.beat <= l ? s.beat : s.beat - e.beats, f = a.beat > h ? a.beat : a.beat + e.beats, g = f > h ? (l - h) / (f - h) : 0, p = _e(a.easing ?? "ease-in-out")(Math.min(1, Math.max(0, g)));
|
|
960
960
|
return {
|
|
961
|
-
pose:
|
|
962
|
-
hands: { left:
|
|
961
|
+
pose: we(s.pose, a.pose, p),
|
|
962
|
+
hands: { left: ye(s.left, a.left, p), right: ye(s.right, a.right, p) }
|
|
963
963
|
};
|
|
964
964
|
}
|
|
965
|
-
const
|
|
965
|
+
const mo = [
|
|
966
966
|
["leftShoulder", "rightShoulder"],
|
|
967
967
|
["leftElbow", "rightElbow"],
|
|
968
968
|
["leftWrist", "rightWrist"],
|
|
@@ -972,19 +972,19 @@ const co = [
|
|
|
972
972
|
["leftFootOut", "rightFootOut"],
|
|
973
973
|
["leftEye", "rightEye"],
|
|
974
974
|
["leftBrow", "rightBrow"]
|
|
975
|
-
],
|
|
976
|
-
function
|
|
975
|
+
], yo = ["lean", "headTilt", "lookX", "spin"], wo = /* @__PURE__ */ new Set(["leftShoulder", "rightShoulder", "leftElbow", "rightElbow", "leftWrist", "rightWrist", "leftHip", "rightHip", "leftKnee", "rightKnee"]);
|
|
976
|
+
function ko(e) {
|
|
977
977
|
const t = { ...e }, n = (e.turn ?? 0) >= 0.5;
|
|
978
|
-
for (const [
|
|
979
|
-
const l = n &&
|
|
980
|
-
t[
|
|
978
|
+
for (const [o, r] of mo) {
|
|
979
|
+
const l = n && wo.has(o) ? -1 : 1;
|
|
980
|
+
t[o] = l * e[r], t[r] = l * e[o];
|
|
981
981
|
}
|
|
982
|
-
if (!n) for (const
|
|
982
|
+
if (!n) for (const o of yo) t[o] = -e[o];
|
|
983
983
|
return t;
|
|
984
984
|
}
|
|
985
|
-
const
|
|
986
|
-
function
|
|
987
|
-
const
|
|
985
|
+
const So = (e) => Math.min(1, Math.max(-1, (0.5 - e) * 4));
|
|
986
|
+
function Eo(e, t, n) {
|
|
987
|
+
const o = it(n, 1), r = (1 + Math.cos(2 * Math.PI * o)) / 2, l = t.bounce * (t.accent === "up" ? 1 - r : r), i = Math.min(1, Math.max(0, e.turn ?? 0)), s = So(i);
|
|
988
988
|
return {
|
|
989
989
|
...e,
|
|
990
990
|
leftHip: e.leftHip + s * l / 2,
|
|
@@ -994,81 +994,129 @@ function mo(e, t, n) {
|
|
|
994
994
|
lean: e.lean + (t.sway ?? 0) * (1 - i) * Math.sin(Math.PI * n)
|
|
995
995
|
};
|
|
996
996
|
}
|
|
997
|
-
function
|
|
997
|
+
function tt(e) {
|
|
998
998
|
const t = { ...z, ...e.stance };
|
|
999
|
-
return e.expression ?
|
|
999
|
+
return e.expression ? _t(t, e.expression) : t;
|
|
1000
1000
|
}
|
|
1001
|
-
function
|
|
1001
|
+
function jt(e) {
|
|
1002
1002
|
return {
|
|
1003
|
-
left: e.hands?.left ?
|
|
1004
|
-
right: e.hands?.right ?
|
|
1003
|
+
left: e.hands?.left ? Ie(e.hands.left) : R,
|
|
1004
|
+
right: e.hands?.right ? Ie(e.hands.right) : R
|
|
1005
1005
|
};
|
|
1006
1006
|
}
|
|
1007
|
-
function
|
|
1008
|
-
const
|
|
1009
|
-
if (!
|
|
1010
|
-
const
|
|
1011
|
-
return t.mirror ? { pose:
|
|
1007
|
+
function Le(e, t, n) {
|
|
1008
|
+
const o = e.moves[t.move];
|
|
1009
|
+
if (!o) throw new Error(`dance: "${e.label}" has no move "${t.move}"`);
|
|
1010
|
+
const r = bo(o, n, tt(e), jt(e));
|
|
1011
|
+
return t.mirror ? { pose: ko(r.pose), hands: { left: r.hands?.right, right: r.hands?.left } } : r;
|
|
1012
1012
|
}
|
|
1013
|
-
function
|
|
1014
|
-
const
|
|
1015
|
-
let
|
|
1013
|
+
function at(e, t, n = {}) {
|
|
1014
|
+
const o = typeof e == "string" ? ce[e] : e;
|
|
1015
|
+
let r;
|
|
1016
1016
|
if (n.move)
|
|
1017
|
-
|
|
1017
|
+
r = Le(o, { move: n.move, mirror: n.mirror }, t);
|
|
1018
1018
|
else {
|
|
1019
|
-
const l =
|
|
1020
|
-
let
|
|
1021
|
-
for (;
|
|
1022
|
-
const f = s -
|
|
1023
|
-
if (
|
|
1024
|
-
const
|
|
1025
|
-
|
|
1026
|
-
pose:
|
|
1027
|
-
hands: { left:
|
|
1019
|
+
const l = o.routine, i = l.reduce((g, p) => g + p.beats, 0), s = it(t, i);
|
|
1020
|
+
let a = 0, h = 0;
|
|
1021
|
+
for (; h < l.length - 1 && s >= a + l[h].beats; ) a += l[h++].beats;
|
|
1022
|
+
const f = s - a;
|
|
1023
|
+
if (r = Le(o, l[h], f), f < Ye && l.length > 1 && t >= Ye) {
|
|
1024
|
+
const g = l[(h - 1 + l.length) % l.length], p = Le(o, g, g.beats + f), c = _e("ease-in-out")(f / Ye);
|
|
1025
|
+
r = {
|
|
1026
|
+
pose: we(p.pose, r.pose, c),
|
|
1027
|
+
hands: { left: ye(p.hands.left, r.hands.left, c), right: ye(p.hands.right, r.hands.right, c) }
|
|
1028
1028
|
};
|
|
1029
1029
|
}
|
|
1030
1030
|
}
|
|
1031
|
-
return { ...
|
|
1031
|
+
return { ...r, pose: Eo(r.pose, o.groove, t) };
|
|
1032
1032
|
}
|
|
1033
|
-
function
|
|
1034
|
-
return
|
|
1033
|
+
function Br(e, t, n = {}) {
|
|
1034
|
+
return at(e, t, n).pose;
|
|
1035
1035
|
}
|
|
1036
|
-
function
|
|
1037
|
-
return (typeof e == "string" ?
|
|
1036
|
+
function ht(e) {
|
|
1037
|
+
return (typeof e == "string" ? ce[e] : e).routine.reduce((n, o) => n + o.beats, 0);
|
|
1038
1038
|
}
|
|
1039
|
-
const
|
|
1040
|
-
function
|
|
1039
|
+
const Ho = { leftToe: "rightToe", rightToe: "leftToe", leftHeel: "rightHeel", rightHeel: "leftHeel" };
|
|
1040
|
+
function Tt(e, t, n, o, r, l, i) {
|
|
1041
1041
|
for (let s = 0; s * e.beats < n; s++)
|
|
1042
|
-
for (const
|
|
1043
|
-
const
|
|
1044
|
-
if (!(
|
|
1045
|
-
for (const
|
|
1042
|
+
for (const a of e.keys) {
|
|
1043
|
+
const h = s * e.beats + a.beat, f = t + h;
|
|
1044
|
+
if (!(h >= n || f < l || f >= i))
|
|
1045
|
+
for (const g of a.taps ?? []) r.push({ beat: f, tap: o ? Ho[g] : g });
|
|
1046
1046
|
}
|
|
1047
1047
|
}
|
|
1048
|
-
function
|
|
1049
|
-
const
|
|
1048
|
+
function _r(e, t, n, o = {}) {
|
|
1049
|
+
const r = typeof e == "string" ? ce[e] : e, l = [];
|
|
1050
1050
|
if (n <= t) return l;
|
|
1051
|
-
if (
|
|
1052
|
-
const i =
|
|
1053
|
-
|
|
1051
|
+
if (o.move) {
|
|
1052
|
+
const i = r.moves[o.move], s = Math.floor(t / i.beats) * i.beats;
|
|
1053
|
+
Tt(i, s, Math.ceil((n - s) / i.beats) * i.beats, o.mirror, l, t, n);
|
|
1054
1054
|
} else {
|
|
1055
|
-
const i =
|
|
1055
|
+
const i = ht(r);
|
|
1056
1056
|
for (let s = Math.floor(t / i) * i; s < n; s += i) {
|
|
1057
|
-
let
|
|
1058
|
-
for (const
|
|
1059
|
-
|
|
1057
|
+
let a = s;
|
|
1058
|
+
for (const h of r.routine)
|
|
1059
|
+
Tt(r.moves[h.move], a, h.beats, h.mirror, l, t, n), a += h.beats;
|
|
1060
1060
|
}
|
|
1061
1061
|
}
|
|
1062
1062
|
return l.sort((i, s) => i.beat - s.beat);
|
|
1063
1063
|
}
|
|
1064
|
-
function
|
|
1064
|
+
function xt(e, t) {
|
|
1065
|
+
const n = e.moves[t.move];
|
|
1066
|
+
if (!n?.travel) return 0;
|
|
1067
|
+
const o = n.travel / n.beats;
|
|
1068
|
+
return t.mirror ? (Zt(n, tt(e), jt(e))[0]?.pose.turn ?? tt(e).turn ?? 0) >= 0.5 ? o : -o : o;
|
|
1069
|
+
}
|
|
1070
|
+
function Qt(e, t) {
|
|
1071
|
+
return t.move ? [{ move: t.move, beats: e.moves[t.move].beats, mirror: t.mirror }] : e.routine;
|
|
1072
|
+
}
|
|
1073
|
+
function Ne(e, t, n = {}) {
|
|
1074
|
+
const o = typeof e == "string" ? ce[e] : e, r = Qt(o, n), l = r.reduce((f, g) => f + g.beats, 0), i = r.reduce((f, g) => f + xt(o, g) * g.beats, 0), s = Math.floor(t / l);
|
|
1075
|
+
let a = s * i, h = t - s * l;
|
|
1076
|
+
for (const f of r) {
|
|
1077
|
+
const g = Math.min(f.beats, h);
|
|
1078
|
+
if (a += xt(o, f) * g, h -= g, h <= 0) break;
|
|
1079
|
+
}
|
|
1080
|
+
return a;
|
|
1081
|
+
}
|
|
1082
|
+
function Mo(e, t, n) {
|
|
1083
|
+
const o = Qt(e, n), r = [0];
|
|
1084
|
+
let l = 0;
|
|
1085
|
+
for (let i = 0; l < t; i = (i + 1) % o.length)
|
|
1086
|
+
l += o[i].beats, r.push(Math.min(l, t));
|
|
1087
|
+
return r;
|
|
1088
|
+
}
|
|
1089
|
+
const vo = 8;
|
|
1090
|
+
function To(e, t, n) {
|
|
1091
|
+
const o = typeof t == "string" ? ce[t] : t, r = n.bpm ?? o.bpm, l = n.beats ?? (n.move ? o.moves[n.move].beats : ht(o)), i = Mo(o, l, n);
|
|
1092
|
+
if (i.every((m) => Ne(o, m, n) === 0)) return;
|
|
1093
|
+
const s = Math.min(n.fade ?? 1, l / 2), a = _e("ease-in-out"), h = (m) => s <= 0 ? 1 : Math.min(a(Math.min(1, m / s)), a(Math.min(1, (l - m) / s))), f = Math.ceil(s * vo), g = s <= 0 ? [] : Array.from({ length: f + 1 }, (m, w) => [w / f * s, l - w / f * s]).flat(), p = [.../* @__PURE__ */ new Set([...i, ...g])].sort((m, w) => m - w);
|
|
1094
|
+
let c = 0;
|
|
1095
|
+
const u = p.map((m, w) => {
|
|
1096
|
+
if (w > 0) {
|
|
1097
|
+
const S = p[w - 1], M = Math.max(1, Math.ceil((m - S) * 16));
|
|
1098
|
+
for (let H = 0; H < M; H++) {
|
|
1099
|
+
const k = S + (m - S) * H / M, E = S + (m - S) * (H + 1) / M;
|
|
1100
|
+
c += (Ne(o, E, n) - Ne(o, k, n)) * h((k + E) / 2);
|
|
1101
|
+
}
|
|
1102
|
+
}
|
|
1103
|
+
return { beat: m, travel: c };
|
|
1104
|
+
}), d = n.start ?? 0, b = n.x ?? 0;
|
|
1105
|
+
return {
|
|
1106
|
+
id: `${e}-x`,
|
|
1107
|
+
target: e,
|
|
1108
|
+
property: "x",
|
|
1109
|
+
keyframes: u.map((m) => ({ time: d + m.beat * 6e4 / r, value: b + n.height * m.travel, easing: "linear" }))
|
|
1110
|
+
};
|
|
1111
|
+
}
|
|
1112
|
+
function Fr(e, t, n = 0) {
|
|
1065
1113
|
return (e - n) * t / 6e4;
|
|
1066
1114
|
}
|
|
1067
|
-
function
|
|
1068
|
-
return (n) =>
|
|
1115
|
+
function Rr(e, t = {}) {
|
|
1116
|
+
return (n) => at(e, n, t);
|
|
1069
1117
|
}
|
|
1070
|
-
function
|
|
1071
|
-
const n = t.start ?? 0,
|
|
1118
|
+
function Yr(e, t) {
|
|
1119
|
+
const n = t.start ?? 0, o = 6e4 / t.bpm, r = n + t.beats * o, l = Math.min((t.fade ?? 1) * o, (r - n) / 2);
|
|
1072
1120
|
return [
|
|
1073
1121
|
{
|
|
1074
1122
|
id: `${e}-beat`,
|
|
@@ -1076,7 +1124,7 @@ function Wr(e, t) {
|
|
|
1076
1124
|
property: "beat",
|
|
1077
1125
|
keyframes: [
|
|
1078
1126
|
{ time: n, value: 0 },
|
|
1079
|
-
{ time:
|
|
1127
|
+
{ time: r, value: t.beats, easing: "linear" }
|
|
1080
1128
|
]
|
|
1081
1129
|
},
|
|
1082
1130
|
{
|
|
@@ -1086,32 +1134,32 @@ function Wr(e, t) {
|
|
|
1086
1134
|
keyframes: [
|
|
1087
1135
|
{ time: n, value: 0 },
|
|
1088
1136
|
{ time: n + l, value: 1, easing: "ease-in-out" },
|
|
1089
|
-
{ time:
|
|
1090
|
-
{ time:
|
|
1137
|
+
{ time: r - l, value: 1 },
|
|
1138
|
+
{ time: r, value: 0, easing: "ease-in-out" }
|
|
1091
1139
|
]
|
|
1092
1140
|
}
|
|
1093
1141
|
];
|
|
1094
1142
|
}
|
|
1095
|
-
function
|
|
1096
|
-
const
|
|
1097
|
-
const
|
|
1098
|
-
return { time: s +
|
|
1099
|
-
}), f = (
|
|
1100
|
-
id: `${e}-${
|
|
1143
|
+
function Lr(e, t, n = {}) {
|
|
1144
|
+
const o = typeof t == "string" ? ce[t] : t, r = n.bpm ?? o.bpm, l = n.beats ?? (n.move ? o.moves[n.move].beats : ht(o)), i = n.samplesPerBeat ?? 4, s = n.start ?? 0, a = Math.round(l * i), h = Array.from({ length: a + 1 }, (d, b) => {
|
|
1145
|
+
const m = b / i;
|
|
1146
|
+
return { time: s + m * 6e4 / r, frame: at(o, m, n) };
|
|
1147
|
+
}), f = (d, b) => ({
|
|
1148
|
+
id: `${e}-${d}`,
|
|
1101
1149
|
target: e,
|
|
1102
|
-
property:
|
|
1103
|
-
keyframes:
|
|
1104
|
-
}), p = Object.keys(z).filter((
|
|
1105
|
-
if (n.hands === !1) return p;
|
|
1106
|
-
const
|
|
1107
|
-
for (const
|
|
1108
|
-
for (const
|
|
1109
|
-
const
|
|
1110
|
-
|
|
1150
|
+
property: d,
|
|
1151
|
+
keyframes: h.map((m) => ({ time: m.time, value: b(m.frame) }))
|
|
1152
|
+
}), p = Object.keys(z).filter((d) => h.some((b) => b.frame.pose[d] !== h[0].frame.pose[d]) || h[0].frame.pose[d] !== z[d]).map((d) => f(d, (b) => b.pose[d])), c = n.height === void 0 ? void 0 : To(e, o, { ...n, bpm: r, beats: l, start: s, height: n.height, fade: 0 });
|
|
1153
|
+
if (c && p.push(c), n.hands === !1) return p;
|
|
1154
|
+
const u = [];
|
|
1155
|
+
for (const d of ["left", "right"])
|
|
1156
|
+
for (const b of Object.keys(R)) {
|
|
1157
|
+
const m = (w) => w.hands?.[d]?.[b] ?? R[b];
|
|
1158
|
+
h.some((w) => m(w.frame) !== R[b]) && u.push(f(Oe(d, b), m));
|
|
1111
1159
|
}
|
|
1112
|
-
return [...p, ...
|
|
1160
|
+
return [...p, ...u];
|
|
1113
1161
|
}
|
|
1114
|
-
const
|
|
1162
|
+
const be = { type: "back", mode: "out", overshoot: 1.1 }, X = "ease-out-cubic", xo = {
|
|
1115
1163
|
label: "Disco",
|
|
1116
1164
|
bpm: 120,
|
|
1117
1165
|
stance: { leftHip: 10, rightHip: 10, leftKnee: 6, rightKnee: 6 },
|
|
@@ -1121,7 +1169,7 @@ const ve = { type: "back", mode: "out", overshoot: 1.1 }, q = "ease-out-cubic",
|
|
|
1121
1169
|
point: {
|
|
1122
1170
|
label: "The point",
|
|
1123
1171
|
beats: 2,
|
|
1124
|
-
easing:
|
|
1172
|
+
easing: X,
|
|
1125
1173
|
keys: [
|
|
1126
1174
|
{
|
|
1127
1175
|
beat: 0,
|
|
@@ -1146,9 +1194,9 @@ const ve = { type: "back", mode: "out", overshoot: 1.1 }, q = "ease-out-cubic",
|
|
|
1146
1194
|
label: "Bump and clap",
|
|
1147
1195
|
beats: 4,
|
|
1148
1196
|
keys: [
|
|
1149
|
-
{ beat: 0, pose: { lean: -10, rightHip: 22, leftHip: 4, leftShoulder: 140, rightShoulder: 140, leftElbow: 0, rightElbow: 0, leftWrist: 20, rightWrist: 20 }, hands: { left: "spread", right: "spread" }, easing:
|
|
1197
|
+
{ beat: 0, pose: { lean: -10, rightHip: 22, leftHip: 4, leftShoulder: 140, rightShoulder: 140, leftElbow: 0, rightElbow: 0, leftWrist: 20, rightWrist: 20 }, hands: { left: "spread", right: "spread" }, easing: X },
|
|
1150
1198
|
{ beat: 1, pose: { lean: 0, rightHip: 10, leftHip: 10, leftShoulder: 168, rightShoulder: 168, leftElbow: 22, rightElbow: 22, leftWrist: 0, rightWrist: 0 }, hands: { left: "flat", right: "flat" } },
|
|
1151
|
-
{ beat: 2, pose: { lean: 10, rightHip: 4, leftHip: 22, leftShoulder: 140, rightShoulder: 140, leftElbow: 0, rightElbow: 0, leftWrist: 20, rightWrist: 20 }, hands: { left: "spread", right: "spread" }, easing:
|
|
1199
|
+
{ beat: 2, pose: { lean: 10, rightHip: 4, leftHip: 22, leftShoulder: 140, rightShoulder: 140, leftElbow: 0, rightElbow: 0, leftWrist: 20, rightWrist: 20 }, hands: { left: "spread", right: "spread" }, easing: X },
|
|
1152
1200
|
{ beat: 3, pose: { lean: 0, rightHip: 10, leftHip: 10, leftShoulder: 168, rightShoulder: 168, leftElbow: 22, rightElbow: 22, leftWrist: 0, rightWrist: 0 }, hands: { left: "flat", right: "flat" } }
|
|
1153
1201
|
]
|
|
1154
1202
|
}
|
|
@@ -1159,7 +1207,7 @@ const ve = { type: "back", mode: "out", overshoot: 1.1 }, q = "ease-out-cubic",
|
|
|
1159
1207
|
{ move: "point", beats: 8, mirror: !0 },
|
|
1160
1208
|
{ move: "bump", beats: 8 }
|
|
1161
1209
|
]
|
|
1162
|
-
},
|
|
1210
|
+
}, Ao = {
|
|
1163
1211
|
label: "Hip hop",
|
|
1164
1212
|
bpm: 95,
|
|
1165
1213
|
stance: { leftHip: 14, rightHip: 14, leftKnee: 20, rightKnee: 20, leftShoulder: 22, rightShoulder: 22, leftElbow: -30, rightElbow: -30, leftFootOut: 0.15, rightFootOut: 0.15 },
|
|
@@ -1211,7 +1259,7 @@ const ve = { type: "back", mode: "out", overshoot: 1.1 }, q = "ease-out-cubic",
|
|
|
1211
1259
|
{ move: "armWave", beats: 8 },
|
|
1212
1260
|
{ move: "bounce", beats: 4 }
|
|
1213
1261
|
]
|
|
1214
|
-
},
|
|
1262
|
+
}, Ko = {
|
|
1215
1263
|
label: "Breaking (toprock)",
|
|
1216
1264
|
bpm: 110,
|
|
1217
1265
|
stance: { leftHip: 14, rightHip: 14, leftKnee: 14, rightKnee: 14, leftShoulder: 35, rightShoulder: 35, leftElbow: -90, rightElbow: -90 },
|
|
@@ -1223,9 +1271,9 @@ const ve = { type: "back", mode: "out", overshoot: 1.1 }, q = "ease-out-cubic",
|
|
|
1223
1271
|
label: "Toprock (Indian step)",
|
|
1224
1272
|
beats: 4,
|
|
1225
1273
|
keys: [
|
|
1226
|
-
{ beat: 0, pose: { rightHip: -24, rightKnee: 10, leftHip: 10, leftShoulder: 80, leftElbow: 40, rightShoulder: 55, rightElbow: -50, lean: 6, headTilt: -6 }, easing:
|
|
1274
|
+
{ beat: 0, pose: { rightHip: -24, rightKnee: 10, leftHip: 10, leftShoulder: 80, leftElbow: 40, rightShoulder: 55, rightElbow: -50, lean: 6, headTilt: -6 }, easing: X },
|
|
1227
1275
|
{ beat: 1, reset: !0, pose: { leftHip: 18, rightHip: 18 } },
|
|
1228
|
-
{ beat: 2, pose: { leftHip: -24, leftKnee: 10, rightHip: 10, rightShoulder: 80, rightElbow: 40, leftShoulder: 55, leftElbow: -50, lean: -6, headTilt: 6 }, easing:
|
|
1276
|
+
{ beat: 2, pose: { leftHip: -24, leftKnee: 10, rightHip: 10, rightShoulder: 80, rightElbow: 40, leftShoulder: 55, leftElbow: -50, lean: -6, headTilt: 6 }, easing: X },
|
|
1229
1277
|
{ beat: 3, reset: !0, pose: { leftHip: 18, rightHip: 18 } }
|
|
1230
1278
|
]
|
|
1231
1279
|
},
|
|
@@ -1233,7 +1281,7 @@ const ve = { type: "back", mode: "out", overshoot: 1.1 }, q = "ease-out-cubic",
|
|
|
1233
1281
|
label: "Kick out",
|
|
1234
1282
|
beats: 2,
|
|
1235
1283
|
keys: [
|
|
1236
|
-
{ beat: 0, pose: { rightHip: 72, rightKnee: 4, rightAnkle: -20, leftHip: 4, lean: -12, leftShoulder: 100, leftElbow: 20 }, easing:
|
|
1284
|
+
{ beat: 0, pose: { rightHip: 72, rightKnee: 4, rightAnkle: -20, leftHip: 4, lean: -12, leftShoulder: 100, leftElbow: 20 }, easing: X },
|
|
1237
1285
|
{ beat: 1, reset: !0 }
|
|
1238
1286
|
]
|
|
1239
1287
|
},
|
|
@@ -1241,7 +1289,7 @@ const ve = { type: "back", mode: "out", overshoot: 1.1 }, q = "ease-out-cubic",
|
|
|
1241
1289
|
label: "B-boy stance",
|
|
1242
1290
|
beats: 4,
|
|
1243
1291
|
keys: [
|
|
1244
|
-
{ beat: 0, reset: !0, pose: { leftShoulder: 26, leftElbow: -122, rightShoulder: 22, rightElbow: -118, leftHip: 18, rightHip: 18, leftKnee: 6, rightKnee: 6, lean: -4, headTilt: 10, smile: 0.6, leftEye: 0.6, rightEye: 0.6 }, easing:
|
|
1292
|
+
{ beat: 0, reset: !0, pose: { leftShoulder: 26, leftElbow: -122, rightShoulder: 22, rightElbow: -118, leftHip: 18, rightHip: 18, leftKnee: 6, rightKnee: 6, lean: -4, headTilt: 10, smile: 0.6, leftEye: 0.6, rightEye: 0.6 }, easing: be },
|
|
1245
1293
|
{ beat: 2, pose: { headTilt: 14, lean: -6 } }
|
|
1246
1294
|
]
|
|
1247
1295
|
}
|
|
@@ -1253,7 +1301,7 @@ const ve = { type: "back", mode: "out", overshoot: 1.1 }, q = "ease-out-cubic",
|
|
|
1253
1301
|
{ move: "kick", beats: 4, mirror: !0 },
|
|
1254
1302
|
{ move: "freeze", beats: 4 }
|
|
1255
1303
|
]
|
|
1256
|
-
},
|
|
1304
|
+
}, Po = {
|
|
1257
1305
|
label: "Jazz",
|
|
1258
1306
|
bpm: 130,
|
|
1259
1307
|
stance: { leftHip: 10, rightHip: 10 },
|
|
@@ -1276,7 +1324,7 @@ const ve = { type: "back", mode: "out", overshoot: 1.1 }, q = "ease-out-cubic",
|
|
|
1276
1324
|
label: "Kick ball change",
|
|
1277
1325
|
beats: 2,
|
|
1278
1326
|
keys: [
|
|
1279
|
-
{ beat: 0, reset: !0, pose: { rightHip: 88, rightKnee: 0, rightAnkle: 55, leftHip: 4, lean: -12, leftShoulder: 112, rightShoulder: 112, leftWrist: 15, rightWrist: 15 }, hands: { left: "flat", right: "flat" }, easing:
|
|
1327
|
+
{ beat: 0, reset: !0, pose: { rightHip: 88, rightKnee: 0, rightAnkle: 55, leftHip: 4, lean: -12, leftShoulder: 112, rightShoulder: 112, leftWrist: 15, rightWrist: 15 }, hands: { left: "flat", right: "flat" }, easing: X },
|
|
1280
1328
|
{ beat: 1, reset: !0, pose: { rightHip: 10, rightKnee: 24, rightAnkle: 45, leftShoulder: 60, rightShoulder: 60, leftElbow: -20, rightElbow: -20 } },
|
|
1281
1329
|
{ beat: 1.5, pose: { rightAnkle: 0, rightKnee: 6, leftAnkle: 45, leftKnee: 20 } }
|
|
1282
1330
|
]
|
|
@@ -1314,7 +1362,7 @@ const ve = { type: "back", mode: "out", overshoot: 1.1 }, q = "ease-out-cubic",
|
|
|
1314
1362
|
{ move: "jazzHands", beats: 4 },
|
|
1315
1363
|
{ move: "splitDrop", beats: 8 }
|
|
1316
1364
|
]
|
|
1317
|
-
},
|
|
1365
|
+
}, Wo = {
|
|
1318
1366
|
label: "K-pop",
|
|
1319
1367
|
bpm: 125,
|
|
1320
1368
|
stance: { leftHip: 9, rightHip: 9, leftKnee: 4, rightKnee: 4 },
|
|
@@ -1324,7 +1372,7 @@ const ve = { type: "back", mode: "out", overshoot: 1.1 }, q = "ease-out-cubic",
|
|
|
1324
1372
|
pointCombo: {
|
|
1325
1373
|
label: "Point combo",
|
|
1326
1374
|
beats: 4,
|
|
1327
|
-
easing:
|
|
1375
|
+
easing: be,
|
|
1328
1376
|
keys: [
|
|
1329
1377
|
{ beat: 0, reset: !0, pose: { rightShoulder: 142, rightElbow: 0, leftShoulder: 25, leftElbow: -125, headTilt: 6, lean: -3, lookX: 0.6, lookY: -0.6 }, hands: { right: "point", left: "flat" } },
|
|
1330
1378
|
{ beat: 1, pose: { rightShoulder: -38, headTilt: -6, lean: 3, lookX: -0.3, lookY: 0.5, rightHip: 18 } },
|
|
@@ -1336,16 +1384,16 @@ const ve = { type: "back", mode: "out", overshoot: 1.1 }, q = "ease-out-cubic",
|
|
|
1336
1384
|
label: "Big heart, finger heart",
|
|
1337
1385
|
beats: 4,
|
|
1338
1386
|
keys: [
|
|
1339
|
-
{ beat: 0, reset: !0, pose: { leftShoulder: 165, rightShoulder: 165, leftElbow: 46, rightElbow: 46, headTilt: -8, lean: -4 }, hands: { left: "cupped", right: "cupped" }, easing:
|
|
1387
|
+
{ beat: 0, reset: !0, pose: { leftShoulder: 165, rightShoulder: 165, leftElbow: 46, rightElbow: 46, headTilt: -8, lean: -4 }, hands: { left: "cupped", right: "cupped" }, easing: be },
|
|
1340
1388
|
{ beat: 1, pose: { headTilt: 8, lean: 4 } },
|
|
1341
|
-
{ beat: 2, reset: !0, pose: { rightShoulder: 32, rightElbow: 112, rightWrist: 10, leftShoulder: 20, leftElbow: -30, headTilt: 10, leftEye: 0, smile: 1 }, hands: { right: "pinch", left: "relaxed" }, easing:
|
|
1389
|
+
{ beat: 2, reset: !0, pose: { rightShoulder: 32, rightElbow: 112, rightWrist: 10, leftShoulder: 20, leftElbow: -30, headTilt: 10, leftEye: 0, smile: 1 }, hands: { right: "pinch", left: "relaxed" }, easing: be },
|
|
1342
1390
|
{ beat: 3, pose: { headTilt: 4 } }
|
|
1343
1391
|
]
|
|
1344
1392
|
},
|
|
1345
1393
|
isolations: {
|
|
1346
1394
|
label: "Isolations",
|
|
1347
1395
|
beats: 2,
|
|
1348
|
-
easing:
|
|
1396
|
+
easing: X,
|
|
1349
1397
|
keys: [
|
|
1350
1398
|
{ beat: 0, reset: !0, pose: { lean: -9, headTilt: 11, leftShoulder: 55, leftElbow: -112, rightShoulder: 55, rightElbow: -112, rightHip: 18 }, hands: { left: "fist", right: "fist" } },
|
|
1351
1399
|
{ beat: 0.5, pose: { lean: 0, headTilt: 0, rightHip: 9 } },
|
|
@@ -1361,7 +1409,7 @@ const ve = { type: "back", mode: "out", overshoot: 1.1 }, q = "ease-out-cubic",
|
|
|
1361
1409
|
{ move: "pointCombo", beats: 8, mirror: !0 },
|
|
1362
1410
|
{ move: "isolations", beats: 4 }
|
|
1363
1411
|
]
|
|
1364
|
-
},
|
|
1412
|
+
}, Oo = {
|
|
1365
1413
|
label: "Bollywood",
|
|
1366
1414
|
bpm: 120,
|
|
1367
1415
|
stance: { leftHip: 10, rightHip: 10 },
|
|
@@ -1382,9 +1430,9 @@ const ve = { type: "back", mode: "out", overshoot: 1.1 }, q = "ease-out-cubic",
|
|
|
1382
1430
|
label: "Thumka",
|
|
1383
1431
|
beats: 2,
|
|
1384
1432
|
keys: [
|
|
1385
|
-
{ beat: 0, reset: !0, pose: { lean: -11, rightHip: 22, leftHip: 2, leftKnee: 14, rightShoulder: 45, rightElbow: -105, leftShoulder: 128, leftElbow: 18, leftWrist: 35, headTilt: 10, lookX: -0.5 }, hands: { right: "fist", left: { ...N.open, turn: 2 } }, easing:
|
|
1433
|
+
{ beat: 0, reset: !0, pose: { lean: -11, rightHip: 22, leftHip: 2, leftKnee: 14, rightShoulder: 45, rightElbow: -105, leftShoulder: 128, leftElbow: 18, leftWrist: 35, headTilt: 10, lookX: -0.5 }, hands: { right: "fist", left: { ...N.open, turn: 2 } }, easing: X },
|
|
1386
1434
|
{ beat: 0.5, pose: { lean: -4, rightHip: 12, headTilt: 6 } },
|
|
1387
|
-
{ beat: 1, pose: { lean: -11, rightHip: 22, headTilt: 10 }, easing:
|
|
1435
|
+
{ beat: 1, pose: { lean: -11, rightHip: 22, headTilt: 10 }, easing: X },
|
|
1388
1436
|
{ beat: 1.5, pose: { lean: -4, rightHip: 12, headTilt: 6 } }
|
|
1389
1437
|
]
|
|
1390
1438
|
},
|
|
@@ -1393,9 +1441,9 @@ const ve = { type: "back", mode: "out", overshoot: 1.1 }, q = "ease-out-cubic",
|
|
|
1393
1441
|
beats: 4,
|
|
1394
1442
|
keys: [
|
|
1395
1443
|
{ beat: 0, reset: !0, pose: { leftShoulder: 22, rightShoulder: 22, leftElbow: -62, rightElbow: -62, leftHip: 16, rightHip: 16, leftKnee: 26, rightKnee: 26 }, hands: { left: "fist", right: "fist" } },
|
|
1396
|
-
{ beat: 1, pose: { leftShoulder: 132, rightShoulder: 132, leftElbow: 0, rightElbow: 0, leftWrist: 30, rightWrist: 30, leftKnee: 0, rightKnee: 0, leftHip: 10, rightHip: 10, stretch: 1.03 }, hands: { left: "spread", right: "spread" }, easing:
|
|
1444
|
+
{ beat: 1, pose: { leftShoulder: 132, rightShoulder: 132, leftElbow: 0, rightElbow: 0, leftWrist: 30, rightWrist: 30, leftKnee: 0, rightKnee: 0, leftHip: 10, rightHip: 10, stretch: 1.03 }, hands: { left: "spread", right: "spread" }, easing: X },
|
|
1397
1445
|
{ beat: 2, pose: { leftShoulder: 22, rightShoulder: 22, leftElbow: -62, rightElbow: -62, leftWrist: 0, rightWrist: 0, leftHip: 16, rightHip: 16, leftKnee: 26, rightKnee: 26, stretch: 1 }, hands: { left: "fist", right: "fist" } },
|
|
1398
|
-
{ beat: 3, pose: { leftShoulder: 62, rightShoulder: 62, leftElbow: 0, rightElbow: 0, leftWrist: 35, rightWrist: 35, leftKnee: 0, rightKnee: 0, leftHip: 10, rightHip: 10 }, hands: { left: "spread", right: "spread" }, easing:
|
|
1446
|
+
{ beat: 3, pose: { leftShoulder: 62, rightShoulder: 62, leftElbow: 0, rightElbow: 0, leftWrist: 35, rightWrist: 35, leftKnee: 0, rightKnee: 0, leftHip: 10, rightHip: 10 }, hands: { left: "spread", right: "spread" }, easing: X }
|
|
1399
1447
|
]
|
|
1400
1448
|
}
|
|
1401
1449
|
},
|
|
@@ -1406,7 +1454,7 @@ const ve = { type: "back", mode: "out", overshoot: 1.1 }, q = "ease-out-cubic",
|
|
|
1406
1454
|
{ move: "thumka", beats: 4, mirror: !0 },
|
|
1407
1455
|
{ move: "lightBulb", beats: 8, mirror: !0 }
|
|
1408
1456
|
]
|
|
1409
|
-
},
|
|
1457
|
+
}, Io = {
|
|
1410
1458
|
label: "Bhangra",
|
|
1411
1459
|
bpm: 100,
|
|
1412
1460
|
stance: { leftShoulder: 150, rightShoulder: 150, leftElbow: 18, rightElbow: 18, leftHip: 10, rightHip: 10 },
|
|
@@ -1441,11 +1489,11 @@ const ve = { type: "back", mode: "out", overshoot: 1.1 }, q = "ease-out-cubic",
|
|
|
1441
1489
|
{ move: "basic", beats: 8 },
|
|
1442
1490
|
{ move: "dhamaal", beats: 4 }
|
|
1443
1491
|
]
|
|
1444
|
-
},
|
|
1492
|
+
}, $o = { leftHip: 42, rightHip: 42, leftKnee: 82, rightKnee: 82, leftFootOut: 0.3, rightFootOut: 0.3 }, Bo = {
|
|
1445
1493
|
label: "Bharatanatyam",
|
|
1446
1494
|
bpm: 80,
|
|
1447
1495
|
// Natyarambhe: arms out at shoulder height, hands raised in pataka.
|
|
1448
|
-
stance: {
|
|
1496
|
+
stance: { ...$o, leftShoulder: 90, rightShoulder: 90, leftElbow: 0, rightElbow: 0, leftWrist: 75, rightWrist: 75 },
|
|
1449
1497
|
expression: { smile: 0.5, leftEye: 1.2, rightEye: 1.2, leftBrow: 0.3, rightBrow: 0.3 },
|
|
1450
1498
|
hands: { left: "pataka", right: "pataka" },
|
|
1451
1499
|
groove: { bounce: 0 },
|
|
@@ -1487,7 +1535,7 @@ const ve = { type: "back", mode: "out", overshoot: 1.1 }, q = "ease-out-cubic",
|
|
|
1487
1535
|
{ move: "alapadma", beats: 8 },
|
|
1488
1536
|
{ move: "tatta", beats: 4 }
|
|
1489
1537
|
]
|
|
1490
|
-
},
|
|
1538
|
+
}, _o = {
|
|
1491
1539
|
label: "Charleston",
|
|
1492
1540
|
bpm: 150,
|
|
1493
1541
|
stance: { leftHip: 10, rightHip: 10, leftKnee: 10, rightKnee: 10, leftShoulder: 30, rightShoulder: 30, leftElbow: 20, rightElbow: 20 },
|
|
@@ -1499,9 +1547,9 @@ const ve = { type: "back", mode: "out", overshoot: 1.1 }, q = "ease-out-cubic",
|
|
|
1499
1547
|
label: "Kick forward, kick back",
|
|
1500
1548
|
beats: 4,
|
|
1501
1549
|
keys: [
|
|
1502
|
-
{ beat: 0, reset: !0, pose: { rightHip: 48, rightKnee: 8, rightAnkle: 45, leftShoulder: 75, rightShoulder: 15, leftElbow: 30, rightElbow: -10, lean: -7, headTilt: -5 }, easing:
|
|
1550
|
+
{ beat: 0, reset: !0, pose: { rightHip: 48, rightKnee: 8, rightAnkle: 45, leftShoulder: 75, rightShoulder: 15, leftElbow: 30, rightElbow: -10, lean: -7, headTilt: -5 }, easing: X },
|
|
1503
1551
|
{ beat: 1, reset: !0 },
|
|
1504
|
-
{ beat: 2, reset: !0, pose: { leftHip: 18, leftKnee: 85, leftAnkle: 35, rightShoulder: 75, leftShoulder: 15, rightElbow: 30, leftElbow: -10, lean: 7, headTilt: 5 }, easing:
|
|
1552
|
+
{ beat: 2, reset: !0, pose: { leftHip: 18, leftKnee: 85, leftAnkle: 35, rightShoulder: 75, leftShoulder: 15, rightElbow: 30, leftElbow: -10, lean: 7, headTilt: 5 }, easing: X },
|
|
1505
1553
|
{ beat: 3, reset: !0 }
|
|
1506
1554
|
]
|
|
1507
1555
|
},
|
|
@@ -1537,7 +1585,7 @@ const ve = { type: "back", mode: "out", overshoot: 1.1 }, q = "ease-out-cubic",
|
|
|
1537
1585
|
{ move: "basic", beats: 8, mirror: !0 },
|
|
1538
1586
|
{ move: "twist", beats: 4 }
|
|
1539
1587
|
]
|
|
1540
|
-
},
|
|
1588
|
+
}, Fo = {
|
|
1541
1589
|
label: "Tap",
|
|
1542
1590
|
bpm: 120,
|
|
1543
1591
|
// Three-quarters to side-on, so shuffles read as brushes forward and back. Side-on,
|
|
@@ -1635,71 +1683,145 @@ const ve = { type: "back", mode: "out", overshoot: 1.1 }, q = "ease-out-cubic",
|
|
|
1635
1683
|
{ move: "heelToe", beats: 8 },
|
|
1636
1684
|
{ move: "crampRoll", beats: 4 }
|
|
1637
1685
|
]
|
|
1638
|
-
},
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1686
|
+
}, Ro = {
|
|
1687
|
+
label: "Popping (glides, moonwalk)",
|
|
1688
|
+
bpm: 100,
|
|
1689
|
+
stance: { leftHip: 9, rightHip: 9, leftShoulder: 16, rightShoulder: 16, leftElbow: -24, rightElbow: -24 },
|
|
1690
|
+
expression: { smile: 0.35, leftEye: 0.85, rightEye: 0.85, leftBrow: -0.2, rightBrow: -0.2 },
|
|
1691
|
+
hands: { left: "relaxed", right: "relaxed" },
|
|
1692
|
+
groove: { bounce: 0 },
|
|
1693
|
+
moves: {
|
|
1694
|
+
sideGlide: {
|
|
1695
|
+
label: "Side glide",
|
|
1696
|
+
beats: 2,
|
|
1697
|
+
easing: "linear",
|
|
1698
|
+
travel: 0.2,
|
|
1699
|
+
keys: [
|
|
1700
|
+
{
|
|
1701
|
+
beat: 0,
|
|
1702
|
+
reset: !0,
|
|
1703
|
+
pose: { leftHip: 11, leftKnee: 0, leftAnkle: 0, rightHip: 36, rightKnee: 45, rightAnkle: 45, rightShoulder: 80, rightElbow: -10, rightWrist: 10, leftShoulder: 28, leftElbow: 18, lean: -2, headTilt: 4, lookX: 0.7 },
|
|
1704
|
+
hands: { right: "flat", left: "relaxed" }
|
|
1705
|
+
},
|
|
1706
|
+
{ beat: 1, pose: { leftHip: 27, leftKnee: 54, leftAnkle: 45, rightHip: -1, rightKnee: 0, rightAnkle: 0, rightShoulder: 74, rightWrist: -10, lean: 2 } }
|
|
1707
|
+
]
|
|
1708
|
+
},
|
|
1709
|
+
moonwalk: {
|
|
1710
|
+
label: "Moonwalk",
|
|
1711
|
+
beats: 2,
|
|
1712
|
+
easing: "linear",
|
|
1713
|
+
travel: -0.29,
|
|
1714
|
+
keys: [
|
|
1715
|
+
{
|
|
1716
|
+
beat: 0,
|
|
1717
|
+
reset: !0,
|
|
1718
|
+
pose: { turn: 0.9, lean: 4, headTilt: -4, leftHip: -12, leftKnee: 0, leftAnkle: 0, rightHip: 23, rightKnee: 57, rightAnkle: 45, leftShoulder: -10, leftElbow: -45, rightShoulder: 14, rightElbow: 50 }
|
|
1719
|
+
},
|
|
1720
|
+
{ beat: 1, pose: { leftHip: -23, leftKnee: -57, leftAnkle: 45, rightHip: 12, rightKnee: 0, rightAnkle: 0, leftShoulder: -14, leftElbow: -50, rightShoulder: 10, rightElbow: 45 } }
|
|
1721
|
+
]
|
|
1722
|
+
},
|
|
1723
|
+
forwardGlide: {
|
|
1724
|
+
label: "Forward glide",
|
|
1725
|
+
beats: 2,
|
|
1726
|
+
easing: "linear",
|
|
1727
|
+
travel: 0.29,
|
|
1728
|
+
keys: [
|
|
1729
|
+
{
|
|
1730
|
+
beat: 0,
|
|
1731
|
+
reset: !0,
|
|
1732
|
+
pose: { turn: 0.9, lean: 2, leftHip: 16, leftKnee: 0, leftAnkle: 0, rightHip: 33, rightKnee: 59, rightAnkle: 45, leftShoulder: 12, leftElbow: -40, rightShoulder: -12, rightElbow: 40 }
|
|
1733
|
+
},
|
|
1734
|
+
{ beat: 1, pose: { leftHip: -33, leftKnee: -59, leftAnkle: 45, rightHip: -16, rightKnee: 0, rightAnkle: 0, leftShoulder: -12, leftElbow: -40, rightShoulder: 12, rightElbow: 40 } }
|
|
1735
|
+
]
|
|
1736
|
+
},
|
|
1737
|
+
toeStand: {
|
|
1738
|
+
label: "Toe stand",
|
|
1739
|
+
beats: 4,
|
|
1740
|
+
keys: [
|
|
1741
|
+
{
|
|
1742
|
+
beat: 0,
|
|
1743
|
+
reset: !0,
|
|
1744
|
+
pose: { leftHip: 6, rightHip: 6, leftKnee: 0, rightKnee: 0, leftAnkle: 65, rightAnkle: 65, rightShoulder: 150, rightElbow: 75, leftShoulder: 30, leftElbow: 20, headTilt: -10, lookY: 0.4 },
|
|
1745
|
+
hands: { right: "fist", left: "fist" },
|
|
1746
|
+
easing: be
|
|
1747
|
+
},
|
|
1748
|
+
{ beat: 2, pose: { headTilt: -14, lean: -2 } }
|
|
1749
|
+
]
|
|
1750
|
+
}
|
|
1751
|
+
},
|
|
1752
|
+
routine: [
|
|
1753
|
+
{ move: "sideGlide", beats: 4 },
|
|
1754
|
+
{ move: "sideGlide", beats: 4, mirror: !0 },
|
|
1755
|
+
{ move: "moonwalk", beats: 8 },
|
|
1756
|
+
{ move: "forwardGlide", beats: 8 },
|
|
1757
|
+
{ move: "toeStand", beats: 4 }
|
|
1758
|
+
]
|
|
1759
|
+
}, ce = {
|
|
1760
|
+
disco: xo,
|
|
1761
|
+
hipHop: Ao,
|
|
1762
|
+
breaking: Ko,
|
|
1763
|
+
jazz: Po,
|
|
1764
|
+
kpop: Wo,
|
|
1765
|
+
bollywood: Oo,
|
|
1766
|
+
bhangra: Io,
|
|
1767
|
+
bharatanatyam: Bo,
|
|
1768
|
+
charleston: _o,
|
|
1769
|
+
tap: Fo,
|
|
1770
|
+
popping: Ro
|
|
1771
|
+
}, $e = (e) => Math.min(1, Math.max(0, e));
|
|
1772
|
+
function Yo(e) {
|
|
1651
1773
|
const t = { ...z, turn: e.view }, n = [];
|
|
1652
|
-
for (const
|
|
1653
|
-
const
|
|
1654
|
-
n.push({ at:
|
|
1774
|
+
for (const o of e.keys) {
|
|
1775
|
+
const r = n[n.length - 1], l = !r || o.reset ? t : r.pose;
|
|
1776
|
+
n.push({ at: o.at, pose: { ...l, ...o.pose }, easing: o.easing });
|
|
1655
1777
|
}
|
|
1656
1778
|
return n;
|
|
1657
1779
|
}
|
|
1658
|
-
function
|
|
1659
|
-
return e -
|
|
1780
|
+
function Lo(e) {
|
|
1781
|
+
return e - No * Math.sin(2 * Math.PI * e) / (2 * Math.PI);
|
|
1660
1782
|
}
|
|
1661
|
-
const
|
|
1662
|
-
function
|
|
1783
|
+
const No = 0.5;
|
|
1784
|
+
function Co(e, t) {
|
|
1663
1785
|
if (!(t <= e.takeoff || t >= e.landing))
|
|
1664
1786
|
return (t - e.takeoff) / (e.landing - e.takeoff);
|
|
1665
1787
|
}
|
|
1666
|
-
function
|
|
1667
|
-
const n = typeof e == "string" ?
|
|
1788
|
+
function Do(e, t) {
|
|
1789
|
+
const n = typeof e == "string" ? ft[e] : e, o = Yo(n), r = $e(t);
|
|
1668
1790
|
let l = 0;
|
|
1669
|
-
for (let
|
|
1670
|
-
const i =
|
|
1671
|
-
return f === void 0 ? { ...
|
|
1672
|
-
...
|
|
1673
|
-
spin: n.spin *
|
|
1791
|
+
for (let g = 0; g < o.length; g++) o[g].at <= r && (l = g);
|
|
1792
|
+
const i = o[l], s = o[Math.min(l + 1, o.length - 1)], a = s.at > i.at ? (r - i.at) / (s.at - i.at) : 0, h = we(i.pose, s.pose, _e(s.easing ?? "ease-in-out")($e(a))), f = Co(n, r);
|
|
1793
|
+
return f === void 0 ? { ...h, spin: 0, rise: 0 } : {
|
|
1794
|
+
...h,
|
|
1795
|
+
spin: n.spin * Lo(f),
|
|
1674
1796
|
rise: 4 * n.height * f * (1 - f)
|
|
1675
1797
|
};
|
|
1676
1798
|
}
|
|
1677
|
-
function
|
|
1678
|
-
const
|
|
1679
|
-
return
|
|
1799
|
+
function Xo(e, t, n) {
|
|
1800
|
+
const o = typeof e == "string" ? ft[e] : e, r = $e(t), l = $e((r - o.takeoff) / (o.landing - o.takeoff));
|
|
1801
|
+
return o.travel * n * l;
|
|
1680
1802
|
}
|
|
1681
|
-
function
|
|
1682
|
-
const
|
|
1683
|
-
const p =
|
|
1684
|
-
return { time:
|
|
1685
|
-
}),
|
|
1803
|
+
function Nr(e, t, n = {}) {
|
|
1804
|
+
const o = typeof t == "string" ? ft[t] : t, r = n.start ?? 0, l = n.duration ?? o.duration, i = n.samples ?? 48, s = Array.from({ length: i + 1 }, (f, g) => {
|
|
1805
|
+
const p = g / i;
|
|
1806
|
+
return { time: r + p * l, progress: p, pose: Do(o, p) };
|
|
1807
|
+
}), h = Object.keys(z).filter((f) => s.some((g) => g.pose[f] !== z[f])).map((f) => ({
|
|
1686
1808
|
id: `${e}-${f}`,
|
|
1687
1809
|
target: e,
|
|
1688
1810
|
property: f,
|
|
1689
|
-
keyframes: s.map((
|
|
1811
|
+
keyframes: s.map((g) => ({ time: g.time, value: g.pose[f] }))
|
|
1690
1812
|
}));
|
|
1691
|
-
if (n.height !== void 0 &&
|
|
1813
|
+
if (n.height !== void 0 && o.travel !== 0) {
|
|
1692
1814
|
const f = (n.facing ?? 1) < 0 ? -1 : 1;
|
|
1693
|
-
|
|
1815
|
+
h.push({
|
|
1694
1816
|
id: `${e}-x`,
|
|
1695
1817
|
target: e,
|
|
1696
1818
|
property: "x",
|
|
1697
|
-
keyframes: s.map((
|
|
1819
|
+
keyframes: s.map((g) => ({ time: g.time, value: (n.x ?? 0) + f * Xo(o, g.progress, n.height) }))
|
|
1698
1820
|
});
|
|
1699
1821
|
}
|
|
1700
|
-
return
|
|
1822
|
+
return h;
|
|
1701
1823
|
}
|
|
1702
|
-
const
|
|
1824
|
+
const qo = {
|
|
1703
1825
|
leftHip: -55,
|
|
1704
1826
|
leftKnee: -95,
|
|
1705
1827
|
rightHip: 55,
|
|
@@ -1711,7 +1833,7 @@ const Ro = {
|
|
|
1711
1833
|
lean: 22,
|
|
1712
1834
|
stretch: 0.94,
|
|
1713
1835
|
headTilt: 6
|
|
1714
|
-
},
|
|
1836
|
+
}, Uo = {
|
|
1715
1837
|
leftHip: 0,
|
|
1716
1838
|
leftKnee: 0,
|
|
1717
1839
|
rightHip: 0,
|
|
@@ -1725,7 +1847,7 @@ const Ro = {
|
|
|
1725
1847
|
lean: 0,
|
|
1726
1848
|
stretch: 1.08,
|
|
1727
1849
|
headTilt: 0
|
|
1728
|
-
},
|
|
1850
|
+
}, Se = {
|
|
1729
1851
|
leftHip: -128,
|
|
1730
1852
|
leftKnee: -152,
|
|
1731
1853
|
rightHip: 128,
|
|
@@ -1739,7 +1861,7 @@ const Ro = {
|
|
|
1739
1861
|
lean: 26,
|
|
1740
1862
|
stretch: 1,
|
|
1741
1863
|
headTilt: 14
|
|
1742
|
-
},
|
|
1864
|
+
}, zo = {
|
|
1743
1865
|
leftHip: -22,
|
|
1744
1866
|
leftKnee: -30,
|
|
1745
1867
|
rightHip: 22,
|
|
@@ -1752,7 +1874,7 @@ const Ro = {
|
|
|
1752
1874
|
rightElbow: 0,
|
|
1753
1875
|
lean: 8,
|
|
1754
1876
|
headTilt: 0
|
|
1755
|
-
},
|
|
1877
|
+
}, Go = {
|
|
1756
1878
|
leftHip: -58,
|
|
1757
1879
|
leftKnee: -100,
|
|
1758
1880
|
rightHip: 58,
|
|
@@ -1766,42 +1888,42 @@ const Ro = {
|
|
|
1766
1888
|
lean: 20,
|
|
1767
1889
|
stretch: 0.93
|
|
1768
1890
|
};
|
|
1769
|
-
function
|
|
1891
|
+
function ae(e, t, n, o, r, l = 1300) {
|
|
1770
1892
|
return {
|
|
1771
1893
|
label: e,
|
|
1772
1894
|
view: 1,
|
|
1773
1895
|
spin: t,
|
|
1774
1896
|
height: n,
|
|
1775
|
-
travel:
|
|
1897
|
+
travel: o,
|
|
1776
1898
|
takeoff: 0.27,
|
|
1777
1899
|
landing: 0.8,
|
|
1778
1900
|
duration: l,
|
|
1779
1901
|
keys: [
|
|
1780
1902
|
{ at: 0, reset: !0 },
|
|
1781
|
-
{ at: 0.16, pose:
|
|
1782
|
-
{ at: 0.27, pose:
|
|
1783
|
-
...
|
|
1784
|
-
{ at: 0.76, pose:
|
|
1785
|
-
{ at: 0.86, pose:
|
|
1903
|
+
{ at: 0.16, pose: qo },
|
|
1904
|
+
{ at: 0.27, pose: Uo, easing: "ease-out-quad" },
|
|
1905
|
+
...r,
|
|
1906
|
+
{ at: 0.76, pose: zo },
|
|
1907
|
+
{ at: 0.86, pose: Go, easing: "ease-out-quad" },
|
|
1786
1908
|
{ at: 1, reset: !0 }
|
|
1787
1909
|
]
|
|
1788
1910
|
};
|
|
1789
1911
|
}
|
|
1790
|
-
const
|
|
1791
|
-
frontFlip:
|
|
1792
|
-
{ at: 0.38, pose:
|
|
1793
|
-
{ at: 0.64, pose:
|
|
1912
|
+
const ft = {
|
|
1913
|
+
frontFlip: ae("Front flip (tuck)", 360, 0.56, 0.35, [
|
|
1914
|
+
{ at: 0.38, pose: Se, easing: "ease-out-cubic" },
|
|
1915
|
+
{ at: 0.64, pose: Se }
|
|
1794
1916
|
]),
|
|
1795
|
-
backFlip:
|
|
1796
|
-
{ at: 0.36, pose: { ...
|
|
1797
|
-
{ at: 0.64, pose: { ...
|
|
1917
|
+
backFlip: ae("Back flip (tuck)", -360, 0.58, -0.15, [
|
|
1918
|
+
{ at: 0.36, pose: { ...Se, lean: 18 }, easing: "ease-out-cubic" },
|
|
1919
|
+
{ at: 0.64, pose: { ...Se, lean: 18 } }
|
|
1798
1920
|
]),
|
|
1799
|
-
layout:
|
|
1921
|
+
layout: ae("Back layout (straight body)", -360, 0.66, -0.2, [
|
|
1800
1922
|
// Arched, arms overhead, legs together and long.
|
|
1801
1923
|
{ at: 0.4, pose: { leftHip: 8, rightHip: -8, leftKnee: 0, rightKnee: 0, leftAnkle: 60, rightAnkle: 60, leftShoulder: -178, rightShoulder: 178, lean: -18, headTilt: -14 } },
|
|
1802
1924
|
{ at: 0.64, pose: { leftHip: -4, rightHip: 4, lean: -6, headTilt: -4, leftShoulder: -150, rightShoulder: 150 } }
|
|
1803
1925
|
], 1400),
|
|
1804
|
-
scissorFlip:
|
|
1926
|
+
scissorFlip: ae("Scissor flip", 360, 0.6, 0.45, [
|
|
1805
1927
|
// The legs scissor through the turn: left kicks high, then they switch.
|
|
1806
1928
|
{ at: 0.36, pose: { leftHip: -105, leftKnee: 0, rightHip: -40, rightKnee: -20, leftAnkle: 50, rightAnkle: 50, leftShoulder: -150, rightShoulder: 150, leftElbow: 0, rightElbow: 0, lean: 12 }, easing: "ease-out-cubic" },
|
|
1807
1929
|
{ at: 0.52, pose: { leftHip: 40, leftKnee: 20, rightHip: 105, rightKnee: 0, leftShoulder: -140, rightShoulder: 140 } },
|
|
@@ -1847,7 +1969,7 @@ const it = {
|
|
|
1847
1969
|
]
|
|
1848
1970
|
},
|
|
1849
1971
|
// Leaps: no turn, the shape is the trick.
|
|
1850
|
-
splitLeap:
|
|
1972
|
+
splitLeap: ae("Split leap (grand jeté)", 0, 0.36, 0.9, [
|
|
1851
1973
|
// A front split in the air: front leg reaching, back leg long, arms open.
|
|
1852
1974
|
{ at: 0.4, pose: { leftHip: -96, rightHip: -84, leftKnee: 0, rightKnee: 0, leftAnkle: 55, rightAnkle: 55, leftShoulder: -130, rightShoulder: -105, leftElbow: 0, rightElbow: 0, lean: 4, headTilt: -6 }, easing: "ease-out-cubic" },
|
|
1853
1975
|
{ at: 0.64, pose: { lean: 2 } }
|
|
@@ -1873,12 +1995,12 @@ const it = {
|
|
|
1873
1995
|
{ at: 1, reset: !0 }
|
|
1874
1996
|
]
|
|
1875
1997
|
},
|
|
1876
|
-
backHandspring:
|
|
1998
|
+
backHandspring: ae("Back handspring", -360, 0.16, -0.7, [
|
|
1877
1999
|
// Arms reach back overhead to the ground, legs snap over.
|
|
1878
2000
|
{ at: 0.38, pose: { leftHip: 10, rightHip: -10, leftKnee: 0, rightKnee: 0, leftShoulder: -178, rightShoulder: 178, lean: -26, headTilt: -20 } },
|
|
1879
2001
|
{ at: 0.6, pose: { leftHip: -40, rightHip: 40, leftKnee: -20, rightKnee: 20, lean: 6, headTilt: 0 } }
|
|
1880
2002
|
], 1200)
|
|
1881
|
-
},
|
|
2003
|
+
}, Ce = 0.215, De = 0.205, Jo = 0.065, At = 0.035, Zo = 0.165, jo = 0.155, Qo = 12, Vo = (e) => e * Math.PI / 180, te = {
|
|
1882
2004
|
turn: 0,
|
|
1883
2005
|
lean: 0,
|
|
1884
2006
|
side: 0,
|
|
@@ -1923,12 +2045,21 @@ const it = {
|
|
|
1923
2045
|
function G(e = {}) {
|
|
1924
2046
|
return { ...te, ...e };
|
|
1925
2047
|
}
|
|
2048
|
+
const er = /* @__PURE__ */ new Set(["turn", "side", "head.turn", "head.tilt", "roll", "lookX"]);
|
|
2049
|
+
function Cr(e) {
|
|
2050
|
+
const t = {};
|
|
2051
|
+
for (const [n, o] of Object.entries(e)) {
|
|
2052
|
+
const r = n.replace(/(^|\.)(left|right)(\.|$)/, (l, i, s, a) => `${i}${s === "left" ? "right" : "left"}${a}`);
|
|
2053
|
+
t[r] = er.has(n) ? -o : o;
|
|
2054
|
+
}
|
|
2055
|
+
return t;
|
|
2056
|
+
}
|
|
1926
2057
|
function U(e, t) {
|
|
1927
2058
|
const n = {};
|
|
1928
|
-
for (const
|
|
2059
|
+
for (const o of ["left", "right"]) for (const [r, l] of Object.entries(t)) n[`${e}.${o}.${r}`] = l;
|
|
1929
2060
|
return n;
|
|
1930
2061
|
}
|
|
1931
|
-
const
|
|
2062
|
+
const tr = {
|
|
1932
2063
|
rest: te,
|
|
1933
2064
|
wave: G({ "arm.right.spread": 115, "arm.right.bend": 55, "arm.right.elbow": 0, "head.tilt": -6, smile: 0.9 }),
|
|
1934
2065
|
cheer: G({ ...U("arm", { spread: 140, bend: 20, elbow: 0 }), mouth: 0.6, smile: 1, "eye.left": 0, "eye.right": 0 }),
|
|
@@ -1953,32 +2084,32 @@ const zo = {
|
|
|
1953
2084
|
crawl: G({ lean: 82, "head.nod": -35, ...U("arm", { swing: 80, elbow: 0, spread: 4 }), ...U("leg", { knee: 92, ankle: -88 }) }),
|
|
1954
2085
|
lieDown: G({ roll: 90, ...U("arm", { spread: 8 }), "head.nod": 0 })
|
|
1955
2086
|
};
|
|
1956
|
-
function
|
|
1957
|
-
const t = e.headSize ?? 0.3, n = e.shoulderWidth ?? 0.06,
|
|
1958
|
-
id: `arm.${
|
|
2087
|
+
function nr(e = {}) {
|
|
2088
|
+
const t = e.headSize ?? 0.3, n = e.shoulderWidth ?? 0.06, o = e.hipWidth ?? 0.022, r = Math.max(0.12, 1 - t - At - (Ce + De)), l = (a) => ({
|
|
2089
|
+
id: `arm.${a}`,
|
|
1959
2090
|
parent: "spine",
|
|
1960
|
-
offset: [(
|
|
2091
|
+
offset: [(a === "left" ? 1 : -1) * n, -0.035, 0],
|
|
1961
2092
|
rest: [0, -1, 0],
|
|
1962
|
-
side:
|
|
2093
|
+
side: a === "left" ? 1 : -1,
|
|
1963
2094
|
bones: [
|
|
1964
|
-
{ length:
|
|
1965
|
-
{ length:
|
|
2095
|
+
{ length: Zo, width: [1.25, 0.9] },
|
|
2096
|
+
{ length: jo, width: [0.9, 0.75] }
|
|
1966
2097
|
]
|
|
1967
|
-
}), i = (
|
|
1968
|
-
id: `leg.${
|
|
2098
|
+
}), i = (a) => ({
|
|
2099
|
+
id: `leg.${a}`,
|
|
1969
2100
|
parent: null,
|
|
1970
|
-
offset: [(
|
|
2101
|
+
offset: [(a === "left" ? 1 : -1) * o, 0, 0],
|
|
1971
2102
|
rest: [0, -1, 0],
|
|
1972
|
-
side:
|
|
2103
|
+
side: a === "left" ? 1 : -1,
|
|
1973
2104
|
bones: [
|
|
1974
|
-
{ length:
|
|
1975
|
-
{ length:
|
|
1976
|
-
{ length:
|
|
2105
|
+
{ length: Ce, width: [1.45, 1.05] },
|
|
2106
|
+
{ length: De, width: [1.05, 0.85] },
|
|
2107
|
+
{ length: Jo, width: [0.95, 0.7] }
|
|
1977
2108
|
]
|
|
1978
|
-
}), s = (
|
|
2109
|
+
}), s = (a, h) => a[h] ?? te[h] ?? 0;
|
|
1979
2110
|
return {
|
|
1980
2111
|
id: "human",
|
|
1981
|
-
hipHeight:
|
|
2112
|
+
hipHeight: Ce + De,
|
|
1982
2113
|
// Tie order: legs, then the body, then the arms (in front of the chest unless turned away), then the head.
|
|
1983
2114
|
chains: [
|
|
1984
2115
|
i("left"),
|
|
@@ -1988,74 +2119,74 @@ function Go(e = {}) {
|
|
|
1988
2119
|
parent: null,
|
|
1989
2120
|
rest: [0, 1, 0],
|
|
1990
2121
|
bones: [
|
|
1991
|
-
{ length:
|
|
1992
|
-
{ length:
|
|
2122
|
+
{ length: r / 2, width: [1.7, 1.4] },
|
|
2123
|
+
{ length: r / 2, width: [1.4, 1.1] }
|
|
1993
2124
|
]
|
|
1994
2125
|
},
|
|
1995
|
-
{ id: "neck", parent: "spine", rest: [0, 1, 0], bones: [{ length:
|
|
2126
|
+
{ id: "neck", parent: "spine", rest: [0, 1, 0], bones: [{ length: At, width: [1, 0.9] }] },
|
|
1996
2127
|
l("left"),
|
|
1997
2128
|
l("right")
|
|
1998
2129
|
],
|
|
1999
2130
|
head: { on: "neck", size: t },
|
|
2000
2131
|
contacts: [
|
|
2001
|
-
...["left", "right"].flatMap((
|
|
2002
|
-
{ chain: `leg.${
|
|
2003
|
-
{ chain: `leg.${
|
|
2004
|
-
{ chain: `leg.${
|
|
2005
|
-
{ chain: `arm.${
|
|
2006
|
-
{ chain: `arm.${
|
|
2132
|
+
...["left", "right"].flatMap((a) => [
|
|
2133
|
+
{ chain: `leg.${a}`, joint: 1 },
|
|
2134
|
+
{ chain: `leg.${a}`, joint: 2 },
|
|
2135
|
+
{ chain: `leg.${a}`, joint: 3 },
|
|
2136
|
+
{ chain: `arm.${a}`, joint: 1 },
|
|
2137
|
+
{ chain: `arm.${a}`, joint: 2 }
|
|
2007
2138
|
]),
|
|
2008
2139
|
{ chain: "spine", joint: 0 },
|
|
2009
2140
|
{ chain: "spine", joint: 1 },
|
|
2010
2141
|
{ chain: "spine", joint: 2 },
|
|
2011
2142
|
{ head: "top" }
|
|
2012
2143
|
],
|
|
2013
|
-
angles(
|
|
2014
|
-
if (
|
|
2015
|
-
const d = -s(
|
|
2144
|
+
angles(a, h) {
|
|
2145
|
+
if (h.id === "spine") {
|
|
2146
|
+
const d = -s(a, "lean") / 2, b = s(a, "side") / 2;
|
|
2016
2147
|
return [
|
|
2017
2148
|
{ swing: d, spread: b },
|
|
2018
2149
|
{ swing: d, spread: b }
|
|
2019
2150
|
];
|
|
2020
2151
|
}
|
|
2021
|
-
if (
|
|
2022
|
-
const [f,
|
|
2152
|
+
if (h.id === "neck") return [{ swing: 0, spread: 0 }];
|
|
2153
|
+
const [f, g] = h.id.split("."), p = (d) => s(a, `${f}.${g}.${d}`);
|
|
2023
2154
|
if (f === "arm")
|
|
2024
2155
|
return [
|
|
2025
2156
|
{ swing: p("swing"), spread: p("spread") },
|
|
2026
2157
|
{ swing: p("elbow"), spread: p("bend") }
|
|
2027
2158
|
];
|
|
2028
|
-
const c = (
|
|
2159
|
+
const c = (h.side ?? 1) * p("rotate"), u = 1 - Math.cos(Vo(p("rotate")));
|
|
2029
2160
|
return [
|
|
2030
2161
|
{ swing: p("swing"), spread: p("spread"), yaw: c },
|
|
2031
2162
|
{ swing: -p("knee"), spread: 0, yaw: c },
|
|
2032
2163
|
// The foot points forward, square to the shin, turned out a little (more with `toeOut`).
|
|
2033
|
-
{ swing: 90 + p("ankle") -
|
|
2164
|
+
{ swing: 90 + p("ankle") - u * (p("swing") - p("knee")), spread: 0, yaw: (Qo + p("toeOut")) * (h.side ?? 1) }
|
|
2034
2165
|
];
|
|
2035
2166
|
},
|
|
2036
|
-
withAngles(
|
|
2037
|
-
const [
|
|
2038
|
-
return
|
|
2039
|
-
...
|
|
2167
|
+
withAngles(a, h, f) {
|
|
2168
|
+
const [g, p] = h.id.split("."), c = (u) => `${g}.${p}.${u}`;
|
|
2169
|
+
return g === "arm" ? {
|
|
2170
|
+
...a,
|
|
2040
2171
|
[c("swing")]: f[0].swing,
|
|
2041
2172
|
[c("spread")]: f[0].spread,
|
|
2042
2173
|
[c("elbow")]: f[1].swing,
|
|
2043
2174
|
[c("bend")]: f[1].spread
|
|
2044
|
-
} :
|
|
2175
|
+
} : g === "leg" ? { ...a, [c("swing")]: f[0].swing, [c("spread")]: f[0].spread, [c("knee")]: -f[1].swing } : a;
|
|
2045
2176
|
},
|
|
2046
|
-
boneScale(
|
|
2047
|
-
const f = Math.min(3, Math.max(0.3, s(
|
|
2048
|
-
return
|
|
2177
|
+
boneScale(a, h) {
|
|
2178
|
+
const f = Math.min(3, Math.max(0.3, s(a, "stretch")));
|
|
2179
|
+
return h?.id.startsWith("arm.") ? Math.sqrt(f) : f;
|
|
2049
2180
|
},
|
|
2050
|
-
headPose(
|
|
2051
|
-
const
|
|
2181
|
+
headPose(a) {
|
|
2182
|
+
const h = Math.min(3, Math.max(0.3, s(a, "stretch")));
|
|
2052
2183
|
return {
|
|
2053
|
-
yaw: s(
|
|
2054
|
-
nod: s(
|
|
2055
|
-
tilt: s(
|
|
2184
|
+
yaw: s(a, "head.turn"),
|
|
2185
|
+
nod: s(a, "head.nod"),
|
|
2186
|
+
tilt: s(a, "head.tilt"),
|
|
2056
2187
|
// The head keeps its area: taller and narrower when stretched.
|
|
2057
|
-
sx: 1 / Math.sqrt(
|
|
2058
|
-
sy: Math.sqrt(
|
|
2188
|
+
sx: 1 / Math.sqrt(h),
|
|
2189
|
+
sy: Math.sqrt(h)
|
|
2059
2190
|
};
|
|
2060
2191
|
},
|
|
2061
2192
|
landmarks: {
|
|
@@ -2077,15 +2208,15 @@ function Go(e = {}) {
|
|
|
2077
2208
|
}
|
|
2078
2209
|
};
|
|
2079
2210
|
}
|
|
2080
|
-
function
|
|
2211
|
+
function Dr(e) {
|
|
2081
2212
|
const t = e.split(".");
|
|
2082
2213
|
if (t[0] === "hand" && t.length >= 3) {
|
|
2083
|
-
const
|
|
2084
|
-
return `${
|
|
2214
|
+
const o = `${t[1] === "left" ? "Left" : "Right"} hand`, r = { spread: "finger spread", turn: "wrist turn", bend: "wrist bend", tilt: "wrist tilt", roll: "roll" }, l = t.slice(2).join(".");
|
|
2215
|
+
return `${o} · ${r[l] ?? l.replace(".curl", " curl").replace(".across", " across")}`;
|
|
2085
2216
|
}
|
|
2086
2217
|
if (t.length === 3) {
|
|
2087
|
-
const [
|
|
2088
|
-
return `${`${
|
|
2218
|
+
const [o, r, l] = t;
|
|
2219
|
+
return `${`${r === "left" ? "Left" : "Right"} ${o}`} · ${{
|
|
2089
2220
|
swing: "forward / back",
|
|
2090
2221
|
spread: "out / in",
|
|
2091
2222
|
elbow: "elbow bend",
|
|
@@ -2119,248 +2250,248 @@ function Br(e) {
|
|
|
2119
2250
|
lookY: "Look up / down"
|
|
2120
2251
|
}[e] ?? e;
|
|
2121
2252
|
}
|
|
2122
|
-
const
|
|
2253
|
+
const or = {
|
|
2123
2254
|
leftEye: "eye.left",
|
|
2124
2255
|
rightEye: "eye.right",
|
|
2125
2256
|
leftBrow: "brow.left",
|
|
2126
2257
|
rightBrow: "brow.right"
|
|
2127
|
-
},
|
|
2258
|
+
}, Xr = Object.fromEntries(
|
|
2128
2259
|
Object.entries(J).map(([e, t]) => [
|
|
2129
2260
|
e,
|
|
2130
|
-
Object.fromEntries(Object.entries(t).map(([n,
|
|
2261
|
+
Object.fromEntries(Object.entries(t).map(([n, o]) => [or[n] ?? n, o]))
|
|
2131
2262
|
])
|
|
2132
2263
|
);
|
|
2133
|
-
function
|
|
2134
|
-
const n = Math.min(1, Math.max(0, e.turn ?? 0)),
|
|
2264
|
+
function qr(e, t) {
|
|
2265
|
+
const n = Math.min(1, Math.max(0, e.turn ?? 0)), o = 1 - n, r = { ...te, turn: n }, l = [
|
|
2135
2266
|
{ stick: "right", human: "left", s: 1 },
|
|
2136
2267
|
{ stick: "left", human: "right", s: -1 }
|
|
2137
2268
|
];
|
|
2138
|
-
for (const { stick: i, human: s, s:
|
|
2139
|
-
const
|
|
2140
|
-
|
|
2141
|
-
const
|
|
2142
|
-
|
|
2269
|
+
for (const { stick: i, human: s, s: a } of l) {
|
|
2270
|
+
const h = e[`${i}Shoulder`], f = e[`${i}Elbow`];
|
|
2271
|
+
r[`arm.${s}.spread`] = h * o, r[`arm.${s}.swing`] = a * h * n, r[`arm.${s}.bend`] = f * o, r[`arm.${s}.elbow`] = a * f * n;
|
|
2272
|
+
const g = e[`${i}Hip`], p = e[`${i}Knee`], c = o + a * n;
|
|
2273
|
+
r[`leg.${s}.rotate`] = 90 * o, r[`leg.${s}.spread`] = 0, r[`leg.${s}.swing`] = g * c, r[`leg.${s}.knee`] = p * c, r[`leg.${s}.ankle`] = -(e[`${i}Ankle`] ?? 0), r[`leg.${s}.toeOut`] = (e[`${i}FootOut`] ?? 0) * rr, r[`eye.${s}`] = e[`${i}Eye`], r[`brow.${s}`] = e[`${i}Brow`], t && Object.assign(r, lr(s, t[i] ?? R, e[`${i}Wrist`] ?? 0, n));
|
|
2143
2274
|
}
|
|
2144
|
-
|
|
2145
|
-
for (const i of ["mouth", "smile", "mouthWidth", "blink", "browTilt", "lookX", "lookY", "stretch"])
|
|
2146
|
-
return
|
|
2275
|
+
r.lean = e.lean * n, r.side = e.lean * o, r["head.tilt"] = e.headTilt * o, r["head.nod"] = e.headTilt * n;
|
|
2276
|
+
for (const i of ["mouth", "smile", "mouthWidth", "blink", "browTilt", "lookX", "lookY", "stretch"]) r[i] = e[i];
|
|
2277
|
+
return r.lift = e.rise ?? 0, r.roll = e.spin ?? 0, r;
|
|
2147
2278
|
}
|
|
2148
|
-
const
|
|
2149
|
-
function
|
|
2150
|
-
const
|
|
2279
|
+
const rr = 70;
|
|
2280
|
+
function lr(e, t, n, o) {
|
|
2281
|
+
const r = e === "right" ? 1 - o : 1 + o, l = {};
|
|
2151
2282
|
for (const i of Object.keys(R)) l[`hand.${e}.${i}`] = t[i] ?? R[i];
|
|
2152
|
-
return l[`hand.${e}.turn`] = (t.turn ?? 0) -
|
|
2283
|
+
return l[`hand.${e}.turn`] = (t.turn ?? 0) - r, l[`hand.${e}.roll`] = (t.roll ?? 0) + n, l;
|
|
2153
2284
|
}
|
|
2154
|
-
function
|
|
2155
|
-
const
|
|
2156
|
-
e.save(), e.translate(t.x, t.y), e.rotate((n.angle ?? -30) * Math.PI / 180), e.fillStyle = n.color ?? "#f4c542", e.fillRect(i, -l, s - i, 2 * l), e.fillStyle = "#e8b4a0", e.fillRect(s, -l,
|
|
2157
|
-
const
|
|
2158
|
-
[{ x: 0, y: 0 }, { x: i, y: -l }, { x:
|
|
2285
|
+
function sr(e, t, n = {}, o) {
|
|
2286
|
+
const r = n.length ?? 240, l = 9, i = 28, s = r - 22;
|
|
2287
|
+
e.save(), e.translate(t.x, t.y), e.rotate((n.angle ?? -30) * Math.PI / 180), e.fillStyle = n.color ?? "#f4c542", e.fillRect(i, -l, s - i, 2 * l), e.fillStyle = "#e8b4a0", e.fillRect(s, -l, r - s, 2 * l), e.fillStyle = "#f1dcbf", e.beginPath(), e.moveTo(0, 0), e.lineTo(i, -l), e.lineTo(i, l), e.closePath(), e.fill(), e.fillStyle = n.outline ?? "#2f2f33", e.beginPath(), e.moveTo(0, 0), e.lineTo(i * 0.35, -l * 0.35), e.lineTo(i * 0.35, l * 0.35), e.closePath(), e.fill(), e.strokeStyle = n.outline ?? "#2f2f33", e.lineWidth = 3, e.lineJoin = "round", e.lineCap = "round";
|
|
2288
|
+
const a = [
|
|
2289
|
+
[{ x: 0, y: 0 }, { x: i, y: -l }, { x: r, y: -l }, { x: r, y: l }, { x: i, y: l }, { x: 0, y: 0 }],
|
|
2159
2290
|
[{ x: i, y: -l }, { x: i, y: l }],
|
|
2160
2291
|
[{ x: s, y: -l }, { x: s, y: l }]
|
|
2161
2292
|
];
|
|
2162
|
-
for (const
|
|
2293
|
+
for (const h of a) nn(e, h, o);
|
|
2163
2294
|
e.restore();
|
|
2164
2295
|
}
|
|
2165
|
-
function
|
|
2166
|
-
const
|
|
2296
|
+
function Vt(e, t, n = {}, o) {
|
|
2297
|
+
const r = n.length ?? 90, l = n.thickness ?? 34;
|
|
2167
2298
|
e.save(), e.translate(t.x, t.y), e.rotate((n.angle ?? -35) * Math.PI / 180);
|
|
2168
2299
|
const i = -l / 2;
|
|
2169
|
-
e.fillStyle = n.color ?? "#f4a7b9", e.fillRect(0, i,
|
|
2300
|
+
e.fillStyle = n.color ?? "#f4a7b9", e.fillRect(0, i, r, l), e.fillStyle = "#e9edf2", e.fillRect(r * 0.45, i, r * 0.55, l), e.strokeStyle = n.outline ?? "#2f2f33", e.lineWidth = 3, e.lineJoin = "round";
|
|
2170
2301
|
const s = [
|
|
2171
2302
|
{ x: 0, y: i },
|
|
2172
|
-
{ x:
|
|
2173
|
-
{ x:
|
|
2303
|
+
{ x: r, y: i },
|
|
2304
|
+
{ x: r, y: -i },
|
|
2174
2305
|
{ x: 0, y: -i },
|
|
2175
2306
|
{ x: 0, y: i }
|
|
2176
|
-
],
|
|
2177
|
-
if (
|
|
2178
|
-
|
|
2307
|
+
], a = [{ x: r * 0.45, y: i }, { x: r * 0.45, y: -i }];
|
|
2308
|
+
if (o)
|
|
2309
|
+
o.line(s), o.line(a);
|
|
2179
2310
|
else
|
|
2180
|
-
for (const
|
|
2181
|
-
e.beginPath(), e.moveTo(
|
|
2182
|
-
for (const f of
|
|
2311
|
+
for (const h of [s, a]) {
|
|
2312
|
+
e.beginPath(), e.moveTo(h[0].x, h[0].y);
|
|
2313
|
+
for (const f of h.slice(1)) e.lineTo(f.x, f.y);
|
|
2183
2314
|
e.stroke();
|
|
2184
2315
|
}
|
|
2185
2316
|
e.restore();
|
|
2186
2317
|
}
|
|
2187
|
-
const
|
|
2188
|
-
function
|
|
2189
|
-
const
|
|
2190
|
-
|
|
2191
|
-
const p = { x: t.x + f.x + 6 *
|
|
2192
|
-
const
|
|
2193
|
-
return { pinch: W, direction: Math.atan2(
|
|
2194
|
-
}, d =
|
|
2195
|
-
|
|
2196
|
-
size:
|
|
2318
|
+
const en = 150, ir = { pencil: 44, eraser: 30 };
|
|
2319
|
+
function tn(e, t, n = {}, o) {
|
|
2320
|
+
const r = n.tool ?? "pencil", l = n.skin ?? "#f1c9a5", i = n.outline ?? "#2f2f33", s = n.scale ?? 1, a = Math.min(1, Math.max(0, n.lift ?? 0)), h = (n.angle ?? -30) * Math.PI / 180, f = o ? o.nudge(0.6) : { x: 0, y: 0 }, g = en * s * (1 + 0.05 * a);
|
|
2321
|
+
a > 0 && (e.save(), e.fillStyle = i, e.globalAlpha = 0.15 * a, e.beginPath(), e.ellipse(t.x, t.y, 9 * s, 4 * s, 0, 0, Math.PI * 2), e.fill(), e.restore());
|
|
2322
|
+
const p = { x: t.x + f.x + 6 * a * s, y: t.y + f.y - 18 * a * s }, c = N.pencilGrip, u = (E) => {
|
|
2323
|
+
const T = E.fingers.thumb, A = E.fingers.index, I = E.fingers.middle, W = Kt([T.points[3], A.points[3], I.points[3]]), v = Kt([T.points[1], A.points[0]]), y = (T.depths[3] + A.depths[3] + I.depths[3]) / 3;
|
|
2324
|
+
return { pinch: W, direction: Math.atan2(v.y - W.y, v.x - W.x), depth: y };
|
|
2325
|
+
}, d = je(c, { size: g }), b = h - u(d).direction, m = je(c, { size: g, angle: b * 180 / Math.PI }), w = u(m), S = ir[r] * s, M = { x: w.pinch.x - Math.cos(h) * S, y: w.pinch.y - Math.sin(h) * S }, H = { x: p.x - M.x, y: p.y - M.y }, k = m.axes.up;
|
|
2326
|
+
ar(e, H, { x: -k.x, y: -k.y }, g, n.arm ?? 300 * s, l, n.sleeve ?? "#5b7db1", i), st(e, H, c, {
|
|
2327
|
+
size: g,
|
|
2197
2328
|
angle: b * 180 / Math.PI,
|
|
2198
2329
|
skin: l,
|
|
2199
2330
|
ink: i,
|
|
2200
2331
|
lineWidth: 3 * s,
|
|
2201
2332
|
prop: {
|
|
2202
|
-
depth:
|
|
2333
|
+
depth: w.depth,
|
|
2203
2334
|
draw: () => {
|
|
2204
|
-
e.save(), e.translate(p.x, p.y), e.scale(s, s),
|
|
2335
|
+
e.save(), e.translate(p.x, p.y), e.scale(s, s), r === "eraser" ? Vt(e, { x: 0, y: 0 }, { angle: h * 180 / Math.PI, outline: i }, o) : sr(e, { x: 0, y: 0 }, { angle: h * 180 / Math.PI, length: 190, outline: i }, o), e.restore();
|
|
2205
2336
|
}
|
|
2206
2337
|
}
|
|
2207
2338
|
});
|
|
2208
2339
|
}
|
|
2209
|
-
const
|
|
2340
|
+
const Kt = (e) => ({
|
|
2210
2341
|
x: e.reduce((t, n) => t + n.x, 0) / e.length,
|
|
2211
2342
|
y: e.reduce((t, n) => t + n.y, 0) / e.length
|
|
2212
2343
|
});
|
|
2213
|
-
function
|
|
2214
|
-
const
|
|
2215
|
-
x: t.x + n.x * d +
|
|
2216
|
-
y: t.y + n.y * d +
|
|
2217
|
-
}),
|
|
2218
|
-
const b = e.createLinearGradient(t.x, t.y,
|
|
2219
|
-
return b.addColorStop(0, d), b.addColorStop(0.6, d), b.addColorStop(1,
|
|
2220
|
-
}, c = Math.min(
|
|
2221
|
-
e.save(), e.lineJoin = "round", e.lineCap = "round", e.lineWidth = 3 * (
|
|
2222
|
-
const
|
|
2223
|
-
e.beginPath(),
|
|
2224
|
-
}
|
|
2225
|
-
function
|
|
2226
|
-
const
|
|
2344
|
+
function ar(e, t, n, o, r, l, i, s) {
|
|
2345
|
+
const a = { x: -n.y, y: n.x }, h = o * 0.15, f = (d, b, m) => ({
|
|
2346
|
+
x: t.x + n.x * d + a.x * b * m,
|
|
2347
|
+
y: t.y + n.y * d + a.y * b * m
|
|
2348
|
+
}), g = f(r, 0, 0), p = (d) => {
|
|
2349
|
+
const b = e.createLinearGradient(t.x, t.y, g.x, g.y);
|
|
2350
|
+
return b.addColorStop(0, d), b.addColorStop(0.6, d), b.addColorStop(1, hr(d)), b;
|
|
2351
|
+
}, c = Math.min(o * 0.55, r * 0.35);
|
|
2352
|
+
e.save(), e.lineJoin = "round", e.lineCap = "round", e.lineWidth = 3 * (o / en), e.beginPath(), e.moveTo(f(-o * 0.1, -1, h).x, f(-o * 0.1, -1, h).y), e.lineTo(f(c + 4, -1, h * 1.1).x, f(c + 4, -1, h * 1.1).y), e.lineTo(f(c + 4, 1, h * 1.1).x, f(c + 4, 1, h * 1.1).y), e.lineTo(f(-o * 0.1, 1, h).x, f(-o * 0.1, 1, h).y), e.closePath(), e.fillStyle = l, e.fill(), e.strokeStyle = s, e.beginPath(), e.moveTo(f(0, -1, h).x, f(0, -1, h).y), e.lineTo(f(c, -1, h * 1.1).x, f(c, -1, h * 1.1).y), e.moveTo(f(0, 1, h).x, f(0, 1, h).y), e.lineTo(f(c, 1, h * 1.1).x, f(c, 1, h * 1.1).y), e.stroke();
|
|
2353
|
+
const u = [f(c, -1, h * 1.3), f(r, -1, h * 1.5), f(r, 1, h * 1.5), f(c, 1, h * 1.3)];
|
|
2354
|
+
e.beginPath(), u.forEach((d, b) => b ? e.lineTo(d.x, d.y) : e.moveTo(d.x, d.y)), e.closePath(), e.fillStyle = p(i), e.fill(), e.strokeStyle = p(s), e.beginPath(), e.moveTo(u[1].x, u[1].y), e.lineTo(u[0].x, u[0].y), e.lineTo(u[3].x, u[3].y), e.lineTo(u[2].x, u[2].y), e.stroke(), e.restore();
|
|
2355
|
+
}
|
|
2356
|
+
function Ur(e, t, n = {}) {
|
|
2357
|
+
const o = n.offstage ?? { x: 2e3, y: 1400 }, r = n.enter ?? 450, l = n.exit ?? 450, i = n.linger ?? 1500, s = [...e].filter((d) => d.path.length > 0).sort((d, b) => d.start - b.start), a = (d) => d.tool ?? "pencil", h = (d) => {
|
|
2227
2358
|
const b = Math.min(1, Math.max(0, d));
|
|
2228
2359
|
return b * b * (3 - 2 * b);
|
|
2229
|
-
}, f = (d, b, m) => ({ x: d.x + (b.x - d.x) * m, y: d.y + (b.y - d.y) * m }),
|
|
2230
|
-
if (
|
|
2231
|
-
const d =
|
|
2232
|
-
return { at:
|
|
2360
|
+
}, f = (d, b, m) => ({ x: d.x + (b.x - d.x) * m, y: d.y + (b.y - d.y) * m }), g = s.find((d) => t >= d.start && t <= d.end);
|
|
2361
|
+
if (g) {
|
|
2362
|
+
const d = g.end - g.start, b = d > 0 ? (t - g.start) / d : 1;
|
|
2363
|
+
return { at: rt(g.path, b), tool: a(g), lift: 0, drawing: !0 };
|
|
2233
2364
|
}
|
|
2234
|
-
const p = [...s].reverse().find((d) => d.end < t), c = s.find((d) => d.start > t),
|
|
2365
|
+
const p = [...s].reverse().find((d) => d.end < t), c = s.find((d) => d.start > t), u = (d) => d.path[d.path.length - 1];
|
|
2235
2366
|
if (p && c && c.start - p.end <= i) {
|
|
2236
|
-
const d = (t - p.end) / (c.start - p.end), b = d < 0.5 ?
|
|
2237
|
-
return { at: f(
|
|
2367
|
+
const d = (t - p.end) / (c.start - p.end), b = d < 0.5 ? a(p) : a(c);
|
|
2368
|
+
return { at: f(u(p), c.path[0], h(d)), tool: b, lift: Math.sin(Math.PI * d), drawing: !1 };
|
|
2238
2369
|
}
|
|
2239
|
-
if (c && c.start - t <=
|
|
2240
|
-
const d = 1 - (c.start - t) /
|
|
2241
|
-
return { at: f(
|
|
2370
|
+
if (c && c.start - t <= r) {
|
|
2371
|
+
const d = 1 - (c.start - t) / r;
|
|
2372
|
+
return { at: f(o, c.path[0], h(d)), tool: a(c), lift: 1 - h(d), drawing: !1 };
|
|
2242
2373
|
}
|
|
2243
2374
|
if (p && t - p.end <= l) {
|
|
2244
2375
|
const d = (t - p.end) / l;
|
|
2245
|
-
return { at: f(
|
|
2376
|
+
return { at: f(u(p), o, h(d)), tool: a(p), lift: h(d), drawing: !1 };
|
|
2246
2377
|
}
|
|
2247
2378
|
return null;
|
|
2248
2379
|
}
|
|
2249
|
-
function
|
|
2250
|
-
const l = Math.PI * 2 * (1 +
|
|
2251
|
-
for (let s = 0; s <=
|
|
2252
|
-
const
|
|
2253
|
-
i.push({ x: e + Math.cos(
|
|
2380
|
+
function zr(e, t, n, o = 0.08, r = 32) {
|
|
2381
|
+
const l = Math.PI * 2 * (1 + o), i = [];
|
|
2382
|
+
for (let s = 0; s <= r; s++) {
|
|
2383
|
+
const a = -Math.PI / 2 + l * s / r;
|
|
2384
|
+
i.push({ x: e + Math.cos(a) * n, y: t + Math.sin(a) * n });
|
|
2254
2385
|
}
|
|
2255
2386
|
return i;
|
|
2256
2387
|
}
|
|
2257
|
-
function
|
|
2258
|
-
const { path: t } = e, n = t.map((s) => s.x),
|
|
2388
|
+
function Gr(e) {
|
|
2389
|
+
const { path: t } = e, n = t.map((s) => s.x), o = t.map((s) => s.y), r = Math.min(...n), l = Math.min(...o), i = e.hand === !1 ? void 0 : e.hand === !0 || e.hand === void 0 ? {} : e.hand;
|
|
2259
2390
|
return {
|
|
2260
2391
|
type: "custom",
|
|
2261
|
-
x:
|
|
2392
|
+
x: r,
|
|
2262
2393
|
y: l,
|
|
2263
|
-
width: Math.max(1, Math.max(...n) -
|
|
2264
|
-
height: Math.max(1, Math.max(...
|
|
2394
|
+
width: Math.max(1, Math.max(...n) - r),
|
|
2395
|
+
height: Math.max(1, Math.max(...o) - l),
|
|
2265
2396
|
props: { draw: 0 },
|
|
2266
|
-
draw(s,
|
|
2267
|
-
const f = Math.min(1, Math.max(0, Number(
|
|
2268
|
-
s.translate(-
|
|
2269
|
-
const
|
|
2270
|
-
f > 0 && (
|
|
2397
|
+
draw(s, a, h) {
|
|
2398
|
+
const f = Math.min(1, Math.max(0, Number(a.props?.draw ?? 0)));
|
|
2399
|
+
s.translate(-r, -l), s.strokeStyle = e.color ?? "#2f2f33", s.lineWidth = e.lineWidth ?? 5, s.lineCap = "round", s.lineJoin = "round";
|
|
2400
|
+
const g = e.sketch ? Ge(s, e.sketch, h) : void 0;
|
|
2401
|
+
f > 0 && (g ? e.smooth ? g.curve(t, f) : g.line(t, f) : nn(s, It(t, f))), i && f > 0 && f < 1 && tn(s, rt(t, f), i, g);
|
|
2271
2402
|
}
|
|
2272
2403
|
};
|
|
2273
2404
|
}
|
|
2274
|
-
function
|
|
2405
|
+
function hr(e) {
|
|
2275
2406
|
const t = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());
|
|
2276
2407
|
if (!t) return "rgba(0, 0, 0, 0)";
|
|
2277
|
-
const n = t[1].length === 3 ? [...t[1]].map((i) => i + i).join("") : t[1], [
|
|
2278
|
-
return `rgba(${
|
|
2408
|
+
const n = t[1].length === 3 ? [...t[1]].map((i) => i + i).join("") : t[1], [o, r, l] = [0, 2, 4].map((i) => parseInt(n.slice(i, i + 2), 16));
|
|
2409
|
+
return `rgba(${o}, ${r}, ${l}, 0)`;
|
|
2279
2410
|
}
|
|
2280
|
-
function
|
|
2411
|
+
function nn(e, t, n) {
|
|
2281
2412
|
if (!(t.length < 2)) {
|
|
2282
2413
|
if (n) return n.line(t);
|
|
2283
2414
|
e.beginPath(), e.moveTo(t[0].x, t[0].y);
|
|
2284
|
-
for (const
|
|
2415
|
+
for (const o of t.slice(1)) e.lineTo(o.x, o.y);
|
|
2285
2416
|
e.stroke();
|
|
2286
2417
|
}
|
|
2287
2418
|
}
|
|
2288
|
-
const
|
|
2289
|
-
function
|
|
2290
|
-
const l = [], i = Math.max(1, Math.round(
|
|
2419
|
+
const Ee = 1e5;
|
|
2420
|
+
function Jr(e, t, n, o, r = 6) {
|
|
2421
|
+
const l = [], i = Math.max(1, Math.round(r));
|
|
2291
2422
|
for (let s = 0; s <= i; s++)
|
|
2292
|
-
l.push({ x: s % 2 === 0 ? e : e + n, y: t +
|
|
2423
|
+
l.push({ x: s % 2 === 0 ? e : e + n, y: t + o * s / i });
|
|
2293
2424
|
return l;
|
|
2294
2425
|
}
|
|
2295
|
-
function
|
|
2296
|
-
if (
|
|
2297
|
-
const
|
|
2298
|
-
e.beginPath(), e.rect(-
|
|
2426
|
+
function on(e, t, n, o) {
|
|
2427
|
+
if (o <= 0 || t.length === 0) return;
|
|
2428
|
+
const r = It(t, o), l = n / 2, i = (s) => {
|
|
2429
|
+
e.beginPath(), e.rect(-Ee, -Ee, 2 * Ee, 2 * Ee), s(), e.clip("evenodd");
|
|
2299
2430
|
};
|
|
2300
|
-
for (const s of
|
|
2431
|
+
for (const s of r)
|
|
2301
2432
|
i(() => {
|
|
2302
2433
|
e.moveTo(s.x + l, s.y), e.arc(s.x, s.y, l, 0, Math.PI * 2);
|
|
2303
2434
|
});
|
|
2304
|
-
for (let s = 1; s <
|
|
2305
|
-
const
|
|
2435
|
+
for (let s = 1; s < r.length; s++) {
|
|
2436
|
+
const a = r[s - 1], h = r[s], f = Math.hypot(h.x - a.x, h.y - a.y);
|
|
2306
2437
|
if (f === 0) continue;
|
|
2307
|
-
const
|
|
2438
|
+
const g = -(h.y - a.y) / f * l, p = (h.x - a.x) / f * l;
|
|
2308
2439
|
i(() => {
|
|
2309
|
-
e.moveTo(
|
|
2440
|
+
e.moveTo(a.x + g, a.y + p), e.lineTo(h.x + g, h.y + p), e.lineTo(h.x - g, h.y - p), e.lineTo(a.x - g, a.y - p), e.closePath();
|
|
2310
2441
|
});
|
|
2311
2442
|
}
|
|
2312
2443
|
}
|
|
2313
|
-
function
|
|
2314
|
-
e.save(),
|
|
2444
|
+
function Zr(e, t, n, o, r) {
|
|
2445
|
+
e.save(), on(e, t, n, o), r(), e.restore();
|
|
2315
2446
|
}
|
|
2316
|
-
function
|
|
2317
|
-
const n = t.width ?? 40,
|
|
2447
|
+
function jr(e, t) {
|
|
2448
|
+
const n = t.width ?? 40, o = t.hand === !0 ? {} : t.hand || void 0, r = t.eraser === !1 ? void 0 : t.eraser === !0 || t.eraser === void 0 ? {} : t.eraser;
|
|
2318
2449
|
return {
|
|
2319
2450
|
...e,
|
|
2320
2451
|
props: { ...e.props, erase: 0 },
|
|
2321
2452
|
draw(l, i, s) {
|
|
2322
|
-
const
|
|
2323
|
-
if (l.save(),
|
|
2324
|
-
const
|
|
2325
|
-
|
|
2453
|
+
const a = Number(i.props?.erase ?? 0);
|
|
2454
|
+
if (l.save(), on(l, t.path, n, a), e.draw(l, i, s), l.restore(), !r || a <= 0 || a >= 1) return;
|
|
2455
|
+
const h = rt(t.path, a);
|
|
2456
|
+
o ? tn(l, h, { ...o, tool: "eraser" }) : Vt(l, h, r);
|
|
2326
2457
|
}
|
|
2327
2458
|
};
|
|
2328
2459
|
}
|
|
2329
2460
|
const oe = (e) => e * Math.PI / 180;
|
|
2330
|
-
function
|
|
2331
|
-
const
|
|
2332
|
-
return [e, t *
|
|
2461
|
+
function rn([e, t, n], o) {
|
|
2462
|
+
const r = Math.cos(o), l = Math.sin(o);
|
|
2463
|
+
return [e, t * r + n * l, -t * l + n * r];
|
|
2333
2464
|
}
|
|
2334
|
-
function
|
|
2335
|
-
const
|
|
2336
|
-
return [e *
|
|
2465
|
+
function ln([e, t, n], o) {
|
|
2466
|
+
const r = Math.cos(o), l = Math.sin(o);
|
|
2467
|
+
return [e * r - t * l, e * l + t * r, n];
|
|
2337
2468
|
}
|
|
2338
|
-
function
|
|
2339
|
-
const
|
|
2340
|
-
return [e *
|
|
2469
|
+
function me([e, t, n], o) {
|
|
2470
|
+
const r = Math.cos(o), l = Math.sin(o);
|
|
2471
|
+
return [e * r + n * l, t, -e * l + n * r];
|
|
2341
2472
|
}
|
|
2342
|
-
const
|
|
2343
|
-
function
|
|
2344
|
-
const n =
|
|
2473
|
+
const Xe = (e, t) => [e[0] + t[0], e[1] + t[1], e[2] + t[2]], Pt = (e, t) => [e[0] * t, e[1] * t, e[2] * t], Ae = (e, t) => ln(rn(e, t.swing), t.spread);
|
|
2474
|
+
function qe(e, t) {
|
|
2475
|
+
const n = me(e, t);
|
|
2345
2476
|
return { point: { x: n[0], y: -n[1] }, depth: n[2] };
|
|
2346
2477
|
}
|
|
2347
|
-
function
|
|
2348
|
-
const
|
|
2478
|
+
function ct(e, t, n) {
|
|
2479
|
+
const o = n.height, r = oe(90 * (t.turn ?? 0)), i = [0, e.hipHeight * o * (e.boneScale?.(t, null) ?? 1), 0], s = {};
|
|
2349
2480
|
for (const y of e.chains) {
|
|
2350
2481
|
const x = y.parent ? s[y.parent] : void 0;
|
|
2351
2482
|
if (y.parent && !x) throw new Error(`body plan ${e.id}: chain ${y.id} comes before its parent ${y.parent}`);
|
|
2352
|
-
const O = y.at ?? (x ? x.joints3.length - 1 : 0), K = x ? x.joints3[O] : i, P = x ? x.frames[Math.max(0, O - 1)] : { swing: 0, spread: 0 },
|
|
2483
|
+
const O = y.at ?? (x ? x.joints3.length - 1 : 0), K = x ? x.joints3[O] : i, P = x ? x.frames[Math.max(0, O - 1)] : { swing: 0, spread: 0 }, B = y.offset ? Xe(K, Ae(Pt(y.offset, o), P)) : K, $ = y.side ?? 1, _ = e.boneScale?.(t, y) ?? 1, C = e.angles(t, y), L = [B], Q = [];
|
|
2353
2484
|
let ne = P.swing, Fe = P.spread;
|
|
2354
|
-
y.bones.forEach((
|
|
2355
|
-
const
|
|
2356
|
-
ne += oe(
|
|
2357
|
-
const
|
|
2358
|
-
L.push(
|
|
2485
|
+
y.bones.forEach((an, ut) => {
|
|
2486
|
+
const Re = C[ut] ?? { swing: 0, spread: 0 };
|
|
2487
|
+
ne += oe(Re.swing), Fe += oe(Re.spread) * $, Q.push({ swing: ne, spread: Fe });
|
|
2488
|
+
const hn = me(Ae(y.rest, { swing: ne, spread: Fe }), oe(Re.yaw ?? 0));
|
|
2489
|
+
L.push(Xe(L[ut], Pt(hn, an.length * o * _)));
|
|
2359
2490
|
}), s[y.id] = { joints3: L, frames: Q };
|
|
2360
2491
|
}
|
|
2361
|
-
const
|
|
2492
|
+
const a = s[e.head.on], h = e.headPose?.(t) ?? { yaw: 0, nod: 0, tilt: 0, sx: 1, sy: 1 }, f = a.frames[a.frames.length - 1], g = e.head.size / 2 * o, p = g * h.sx, c = g * h.sy, u = (y) => Ae(me(rn(ln(y, -oe(h.tilt)), -oe(h.nod)), oe(h.yaw)), f), d = Xe(a.joints3[a.joints3.length - 1], u([0, c, 0])), b = {};
|
|
2362
2493
|
for (const y of e.chains) {
|
|
2363
|
-
const { joints3: x, frames: O } = s[y.id], K = x.map((P) =>
|
|
2494
|
+
const { joints3: x, frames: O } = s[y.id], K = x.map((P) => qe(P, r));
|
|
2364
2495
|
b[y.id] = {
|
|
2365
2496
|
id: y.id,
|
|
2366
2497
|
joints3: x,
|
|
@@ -2369,10 +2500,10 @@ function ht(e, t, n) {
|
|
|
2369
2500
|
depths: K.map((P) => P.depth)
|
|
2370
2501
|
};
|
|
2371
2502
|
}
|
|
2372
|
-
const m =
|
|
2373
|
-
const x = y.x -
|
|
2374
|
-
return { x:
|
|
2375
|
-
},
|
|
2503
|
+
const m = qe(d, r), w = [[1, 0, 0], [0, 1, 0], [0, 0, 1]].map((y) => me(u(y), r)), S = qe(i, r).point, M = oe(t.roll ?? 0), H = (y) => {
|
|
2504
|
+
const x = y.x - S.x, O = y.y - S.y;
|
|
2505
|
+
return { x: S.x + x * Math.cos(M) - O * Math.sin(M), y: S.y + x * Math.sin(M) + O * Math.cos(M) };
|
|
2506
|
+
}, k = ([y, x, O]) => [y * Math.cos(M) + x * Math.sin(M), -y * Math.sin(M) + x * Math.cos(M), O];
|
|
2376
2507
|
for (const y of Object.values(b)) y.points = y.points.map(H);
|
|
2377
2508
|
const E = {
|
|
2378
2509
|
center: H(m.point),
|
|
@@ -2380,135 +2511,135 @@ function ht(e, t, n) {
|
|
|
2380
2511
|
rx: p,
|
|
2381
2512
|
ry: c,
|
|
2382
2513
|
angle: 0,
|
|
2383
|
-
axes:
|
|
2384
|
-
},
|
|
2385
|
-
E.angle = Math.atan2(
|
|
2514
|
+
axes: w.map(k)
|
|
2515
|
+
}, T = E.axes[1];
|
|
2516
|
+
E.angle = Math.atan2(T[0], T[1]);
|
|
2386
2517
|
const A = (y) => {
|
|
2387
|
-
if ("head" in y) return { x: E.center.x +
|
|
2518
|
+
if ("head" in y) return { x: E.center.x + T[0] * c, y: E.center.y - T[1] * c };
|
|
2388
2519
|
const x = b[y.chain];
|
|
2389
2520
|
return x.points[Math.min(y.joint, x.points.length - 1)];
|
|
2390
2521
|
};
|
|
2391
2522
|
let I = 0;
|
|
2392
|
-
(n.contact ?? "ground") === "ground" && (I = -Math.max(...e.contacts.map((y) => A(y).y))), I -= (t.lift ?? 0) *
|
|
2523
|
+
(n.contact ?? "ground") === "ground" && (I = -Math.max(...e.contacts.map((y) => A(y).y))), I -= (t.lift ?? 0) * o;
|
|
2393
2524
|
const W = (y) => ({ x: y.x, y: y.y + I });
|
|
2394
2525
|
for (const y of Object.values(b)) y.points = y.points.map(W);
|
|
2395
2526
|
E.center = W(E.center);
|
|
2396
|
-
const
|
|
2527
|
+
const v = e.contacts.map((y) => ({ spec: y, point: A(y) }));
|
|
2397
2528
|
return {
|
|
2398
|
-
height:
|
|
2399
|
-
view:
|
|
2529
|
+
height: o,
|
|
2530
|
+
view: r,
|
|
2400
2531
|
chains: b,
|
|
2401
2532
|
head: E,
|
|
2402
|
-
hip: W(H(
|
|
2403
|
-
contacts:
|
|
2404
|
-
groundY: Math.max(...
|
|
2533
|
+
hip: W(H(S)),
|
|
2534
|
+
contacts: v,
|
|
2535
|
+
groundY: Math.max(...v.map((y) => y.point.y))
|
|
2405
2536
|
};
|
|
2406
2537
|
}
|
|
2407
|
-
function
|
|
2408
|
-
const [
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
],
|
|
2413
|
-
return { point: { x: e.center.x + s[0], y: e.center.y - s[1] }, depth: e.depth + s[2], facing:
|
|
2538
|
+
function sn(e, [t, n, o]) {
|
|
2539
|
+
const [r, l, i] = e.axes, s = [
|
|
2540
|
+
r[0] * t * e.rx + l[0] * n * e.ry + i[0] * o * e.rx,
|
|
2541
|
+
r[1] * t * e.rx + l[1] * n * e.ry + i[1] * o * e.rx,
|
|
2542
|
+
r[2] * t * e.rx + l[2] * n * e.ry + i[2] * o * e.rx
|
|
2543
|
+
], a = Math.hypot(t, n, o) || 1, h = (r[2] * t + l[2] * n + i[2] * o) / a;
|
|
2544
|
+
return { point: { x: e.center.x + s[0], y: e.center.y - s[1] }, depth: e.depth + s[2], facing: h };
|
|
2414
2545
|
}
|
|
2415
|
-
const
|
|
2416
|
-
const t =
|
|
2546
|
+
const He = (e) => e * 180 / Math.PI, he = (e, t) => [e[0] - t[0], e[1] - t[1], e[2] - t[2]], Ue = (e, t) => e[0] * t[0] + e[1] * t[1] + e[2] * t[2], de = (e) => Math.hypot(e[0], e[1], e[2]), nt = (e) => {
|
|
2547
|
+
const t = de(e) || 1;
|
|
2417
2548
|
return [e[0] / t, e[1] / t, e[2] / t];
|
|
2418
|
-
},
|
|
2419
|
-
function
|
|
2420
|
-
const [t, n,
|
|
2421
|
-
return { swing: Math.asin(Math.max(-1, Math.min(1,
|
|
2549
|
+
}, Me = (e) => Math.atan2(Math.sin(e), Math.cos(e));
|
|
2550
|
+
function Wt(e) {
|
|
2551
|
+
const [t, n, o] = nt(e);
|
|
2552
|
+
return { swing: Math.asin(Math.max(-1, Math.min(1, o))), spread: Math.atan2(t, -n) };
|
|
2422
2553
|
}
|
|
2423
|
-
function
|
|
2554
|
+
function fr(e, t, n, o, r) {
|
|
2424
2555
|
const l = e.chains.find((I) => I.id === n);
|
|
2425
2556
|
if (!l) throw new Error(`reach: no chain ${n} in ${e.id}`);
|
|
2426
2557
|
if (l.bones.length < 2 || l.rest[1] > -0.99) throw new Error(`reach: ${n} is not a hanging limb of two bones or more`);
|
|
2427
2558
|
if (!e.withAngles) throw new Error(`reach: the ${e.id} plan cannot set angles`);
|
|
2428
|
-
const i =
|
|
2429
|
-
let m =
|
|
2430
|
-
|
|
2431
|
-
const
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
], H = [
|
|
2436
|
-
{ swing:
|
|
2437
|
-
{ swing:
|
|
2559
|
+
const i = ct(e, { ...t, turn: 0, roll: 0, lift: 0 }, { height: r.height, contact: "none" }), s = i.chains[n], a = s.joints3[0], h = de(he(s.joints3[1], s.joints3[0])), f = de(he(s.joints3[2], s.joints3[1])), g = l.parent ? i.chains[l.parent].frames[Math.max(0, (l.at ?? i.chains[l.parent].joints3.length - 1) - 1)] : { swing: 0, spread: 0 }, p = he(o, a), c = Math.min(h + f - 1e-6, Math.max(Math.abs(h - f) + 1e-6, de(p))), u = nt(p), d = l.parent !== null, b = Ae(l.pole ?? (d ? [0, -0.35, -1] : [0, 0, 1]), g);
|
|
2560
|
+
let m = he(b, [u[0] * Ue(b, u), u[1] * Ue(b, u), u[2] * Ue(b, u)]);
|
|
2561
|
+
de(m) < 1e-6 && (m = me([1, 0, 0], 0)), m = nt(m);
|
|
2562
|
+
const w = (h * h + c * c - f * f) / (2 * h * c), S = Math.sqrt(Math.max(0, 1 - w * w)), M = [
|
|
2563
|
+
a[0] + h * (w * u[0] + S * m[0]),
|
|
2564
|
+
a[1] + h * (w * u[1] + S * m[1]),
|
|
2565
|
+
a[2] + h * (w * u[2] + S * m[2])
|
|
2566
|
+
], H = [a[0] + u[0] * c, a[1] + u[1] * c, a[2] + u[2] * c], k = l.side ?? 1, E = Wt(he(M, a)), T = Wt(he(H, M)), A = [
|
|
2567
|
+
{ swing: He(Me(E.swing - g.swing)), spread: He(Me(E.spread - g.spread)) * k },
|
|
2568
|
+
{ swing: He(Me(T.swing - E.swing)), spread: He(Me(T.spread - E.spread)) * k }
|
|
2438
2569
|
];
|
|
2439
2570
|
return e.withAngles(t, l, A);
|
|
2440
2571
|
}
|
|
2441
|
-
const
|
|
2572
|
+
const cr = 0.34, re = 0.12, j = -0.4, ee = (e, t, n) => e[t] ?? n, gr = (e, t) => Math.max(0, e) * (1 - Math.min(1, Math.max(0, t))), ur = 0.45, dr = 0.35, pr = 0.7;
|
|
2442
2573
|
function Be(e, t, n) {
|
|
2443
|
-
const
|
|
2574
|
+
const o = (c) => Math.sqrt(Math.max(0, 1 - c.x * c.x - c.y * c.y)), r = sn(e, [n.x, n.y, o(n)]).facing, l = e.axes[2], i = Math.atan2(l[0], l[2]), s = Math.cos(i), a = s >= 0 ? 1 : -1, h = a * Math.max(dr, Math.abs(s)), f = a * Math.max(pr, Math.abs(s)), g = Math.cos(e.angle), p = Math.sin(e.angle);
|
|
2444
2575
|
return {
|
|
2445
|
-
facing:
|
|
2576
|
+
facing: r,
|
|
2446
2577
|
points: t.map((c) => {
|
|
2447
|
-
const
|
|
2448
|
-
return { x: e.center.x + b *
|
|
2578
|
+
const u = ur * Math.sin(i) + n.x * h + (c.x - n.x) * f, d = c.y + l[1] * o(c), b = u * e.rx, m = d * e.ry;
|
|
2579
|
+
return { x: e.center.x + b * g + m * p, y: e.center.y + b * p - m * g };
|
|
2449
2580
|
})
|
|
2450
2581
|
};
|
|
2451
2582
|
}
|
|
2452
|
-
const
|
|
2453
|
-
const i = l /
|
|
2583
|
+
const ve = (e, t, n, o = 12) => Array.from({ length: o + 1 }, (r, l) => {
|
|
2584
|
+
const i = l / o, s = 1 - i;
|
|
2454
2585
|
return { x: s * s * e.x + 2 * s * i * t.x + i * i * n.x, y: s * s * e.y + 2 * s * i * t.y + i * i * n.y };
|
|
2455
|
-
}),
|
|
2456
|
-
const s = Math.PI * 2 * i /
|
|
2457
|
-
return { x: e + Math.cos(s) * n, y: t + Math.sin(s) *
|
|
2458
|
-
}),
|
|
2459
|
-
function
|
|
2460
|
-
const
|
|
2586
|
+
}), ze = (e, t, n, o, r = 16) => Array.from({ length: r }, (l, i) => {
|
|
2587
|
+
const s = Math.PI * 2 * i / r;
|
|
2588
|
+
return { x: e + Math.cos(s) * n, y: t + Math.sin(s) * o };
|
|
2589
|
+
}), Ot = 0.05;
|
|
2590
|
+
function br(e, t, n, o) {
|
|
2591
|
+
const r = Math.max(1, Math.min(o * 0.6, 0.14 * t.rx)), l = (m, w) => Be(t, m, w).points, i = (m, w) => Be(t, [], { x: m, y: w }).facing, s = ee(n, "smile", 0), a = ee(n, "blink", 0), h = ee(n, "lookX", 0), f = ee(n, "lookY", 0), g = ee(n, "browTilt", 0);
|
|
2461
2592
|
for (const m of [1, -1]) {
|
|
2462
|
-
const
|
|
2463
|
-
if (i(
|
|
2464
|
-
const
|
|
2593
|
+
const w = m === 1 ? "left" : "right", S = cr * m;
|
|
2594
|
+
if (i(S, re) < Ot) continue;
|
|
2595
|
+
const M = { x: S, y: re }, H = gr(ee(n, `eye.${w}`, 1), a);
|
|
2465
2596
|
if (H < 0.2) {
|
|
2466
2597
|
const A = s > 0.5 ? 0.12 : -0.06;
|
|
2467
|
-
e.line(l(
|
|
2598
|
+
e.line(l(ve({ x: S - 0.12, y: re }, { x: S, y: re + A }, { x: S + 0.12, y: re }), M), r);
|
|
2468
2599
|
} else {
|
|
2469
2600
|
if (H > 1.2) {
|
|
2470
|
-
const
|
|
2471
|
-
e.shape(l(
|
|
2601
|
+
const v = 0.13 * H;
|
|
2602
|
+
e.shape(l(ze(S, re, v * 0.85, v), M), "#ffffff", r);
|
|
2472
2603
|
}
|
|
2473
|
-
const A = H > 1.2 ? 0.075 : 0.1, I =
|
|
2474
|
-
e.shape(l(
|
|
2604
|
+
const A = H > 1.2 ? 0.075 : 0.1, I = S + h * 0.08, W = re - f * 0.07;
|
|
2605
|
+
e.shape(l(ze(I, W, A, A * 1.1 * Math.min(H, 1)), M), e.ink, 0);
|
|
2475
2606
|
}
|
|
2476
|
-
const
|
|
2477
|
-
e.line(l([E, { x: (E.x +
|
|
2607
|
+
const k = re + 0.3 + ee(n, `brow.${w}`, 0) * 0.14 + Math.max(0, H - 1) * 0.12, E = { x: S + m * 0.13, y: k }, T = { x: S - m * 0.13, y: k + g * 0.1 };
|
|
2608
|
+
e.line(l([E, { x: (E.x + T.x) / 2, y: (E.y + T.y) / 2 }, T], { x: S, y: k }), r);
|
|
2478
2609
|
}
|
|
2479
2610
|
const p = { x: 0, y: j };
|
|
2480
|
-
if (i(0, j) < -
|
|
2481
|
-
const c = 0.25 * Math.max(0.3, ee(n, "mouthWidth", 1)),
|
|
2482
|
-
if (
|
|
2483
|
-
e.line(l(
|
|
2611
|
+
if (i(0, j) < -Ot) return;
|
|
2612
|
+
const c = 0.25 * Math.max(0.3, ee(n, "mouthWidth", 1)), u = Math.min(1, Math.max(0, ee(n, "mouth", 0)));
|
|
2613
|
+
if (u <= 0.05) {
|
|
2614
|
+
e.line(l(ve({ x: -c, y: j }, { x: 0, y: j - s * 0.25 }, { x: c, y: j }), p), r);
|
|
2484
2615
|
return;
|
|
2485
2616
|
}
|
|
2486
|
-
const d = 0.3 *
|
|
2617
|
+
const d = 0.3 * u;
|
|
2487
2618
|
let b;
|
|
2488
2619
|
if (s > 0.3) {
|
|
2489
2620
|
const m = j + 0.05;
|
|
2490
|
-
b = [...
|
|
2621
|
+
b = [...ve({ x: c, y: m }, { x: 0, y: j - d * 2 }, { x: -c, y: m })];
|
|
2491
2622
|
} else if (s < -0.3) {
|
|
2492
2623
|
const m = j - d * 0.6;
|
|
2493
|
-
b = [...
|
|
2624
|
+
b = [...ve({ x: c, y: m }, { x: 0, y: j + d * 1.4 }, { x: -c, y: m })];
|
|
2494
2625
|
} else
|
|
2495
|
-
b =
|
|
2626
|
+
b = ze(0, j, c * 0.8, d);
|
|
2496
2627
|
e.shape(l(b, p), e.ink, 0);
|
|
2497
2628
|
}
|
|
2498
|
-
function
|
|
2499
|
-
const t = (e.proportions ?? "bold") === "bold", n = e.figure ?? "fluid",
|
|
2629
|
+
function Qr(e = {}) {
|
|
2630
|
+
const t = (e.proportions ?? "bold") === "bold", n = e.figure ?? "fluid", o = e.look ?? "clean", r = e.height ?? 300, l = n === "stick";
|
|
2500
2631
|
return {
|
|
2501
|
-
plan: e.plan ??
|
|
2632
|
+
plan: e.plan ?? nr({
|
|
2502
2633
|
headSize: e.headSize ?? (t ? 0.3 : 0.24),
|
|
2503
2634
|
shoulderWidth: l ? 0 : e.shoulderWidth ?? 0.06,
|
|
2504
2635
|
hipWidth: l ? 0 : e.hipWidth ?? 0.022
|
|
2505
2636
|
}),
|
|
2506
2637
|
figure: n,
|
|
2507
|
-
look:
|
|
2508
|
-
height:
|
|
2509
|
-
lineWidth: e.lineWidth ??
|
|
2510
|
-
ink: e.ink ?? (
|
|
2511
|
-
skin: e.skin ?? (
|
|
2638
|
+
look: o,
|
|
2639
|
+
height: r,
|
|
2640
|
+
lineWidth: e.lineWidth ?? r * (t ? 0.045 : 0.022),
|
|
2641
|
+
ink: e.ink ?? (o === "pencil" ? "#2f2f33" : "#1e293b"),
|
|
2642
|
+
skin: e.skin ?? (o === "pencil" ? "none" : "#ffffff"),
|
|
2512
2643
|
seed: e.seed ?? 1,
|
|
2513
2644
|
pencil: e.pencil ?? {},
|
|
2514
2645
|
layers: e.layers ?? {},
|
|
@@ -2518,107 +2649,107 @@ function Dr(e = {}) {
|
|
|
2518
2649
|
handSize: e.handSize ?? (e.handStyle === "natural" ? 0.14 : 0.17)
|
|
2519
2650
|
};
|
|
2520
2651
|
}
|
|
2521
|
-
function
|
|
2522
|
-
const { point:
|
|
2523
|
-
return { point:
|
|
2652
|
+
function Vr(e, t, n, o) {
|
|
2653
|
+
const { point: r, facing: l } = sn(e, [t, n, o]);
|
|
2654
|
+
return { point: r, facing: l };
|
|
2524
2655
|
}
|
|
2525
|
-
const
|
|
2526
|
-
function
|
|
2527
|
-
return e.figure === "stick" ?
|
|
2656
|
+
const ot = (e) => e.rest[1] < -0.5, mr = 0.3;
|
|
2657
|
+
function yr(e, t, n) {
|
|
2658
|
+
return e.figure === "stick" ? ot(t) ? n.slice(0, 3) : n : ot(t) && n.length >= 3 ? fe(n[0], n[1], n[2], mr) : n.length === 3 ? fe(n[0], n[1], n[2], 1) : n;
|
|
2528
2659
|
}
|
|
2529
|
-
function
|
|
2530
|
-
const n = e.plan.id === "human" ? { ...te, ...t } : t,
|
|
2660
|
+
function gt(e, t) {
|
|
2661
|
+
const n = e.plan.id === "human" ? { ...te, ...t } : t, o = ct(e.plan, n, { height: e.height, contact: e.contact }), r = {}, l = {}, i = {}, s = 0.01 * e.height;
|
|
2531
2662
|
e.plan.chains.forEach((c) => {
|
|
2532
|
-
const
|
|
2533
|
-
|
|
2534
|
-
const d =
|
|
2535
|
-
i[c.id] = Math.abs(
|
|
2536
|
-
}), l.head = { points: [
|
|
2537
|
-
const
|
|
2538
|
-
for (const [c, [
|
|
2539
|
-
const b =
|
|
2663
|
+
const u = o.chains[c.id];
|
|
2664
|
+
r[c.id] = u.points;
|
|
2665
|
+
const d = u.depths.reduce((S, M) => S + M, 0) / u.depths.length, b = c.parent ? o.chains[c.parent] : void 0, m = b ? b.depths[c.at ?? b.depths.length - 1] : 0, w = d - m;
|
|
2666
|
+
i[c.id] = Math.abs(w) < s ? 0 : w, l[c.id] = { points: yr(e, c, u.points), depth: d };
|
|
2667
|
+
}), l.head = { points: [o.head.center], depth: o.head.depth }, i.head = 0;
|
|
2668
|
+
const a = [...e.plan.chains.map((c) => c.id), "head"], h = [...a].sort((c, u) => i[c] - i[u] || a.indexOf(c) - a.indexOf(u)), f = { hip: o.hip };
|
|
2669
|
+
for (const [c, [u, d]] of Object.entries(e.plan.landmarks ?? {})) {
|
|
2670
|
+
const b = o.chains[u]?.points;
|
|
2540
2671
|
b && (f[c] = b[Math.min(d, b.length - 1)]);
|
|
2541
2672
|
}
|
|
2542
|
-
const
|
|
2543
|
-
for (const [c,
|
|
2673
|
+
const g = {};
|
|
2674
|
+
for (const [c, u] of Object.entries(f)) g[c] = u.y >= o.groundY - 0.01 * e.height;
|
|
2544
2675
|
const p = {
|
|
2545
2676
|
height: e.height,
|
|
2546
2677
|
lineWidth: e.lineWidth,
|
|
2547
2678
|
turn: n.turn ?? 0,
|
|
2548
2679
|
points: f,
|
|
2549
|
-
chains:
|
|
2680
|
+
chains: r,
|
|
2550
2681
|
parts: l,
|
|
2551
|
-
head:
|
|
2552
|
-
groundY:
|
|
2553
|
-
grounded:
|
|
2682
|
+
head: o.head,
|
|
2683
|
+
groundY: o.groundY,
|
|
2684
|
+
grounded: g
|
|
2554
2685
|
};
|
|
2555
|
-
return { skeleton:
|
|
2686
|
+
return { skeleton: o, joints: p, order: h };
|
|
2556
2687
|
}
|
|
2557
|
-
function
|
|
2558
|
-
return
|
|
2688
|
+
function wr(e, t) {
|
|
2689
|
+
return gt(e, t).joints;
|
|
2559
2690
|
}
|
|
2560
|
-
function
|
|
2561
|
-
const { head:
|
|
2562
|
-
e.guideEllipse(
|
|
2563
|
-
const
|
|
2564
|
-
i.facing > 0 && e.guide(i.points), e.guide(Be(
|
|
2691
|
+
function kr(e, t, n) {
|
|
2692
|
+
const { head: o } = n;
|
|
2693
|
+
e.guideEllipse(o.center.x, o.center.y, o.rx * 1.03, o.ry * 1.03, o.angle);
|
|
2694
|
+
const r = Array.from({ length: 13 }, (a, h) => ({ x: 0, y: -0.95 + 1.9 * h / 12 })), l = Array.from({ length: 13 }, (a, h) => ({ x: -0.95 + 1.9 * h / 12, y: 0.12 })), i = Be(o, r, { x: 0, y: 0 });
|
|
2695
|
+
i.facing > 0 && e.guide(i.points), e.guide(Be(o, l, { x: 0, y: 0.12 }).points), e.guide(n.chains.spine ?? []);
|
|
2565
2696
|
const s = t.lineWidth * 0.9;
|
|
2566
|
-
for (const
|
|
2567
|
-
const
|
|
2568
|
-
|
|
2697
|
+
for (const a of ["shoulder.left", "shoulder.right", "elbow.left", "elbow.right", "hip.left", "hip.right", "knee.left", "knee.right"]) {
|
|
2698
|
+
const h = n.points[a];
|
|
2699
|
+
h && e.guideEllipse(h.x, h.y, s, s, 0);
|
|
2569
2700
|
}
|
|
2570
2701
|
}
|
|
2571
|
-
function
|
|
2702
|
+
function Sr(e, t, n, o, r, l) {
|
|
2572
2703
|
const i = n.lineWidth;
|
|
2573
|
-
if (
|
|
2574
|
-
const { head: c } =
|
|
2575
|
-
t.ellipse(c.center.x, c.center.y, c.rx, c.ry, c.angle,
|
|
2704
|
+
if (r === "head") {
|
|
2705
|
+
const { head: c } = o, u = n.skin === "none" ? null : n.skin;
|
|
2706
|
+
t.ellipse(c.center.x, c.center.y, c.rx, c.ry, c.angle, u, i), t.look !== "silhouette" && br(t, c, l, i);
|
|
2576
2707
|
return;
|
|
2577
2708
|
}
|
|
2578
|
-
const s = n.plan.chains.find((c) => c.id ===
|
|
2709
|
+
const s = n.plan.chains.find((c) => c.id === r), a = o.chains[r], h = o.parts[r].points;
|
|
2579
2710
|
if (n.figure === "stick") {
|
|
2580
|
-
if (
|
|
2581
|
-
const c =
|
|
2711
|
+
if (r === "neck") return;
|
|
2712
|
+
const c = r === "spine" ? [...a, ...o.chains.neck?.slice(1) ?? []] : h;
|
|
2582
2713
|
t.line(c, i);
|
|
2583
2714
|
return;
|
|
2584
2715
|
}
|
|
2585
|
-
const f = (c,
|
|
2586
|
-
if (
|
|
2587
|
-
const [c,
|
|
2588
|
-
if (t.limb(
|
|
2589
|
-
t.limb([
|
|
2590
|
-
else if (n.hands === "cartoon" &&
|
|
2591
|
-
|
|
2716
|
+
const f = (c, u) => [s.bones[c].width[0] * i, s.bones[u].width[1] * i];
|
|
2717
|
+
if (ot(s)) {
|
|
2718
|
+
const [c, u] = f(0, 1);
|
|
2719
|
+
if (t.limb(h, c, u), s.bones.length >= 3)
|
|
2720
|
+
t.limb([a[2], a[3]], s.bones[2].width[0] * i, s.bones[2].width[1] * i);
|
|
2721
|
+
else if (n.hands === "cartoon" && r.startsWith("arm."))
|
|
2722
|
+
Hr(e, t, n, a, r.endsWith(".left") ? "left" : "right", l);
|
|
2592
2723
|
else {
|
|
2593
|
-
const d =
|
|
2724
|
+
const d = a[a.length - 1];
|
|
2594
2725
|
t.dot(d.x, d.y, i * 0.62);
|
|
2595
2726
|
}
|
|
2596
2727
|
return;
|
|
2597
2728
|
}
|
|
2598
|
-
if (
|
|
2599
|
-
const c =
|
|
2600
|
-
c &&
|
|
2729
|
+
if (r === "spine") {
|
|
2730
|
+
const c = o.points["hip.left"], u = o.points["hip.right"];
|
|
2731
|
+
c && u && Math.hypot(c.x - u.x, c.y - u.y) > 0.5 && t.limb([c, u], i * 1.3, i * 1.3);
|
|
2601
2732
|
const [d, b] = f(0, s.bones.length - 1);
|
|
2602
|
-
t.limb(
|
|
2603
|
-
const m =
|
|
2604
|
-
m &&
|
|
2733
|
+
t.limb(h, d, b);
|
|
2734
|
+
const m = o.points["shoulder.left"], w = o.points["shoulder.right"];
|
|
2735
|
+
m && w && Math.hypot(m.x - w.x, m.y - w.y) > 0.5 && t.limb(fe(m, a[a.length - 1], w, 1, 10), i * 1.15, i * 1.15);
|
|
2605
2736
|
return;
|
|
2606
2737
|
}
|
|
2607
|
-
const [
|
|
2608
|
-
t.limb(
|
|
2609
|
-
}
|
|
2610
|
-
function
|
|
2611
|
-
const n = `hand.${t}.`,
|
|
2612
|
-
for (const [i, s] of Object.entries(e)) i.startsWith(n) && (
|
|
2613
|
-
const
|
|
2614
|
-
return { ...R, ...
|
|
2615
|
-
}
|
|
2616
|
-
function
|
|
2617
|
-
const i =
|
|
2618
|
-
|
|
2738
|
+
const [g, p] = f(0, s.bones.length - 1);
|
|
2739
|
+
t.limb(h, g, p);
|
|
2740
|
+
}
|
|
2741
|
+
function Er(e, t) {
|
|
2742
|
+
const n = `hand.${t}.`, o = {};
|
|
2743
|
+
for (const [i, s] of Object.entries(e)) i.startsWith(n) && (o[i.slice(n.length)] = s);
|
|
2744
|
+
const r = e.turn ?? 0, l = t === "right" ? 1 - r : 1 + r;
|
|
2745
|
+
return { ...R, ...o, turn: l + (o.turn ?? 0) };
|
|
2746
|
+
}
|
|
2747
|
+
function Hr(e, t, n, o, r, l) {
|
|
2748
|
+
const i = o[o.length - 1], s = o[o.length - 2], a = Math.atan2(i.x - s.x, -(i.y - s.y)) * 180 / Math.PI;
|
|
2749
|
+
st(e, i, Er(l, r), {
|
|
2619
2750
|
size: n.handSize * n.height,
|
|
2620
|
-
side:
|
|
2621
|
-
angle:
|
|
2751
|
+
side: r,
|
|
2752
|
+
angle: a,
|
|
2622
2753
|
pen: t,
|
|
2623
2754
|
skin: n.skin === "none" ? "#ffffff" : n.skin,
|
|
2624
2755
|
// A cartoon glove: three fingers and a thumb, plump enough to match the limbs.
|
|
@@ -2628,203 +2759,206 @@ function pr(e, t, n, r, o, l) {
|
|
|
2628
2759
|
lineWidth: n.lineWidth * 0.3
|
|
2629
2760
|
});
|
|
2630
2761
|
}
|
|
2631
|
-
function
|
|
2632
|
-
const
|
|
2762
|
+
function Mr(e, t, n, o = 0) {
|
|
2763
|
+
const r = t.plan.id === "human" ? { ...te, ...n } : n, { joints: l, order: i } = gt(t, r), s = $t(e, {
|
|
2633
2764
|
look: t.look,
|
|
2634
2765
|
ink: t.ink,
|
|
2635
2766
|
lineWidth: t.lineWidth,
|
|
2636
2767
|
seed: t.seed,
|
|
2637
|
-
time:
|
|
2768
|
+
time: o,
|
|
2638
2769
|
pencil: t.pencil
|
|
2639
|
-
}),
|
|
2640
|
-
|
|
2770
|
+
}), a = (h) => {
|
|
2771
|
+
h && (e.save(), h(e, l, s, o), e.restore());
|
|
2641
2772
|
};
|
|
2642
|
-
e.save(), e.lineCap = "round", e.lineJoin = "round", t.look === "pencil" && t.pencil.construction !== !1 &&
|
|
2643
|
-
for (const
|
|
2644
|
-
const f = t.layers.parts?.[
|
|
2645
|
-
|
|
2773
|
+
e.save(), e.lineCap = "round", e.lineJoin = "round", t.look === "pencil" && t.pencil.construction !== !1 && kr(s, t, l), a(t.layers.behind);
|
|
2774
|
+
for (const h of i) {
|
|
2775
|
+
const f = t.layers.parts?.[h];
|
|
2776
|
+
a(f?.under), Sr(e, s, t, l, h, r), a(f?.over);
|
|
2646
2777
|
}
|
|
2647
|
-
|
|
2778
|
+
a(t.layers.front), e.restore();
|
|
2648
2779
|
}
|
|
2649
|
-
function
|
|
2650
|
-
const
|
|
2651
|
-
for (const [
|
|
2652
|
-
const i = e[
|
|
2653
|
-
r
|
|
2780
|
+
function el(e, t, n) {
|
|
2781
|
+
const o = { ...e };
|
|
2782
|
+
for (const [r, l] of Object.entries(t)) {
|
|
2783
|
+
const i = e[r] ?? l;
|
|
2784
|
+
o[r] = i + (l - i) * n;
|
|
2654
2785
|
}
|
|
2655
|
-
return
|
|
2786
|
+
return o;
|
|
2656
2787
|
}
|
|
2657
|
-
function
|
|
2658
|
-
const
|
|
2788
|
+
function tl(e, t, n, o) {
|
|
2789
|
+
const r = e.plan.id === "human" ? { ...te, ...t } : t;
|
|
2659
2790
|
let l;
|
|
2660
|
-
if (Array.isArray(
|
|
2661
|
-
l =
|
|
2791
|
+
if (Array.isArray(o))
|
|
2792
|
+
l = o;
|
|
2662
2793
|
else {
|
|
2663
|
-
const { skeleton: i } =
|
|
2664
|
-
l = [
|
|
2794
|
+
const { skeleton: i } = gt(e, r), s = ct(e.plan, { ...r, roll: 0 }, { height: e.height, contact: "none" }), a = (r.roll ?? 0) * Math.PI / 180, h = o.x - i.hip.x, f = o.y - i.hip.y, g = s.hip.x + h * Math.cos(-a) - f * Math.sin(-a), p = s.hip.y + h * Math.sin(-a) + f * Math.cos(-a), c = Math.PI / 2 * (r.turn ?? 0), u = o.depth ?? i.chains[n].depths[i.chains[n].depths.length - 1], d = Math.cos(c), b = Math.sin(c);
|
|
2795
|
+
l = [g * d - u * b, -p, g * b + u * d];
|
|
2665
2796
|
}
|
|
2666
|
-
return
|
|
2797
|
+
return fr(e.plan, r, n, l, { height: e.height });
|
|
2667
2798
|
}
|
|
2668
|
-
function
|
|
2669
|
-
const { character: t } = e, n = t.height * 0.8,
|
|
2799
|
+
function nl(e) {
|
|
2800
|
+
const { character: t } = e, n = t.height * 0.8, o = t.height, r = t.plan.id === "human" ? te : {};
|
|
2670
2801
|
return {
|
|
2671
2802
|
type: "custom",
|
|
2672
2803
|
x: e.x - n / 2,
|
|
2673
|
-
y: e.y -
|
|
2804
|
+
y: e.y - o,
|
|
2674
2805
|
width: n,
|
|
2675
|
-
height:
|
|
2676
|
-
props: { ...
|
|
2806
|
+
height: o,
|
|
2807
|
+
props: { ...r, ...e.pose },
|
|
2677
2808
|
character: t,
|
|
2678
2809
|
draw(l, i, s) {
|
|
2679
|
-
l.translate(n / 2,
|
|
2810
|
+
l.translate(n / 2, o), Mr(l, t, i.props, s);
|
|
2680
2811
|
}
|
|
2681
2812
|
};
|
|
2682
2813
|
}
|
|
2683
|
-
function
|
|
2684
|
-
const
|
|
2814
|
+
function vr(e, t, n) {
|
|
2815
|
+
const o = (l) => ({ x: l.x + t, y: l.y + n }), r = (l) => Object.fromEntries(Object.entries(l).map(([i, s]) => [i, s.map(o)]));
|
|
2685
2816
|
return {
|
|
2686
2817
|
...e,
|
|
2687
|
-
points: Object.fromEntries(Object.entries(e.points).map(([l, i]) => [l,
|
|
2688
|
-
chains:
|
|
2689
|
-
parts: Object.fromEntries(Object.entries(e.parts).map(([l, i]) => [l, { ...i, points: i.points.map(
|
|
2690
|
-
head: { ...e.head, center:
|
|
2818
|
+
points: Object.fromEntries(Object.entries(e.points).map(([l, i]) => [l, o(i)])),
|
|
2819
|
+
chains: r(e.chains),
|
|
2820
|
+
parts: Object.fromEntries(Object.entries(e.parts).map(([l, i]) => [l, { ...i, points: i.points.map(o) }])),
|
|
2821
|
+
head: { ...e.head, center: o(e.head.center) },
|
|
2691
2822
|
groundY: e.groundY + n
|
|
2692
2823
|
};
|
|
2693
2824
|
}
|
|
2694
|
-
function
|
|
2695
|
-
const
|
|
2696
|
-
if (!
|
|
2697
|
-
const
|
|
2825
|
+
function ol(e, t, n) {
|
|
2826
|
+
const o = e.character;
|
|
2827
|
+
if (!o) throw new Error("characterAt: the target was not made by characterTarget");
|
|
2828
|
+
const r = { ...e.props };
|
|
2698
2829
|
let l = 0, i = 0;
|
|
2699
|
-
for (const [
|
|
2700
|
-
typeof
|
|
2701
|
-
const s =
|
|
2702
|
-
return { pose:
|
|
2830
|
+
for (const [a, h] of t.state?.values.get(n) ?? [])
|
|
2831
|
+
typeof h == "number" && (a === "x" || a === "motionPathX" ? l = h : a === "y" || a === "motionPathY" ? i = h : a in r && (r[a] = h));
|
|
2832
|
+
const s = wr(o, r);
|
|
2833
|
+
return { pose: r, joints: vr(s, e.x + l + e.width / 2, e.y + i + e.height) };
|
|
2703
2834
|
}
|
|
2704
|
-
function
|
|
2705
|
-
const
|
|
2835
|
+
function rl(e, t, n = te) {
|
|
2836
|
+
const o = [];
|
|
2706
2837
|
return t.forEach((l, i) => {
|
|
2707
|
-
const s = i === 0 ? n :
|
|
2708
|
-
|
|
2709
|
-
}), Object.keys(n).filter((l) =>
|
|
2838
|
+
const s = i === 0 ? n : o[i - 1], a = typeof l.pose == "string" ? tr[l.pose] : void 0;
|
|
2839
|
+
o.push(a ? { ...a, turn: s.turn ?? 0 } : { ...s, ...l.pose });
|
|
2840
|
+
}), Object.keys(n).filter((l) => o.some((i) => (i[l] ?? n[l]) !== n[l])).map((l) => ({
|
|
2710
2841
|
id: `${e}-${l}`,
|
|
2711
2842
|
target: e,
|
|
2712
2843
|
property: l,
|
|
2713
2844
|
keyframes: t.map((i, s) => ({
|
|
2714
2845
|
time: i.time,
|
|
2715
|
-
value:
|
|
2846
|
+
value: o[s][l] ?? n[l],
|
|
2716
2847
|
...i.easing ? { easing: i.easing } : {}
|
|
2717
2848
|
}))
|
|
2718
2849
|
}));
|
|
2719
2850
|
}
|
|
2720
|
-
const
|
|
2721
|
-
function
|
|
2722
|
-
const t = e.shirt ?? "#e2493b", n = e.trousers ?? "#24476b",
|
|
2723
|
-
const f = s.parts[`leg.${
|
|
2724
|
-
|
|
2725
|
-
}, l = (s,
|
|
2726
|
-
const
|
|
2727
|
-
|
|
2728
|
-
}, i = (s,
|
|
2729
|
-
const f = s.parts[`arm.${
|
|
2730
|
-
|
|
2731
|
-
const
|
|
2732
|
-
|
|
2851
|
+
const Tr = (e, t, n) => e.slice(Math.floor((e.length - 1) * t), Math.ceil((e.length - 1) * n) + 1);
|
|
2852
|
+
function ll(e = {}) {
|
|
2853
|
+
const t = e.shirt ?? "#e2493b", n = e.trousers ?? "#24476b", o = (s) => s.lineWidth * 0.45, r = (s, a, h) => {
|
|
2854
|
+
const f = s.parts[`leg.${h}`].points;
|
|
2855
|
+
a.shape(Te(f, s.height * 0.08, s.height * 0.05), n, o(s));
|
|
2856
|
+
}, l = (s, a) => {
|
|
2857
|
+
const h = s.chains.spine, f = h[0], g = h[h.length - 1], p = { x: f.x - (g.x - f.x) * 0.25, y: f.y - (g.y - f.y) * 0.25 };
|
|
2858
|
+
a.shape(Te([p, ...s.parts.spine.points], s.height * 0.15, s.height * 0.14), t, o(s));
|
|
2859
|
+
}, i = (s, a, h) => {
|
|
2860
|
+
const f = s.parts[`arm.${h}`].points, g = f[0], p = s.chains.spine[s.chains.spine.length - 1], u = [{ x: g.x + (p.x - g.x) * 0.45, y: g.y + (p.y - g.y) * 0.45 }, ...Tr(f, 0, 0.45)], d = Te(u, s.height * 0.085, s.height * 0.06), b = u.length, m = d.slice(0, b), w = d.slice(b).reverse();
|
|
2861
|
+
a.shape(d, t, 0);
|
|
2862
|
+
const S = (k) => Math.hypot(k[1].x - p.x, k[1].y - p.y), [M, H] = S(m) > S(w) ? [m, w] : [w, m];
|
|
2863
|
+
a.line(M.slice(1), o(s)), a.line(H.slice(Math.ceil(b * 0.45)), o(s)), a.line([m[b - 1], w[b - 1]], o(s));
|
|
2733
2864
|
};
|
|
2734
2865
|
return {
|
|
2735
2866
|
parts: {
|
|
2736
|
-
"leg.left": { over: (s,
|
|
2737
|
-
"leg.right": { over: (s,
|
|
2738
|
-
spine: { over: (s,
|
|
2739
|
-
"arm.left": { over: (s,
|
|
2740
|
-
"arm.right": { over: (s,
|
|
2867
|
+
"leg.left": { over: (s, a, h) => r(a, h, "left") },
|
|
2868
|
+
"leg.right": { over: (s, a, h) => r(a, h, "right") },
|
|
2869
|
+
spine: { over: (s, a, h) => l(a, h) },
|
|
2870
|
+
"arm.left": { over: (s, a, h) => i(a, h, "left") },
|
|
2871
|
+
"arm.right": { over: (s, a, h) => i(a, h, "right") }
|
|
2741
2872
|
}
|
|
2742
2873
|
};
|
|
2743
2874
|
}
|
|
2744
2875
|
export {
|
|
2745
|
-
|
|
2876
|
+
ce as DANCE_STYLES,
|
|
2746
2877
|
J as EXPRESSIONS,
|
|
2747
|
-
|
|
2748
|
-
|
|
2878
|
+
mn as FINGERS,
|
|
2879
|
+
ft as FLIPS,
|
|
2749
2880
|
R as HAND_REST,
|
|
2750
2881
|
N as HAND_SHAPES,
|
|
2751
|
-
|
|
2752
|
-
|
|
2882
|
+
Xr as HUMAN_EXPRESSIONS,
|
|
2883
|
+
tr as HUMAN_POSES,
|
|
2753
2884
|
te as HUMAN_REST,
|
|
2754
|
-
|
|
2755
|
-
|
|
2885
|
+
vt as MUDRAS,
|
|
2886
|
+
Fn as POSES,
|
|
2756
2887
|
z as REST_POSE,
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2888
|
+
Eo as applyGroove,
|
|
2889
|
+
Lr as bakeDanceTracks,
|
|
2890
|
+
ll as basicOutfit,
|
|
2891
|
+
Fr as beatAt,
|
|
2892
|
+
we as blendPose,
|
|
2893
|
+
fn as boilFrame,
|
|
2894
|
+
Qr as character,
|
|
2895
|
+
ol as characterAt,
|
|
2896
|
+
Er as characterHandPose,
|
|
2897
|
+
wr as characterJoints,
|
|
2898
|
+
rl as characterPoseTracks,
|
|
2899
|
+
nl as characterTarget,
|
|
2900
|
+
zr as circlePath,
|
|
2901
|
+
on as clipErased,
|
|
2902
|
+
$t as createPen,
|
|
2903
|
+
at as danceFrame,
|
|
2904
|
+
Br as dancePose,
|
|
2905
|
+
tt as danceStance,
|
|
2906
|
+
_r as danceTaps,
|
|
2907
|
+
Yr as danceTracks,
|
|
2908
|
+
Ne as danceTravel,
|
|
2909
|
+
To as danceTravelTrack,
|
|
2910
|
+
Rr as dancer,
|
|
2911
|
+
st as drawCartoonHand,
|
|
2912
|
+
Mr as drawCharacter,
|
|
2913
|
+
Vt as drawEraser,
|
|
2914
|
+
tn as drawHand,
|
|
2915
|
+
sr as drawPencil,
|
|
2916
|
+
co as drawStickFigure,
|
|
2917
|
+
Gr as drawnPathTarget,
|
|
2918
|
+
dt as ellipsePoints,
|
|
2919
|
+
jr as erasable,
|
|
2920
|
+
Do as flipPose,
|
|
2921
|
+
Nr as flipTracks,
|
|
2922
|
+
Xo as flipTravel,
|
|
2923
|
+
Ur as handAt,
|
|
2924
|
+
je as handJoints,
|
|
2925
|
+
Kn as handJointsAt,
|
|
2926
|
+
F as handPose,
|
|
2927
|
+
Oe as handProp,
|
|
2928
|
+
Wr as headPoint,
|
|
2929
|
+
Dr as humanFieldLabel,
|
|
2930
|
+
nr as humanPlan,
|
|
2798
2931
|
G as humanPose,
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2932
|
+
vr as jointsInScene,
|
|
2933
|
+
fo as jointsToScene,
|
|
2934
|
+
Cr as mirrorHumanPose,
|
|
2935
|
+
ko as mirrorPose,
|
|
2936
|
+
ye as mixHandPoses,
|
|
2937
|
+
el as mixPoses,
|
|
2938
|
+
It as partialPath,
|
|
2939
|
+
al as pathLength,
|
|
2940
|
+
rt as pointAlong,
|
|
2941
|
+
Vr as pointOnHead,
|
|
2808
2942
|
D as pose,
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2943
|
+
$r as poseTracks,
|
|
2944
|
+
tl as reachCharacter,
|
|
2945
|
+
Jt as resolveStickFrame,
|
|
2946
|
+
go as resolveStickPose,
|
|
2813
2947
|
ie as rotateAbout,
|
|
2814
|
-
|
|
2948
|
+
ht as routineBeats,
|
|
2815
2949
|
fe as rubberLimb,
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2950
|
+
Jr as scrubPath,
|
|
2951
|
+
Pr as seatHeight,
|
|
2952
|
+
Ge as sketchPen,
|
|
2953
|
+
Ir as stickFigureAt,
|
|
2954
|
+
ho as stickFigureJoints,
|
|
2955
|
+
Or as stickFigureTarget,
|
|
2956
|
+
qr as stickToHuman,
|
|
2957
|
+
Kr as strideLength,
|
|
2958
|
+
Ln as talkingMouth,
|
|
2959
|
+
lt as taperedLine,
|
|
2960
|
+
Te as taperedOutline,
|
|
2961
|
+
Yn as walkPose,
|
|
2962
|
+
Zr as withErased,
|
|
2963
|
+
_t as withExpression
|
|
2830
2964
|
};
|