@anime-studio/director 0.2.1 → 0.4.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.
Files changed (134) hide show
  1. package/dist/describe.d.ts +1 -1
  2. package/dist/direct/arcs.d.ts +17 -0
  3. package/dist/direct/arcs.d.ts.map +1 -0
  4. package/dist/direct/arcs.js +76 -0
  5. package/dist/direct/arcs.js.map +1 -0
  6. package/dist/direct/arms.d.ts +46 -0
  7. package/dist/direct/arms.d.ts.map +1 -0
  8. package/dist/direct/arms.js +233 -0
  9. package/dist/direct/arms.js.map +1 -0
  10. package/dist/direct/beat.d.ts +7 -0
  11. package/dist/direct/beat.d.ts.map +1 -0
  12. package/dist/direct/beat.js +339 -0
  13. package/dist/direct/beat.js.map +1 -0
  14. package/dist/direct/build.d.ts +7 -0
  15. package/dist/direct/build.d.ts.map +1 -0
  16. package/dist/direct/build.js +152 -0
  17. package/dist/direct/build.js.map +1 -0
  18. package/dist/direct/camera.d.ts +38 -0
  19. package/dist/direct/camera.d.ts.map +1 -0
  20. package/dist/direct/camera.js +279 -0
  21. package/dist/direct/camera.js.map +1 -0
  22. package/dist/direct/cast.d.ts +45 -0
  23. package/dist/direct/cast.d.ts.map +1 -0
  24. package/dist/direct/cast.js +172 -0
  25. package/dist/direct/cast.js.map +1 -0
  26. package/dist/direct/check.d.ts +17 -0
  27. package/dist/direct/check.d.ts.map +1 -0
  28. package/dist/direct/check.js +270 -0
  29. package/dist/direct/check.js.map +1 -0
  30. package/dist/direct/contact.d.ts +28 -0
  31. package/dist/direct/contact.d.ts.map +1 -0
  32. package/dist/direct/contact.js +222 -0
  33. package/dist/direct/contact.js.map +1 -0
  34. package/dist/direct/dialogue.d.ts +19 -0
  35. package/dist/direct/dialogue.d.ts.map +1 -0
  36. package/dist/direct/dialogue.js +110 -0
  37. package/dist/direct/dialogue.js.map +1 -0
  38. package/dist/direct/episode.d.ts +10 -0
  39. package/dist/direct/episode.d.ts.map +1 -0
  40. package/dist/direct/episode.js +286 -0
  41. package/dist/direct/episode.js.map +1 -0
  42. package/dist/direct/fixtures.d.ts +29 -0
  43. package/dist/direct/fixtures.d.ts.map +1 -0
  44. package/dist/direct/fixtures.js +147 -0
  45. package/dist/direct/fixtures.js.map +1 -0
  46. package/dist/direct/flight.d.ts +23 -0
  47. package/dist/direct/flight.d.ts.map +1 -0
  48. package/dist/direct/flight.js +110 -0
  49. package/dist/direct/flight.js.map +1 -0
  50. package/dist/direct/furniture.d.ts +59 -0
  51. package/dist/direct/furniture.d.ts.map +1 -0
  52. package/dist/direct/furniture.js +149 -0
  53. package/dist/direct/furniture.js.map +1 -0
  54. package/dist/direct/gestures.d.ts +31 -0
  55. package/dist/direct/gestures.d.ts.map +1 -0
  56. package/dist/direct/gestures.js +211 -0
  57. package/dist/direct/gestures.js.map +1 -0
  58. package/dist/direct/graphics.d.ts +20 -0
  59. package/dist/direct/graphics.d.ts.map +1 -0
  60. package/dist/direct/graphics.js +282 -0
  61. package/dist/direct/graphics.js.map +1 -0
  62. package/dist/direct/hand-holding.d.ts +28 -0
  63. package/dist/direct/hand-holding.d.ts.map +1 -0
  64. package/dist/direct/hand-holding.js +187 -0
  65. package/dist/direct/hand-holding.js.map +1 -0
  66. package/dist/direct/hiding.d.ts +19 -0
  67. package/dist/direct/hiding.d.ts.map +1 -0
  68. package/dist/direct/hiding.js +173 -0
  69. package/dist/direct/hiding.js.map +1 -0
  70. package/dist/direct/life.d.ts +67 -0
  71. package/dist/direct/life.d.ts.map +1 -0
  72. package/dist/direct/life.js +275 -0
  73. package/dist/direct/life.js.map +1 -0
  74. package/dist/direct/lighting.d.ts +22 -0
  75. package/dist/direct/lighting.d.ts.map +1 -0
  76. package/dist/direct/lighting.js +86 -0
  77. package/dist/direct/lighting.js.map +1 -0
  78. package/dist/direct/lying.d.ts +24 -0
  79. package/dist/direct/lying.d.ts.map +1 -0
  80. package/dist/direct/lying.js +205 -0
  81. package/dist/direct/lying.js.map +1 -0
  82. package/dist/direct/motion.d.ts +50 -0
  83. package/dist/direct/motion.d.ts.map +1 -0
  84. package/dist/direct/motion.js +270 -0
  85. package/dist/direct/motion.js.map +1 -0
  86. package/dist/direct/pictures.d.ts +24 -0
  87. package/dist/direct/pictures.d.ts.map +1 -0
  88. package/dist/direct/pictures.js +265 -0
  89. package/dist/direct/pictures.js.map +1 -0
  90. package/dist/direct/props-in-hand.d.ts +71 -0
  91. package/dist/direct/props-in-hand.d.ts.map +1 -0
  92. package/dist/direct/props-in-hand.js +285 -0
  93. package/dist/direct/props-in-hand.js.map +1 -0
  94. package/dist/direct/props.d.ts +32 -0
  95. package/dist/direct/props.d.ts.map +1 -0
  96. package/dist/direct/props.js +118 -0
  97. package/dist/direct/props.js.map +1 -0
  98. package/dist/direct/riding.d.ts +76 -0
  99. package/dist/direct/riding.d.ts.map +1 -0
  100. package/dist/direct/riding.js +290 -0
  101. package/dist/direct/riding.js.map +1 -0
  102. package/dist/direct/scene.d.ts +322 -0
  103. package/dist/direct/scene.d.ts.map +1 -0
  104. package/dist/direct/scene.js +287 -0
  105. package/dist/direct/scene.js.map +1 -0
  106. package/dist/direct/shared.d.ts +87 -0
  107. package/dist/direct/shared.d.ts.map +1 -0
  108. package/dist/direct/shared.js +42 -0
  109. package/dist/direct/shared.js.map +1 -0
  110. package/dist/direct/sitting.d.ts +62 -0
  111. package/dist/direct/sitting.d.ts.map +1 -0
  112. package/dist/direct/sitting.js +320 -0
  113. package/dist/direct/sitting.js.map +1 -0
  114. package/dist/direct/throws.d.ts +14 -0
  115. package/dist/direct/throws.d.ts.map +1 -0
  116. package/dist/direct/throws.js +89 -0
  117. package/dist/direct/throws.js.map +1 -0
  118. package/dist/direct/timeline.d.ts +23 -0
  119. package/dist/direct/timeline.d.ts.map +1 -0
  120. package/dist/direct/timeline.js +90 -0
  121. package/dist/direct/timeline.js.map +1 -0
  122. package/dist/direct/timing.d.ts +50 -0
  123. package/dist/direct/timing.d.ts.map +1 -0
  124. package/dist/direct/timing.js +138 -0
  125. package/dist/direct/timing.js.map +1 -0
  126. package/dist/direct/vocabulary.d.ts +33 -0
  127. package/dist/direct/vocabulary.d.ts.map +1 -0
  128. package/dist/direct/vocabulary.js +56 -0
  129. package/dist/direct/vocabulary.js.map +1 -0
  130. package/dist/direct.d.ts +8 -87
  131. package/dist/direct.d.ts.map +1 -1
  132. package/dist/direct.js +8 -6052
  133. package/dist/direct.js.map +1 -1
  134. package/package.json +3 -3
@@ -0,0 +1,147 @@
1
+ import { r3 } from "./shared.js";
2
+ import { closest } from "./vocabulary.js";
3
+ /**
4
+ * Changes a set fixture: a clip of its rig named like the value (`open`, `close`, `slide`…) plays
5
+ * once from that moment and holds its last pose until the next clip of that fixture (or the end of
6
+ * the block); any other value sets its channel (a traffic light's `red`).
7
+ */
8
+ export function fixture(id, value, at) {
9
+ const f = this.setDef.fixtures?.find((x) => x.id === id);
10
+ if (!f)
11
+ return this.issue("error", `unknown fixture "${id}"${closest(id, (this.setDef.fixtures ?? []).map((x) => x.id))}`);
12
+ const clips = (this.kit.characters[f.character]?.clips ?? {});
13
+ if (typeof value === "string" && clips[value]) {
14
+ const t = this.t(at), fade = 0.15;
15
+ // The clip before it ends as this one comes in (a short cross-fade from its held end pose).
16
+ const prev = this.fixtureClips.get(f.id);
17
+ if (prev)
18
+ Object.assign(prev, { duration: r3(Math.max(0.05, t + fade - prev.at)), fadeOut: fade });
19
+ // (A long instance: the scene holds a clip played once on its last pose while it lasts.)
20
+ const play = { at: t, actor: f.id, action: "play", clip: value, loop: false, duration: r3(Math.max(0.1, this.t1 - this.t0 - t)), fadeIn: prev ? fade : 0.05, fadeOut: 0, layer: 1 };
21
+ this.push(play);
22
+ this.fixtureClips.set(f.id, play);
23
+ return;
24
+ }
25
+ this.set(f.id, f.channel ?? "parts.light.variant", value, at);
26
+ }
27
+ /**
28
+ * Presses something (a doorbell, a lift button, an intercom, a switch on a prop): walks within the
29
+ * arm's real reach of it if needed (the rig's shoulder and arm length) — on the side they come from,
30
+ * facing the way they go, then facing it — reaches a free hand to it (a
31
+ * fixture's or furniture's anchor named in `at` ("bell.high"), else its `press`, `button` or `top`
32
+ * anchor; a prop's `grip` or first point), pushes in (0.12 s), holds (0.1 s, or until `until`), comes back
33
+ * (0.2 s) and lets go. With `value`, the fixture changes at the press (a doorbell lights up).
34
+ */
35
+ export function press(actor, b, at, until) {
36
+ const spec = typeof b.at === "string" ? b.at : "";
37
+ const [id, named] = spec.includes(".") ? [spec.slice(0, spec.indexOf(".")), spec.slice(spec.indexOf(".") + 1)] : [spec, undefined];
38
+ const fixtures = (this.setDef.fixtures ?? []).map((f) => f.id);
39
+ const rigs = [...fixtures, ...this.furnitureOf.keys()];
40
+ const known = [...rigs, ...this.propStates.keys()];
41
+ if (!known.includes(id))
42
+ return this.issue("error", `line ${b.line} "press": ${actor} cannot press "${spec}": no fixture, furniture or prop with that id${closest(id, known)}`);
43
+ if (b.value !== undefined && !fixtures.includes(id))
44
+ this.issue("error", `line ${b.line} "press": "${id}" is not a set fixture: \`value\` changes a fixture (the press still happens)`);
45
+ const s = this.scaleOf(actor), rig = this.member(actor)?.rig;
46
+ // Where the finger goes (scene px), and the reach target (a rig's anchor, followed; a prop's point; a scene point).
47
+ let point, target;
48
+ if (rigs.includes(id)) {
49
+ const anchors = (this.kit.characters[this.characterOf(id)]?.anchors ?? {});
50
+ if (named && !anchors[named])
51
+ return this.issue("error", `line ${b.line} "press": "${id}" has no anchor "${named}"${closest(named, Object.keys(anchors))}`);
52
+ const anchor = named ?? ["press", "button", "top"].find((n) => anchors[n]);
53
+ const p = anchor ? this.placedAnchor(id, anchor) : undefined;
54
+ if (anchor && p)
55
+ [point, target] = [p, { actor: id, anchor }];
56
+ else {
57
+ // No anchor to press: the top of its drawing, in the middle.
58
+ const x = this.xAt(id, at), top = this.drawnTop(id, x);
59
+ point = [x, Number.isFinite(top) ? top : this.setDef.ground.near - 100];
60
+ target = [Math.round(point[0]), Math.round(point[1])];
61
+ }
62
+ }
63
+ else {
64
+ if (named)
65
+ this.issue("warning", `line ${b.line} "press": a prop has no anchors ("${named}" ignored): its grip is pressed`);
66
+ const pts = this.kit.props[this.propKinds.get(id) ?? ""]?.points ?? {};
67
+ const pt = pts.grip ?? Object.values(pts)[0];
68
+ point = [this.propX(id, at) + (pt?.[0] ?? 0), this.propY(id, at) + (pt?.[1] ?? 0)];
69
+ target = pt ? { prop: id, point: pt } : [Math.round(point[0]), Math.round(point[1])];
70
+ }
71
+ // Where they press from: the side they come from (once any walk under way has arrived), facing it.
72
+ const settle = Math.max(at, ...this.walks.filter((w) => w.actor === actor && w.t0 < at).map((w) => w.t1));
73
+ const x0 = this.xAt(actor, settle);
74
+ const from = x0 <= point[0] ? -1 : 1;
75
+ const right = from < 0;
76
+ // The hand: the one asked for, else a free one after they turn to it (the near one first).
77
+ const side = b.hand === "F" || b.hand === "B" ? b.hand : this.pressHand(actor, settle, right, spec);
78
+ const chain = `hand${side}`;
79
+ if (!this.hasChain(actor, chain))
80
+ return this.issue("error", `line ${b.line} "press": ${actor} has no IK chain "${chain}" to reach with`);
81
+ // Within the arm's real reach: the shoulder (the rig's, at their scale, over the ground) at most
82
+ // 0.9 arm lengths from the point — sideways up to 0.7 of it, nearer when the point is high.
83
+ const L = (rig?.armLength?.[side] ?? 80) * s, reachLen = 0.9 * L;
84
+ const sh = (rig?.shoulder?.[side] ?? [0, -110]);
85
+ const shoulderDx = (right ? 1 : -1) * sh[0] * s;
86
+ const shoulderY = this.groundY(actor, settle) + sh[1] * s;
87
+ const dy = point[1] - shoulderY;
88
+ const over = Math.abs(dy) - reachLen;
89
+ if (dy < 0 && over > 0)
90
+ this.issue("warning", `line ${b.line} "press": "${spec}" is ${Math.round(over)} px above ${actor}'s reach: they reach up as far as they can`);
91
+ const most = over > 0 ? 0.4 * L : Math.sqrt(reachLen * reachLen - dy * dy);
92
+ const d = over > 0 ? 0.25 * L : Math.min(most, 0.7 * L);
93
+ // (How far the point is in front of the shoulder now: already within reach, they only turn to it.)
94
+ const ahead = (point[0] - (x0 + shoulderDx)) * (right ? 1 : -1);
95
+ const x = ahead >= 0 && ahead <= most ? x0 : point[0] + from * d - shoulderDx;
96
+ const IN = 0.35, PUSH = 0.12, OUT = 0.2;
97
+ let arrive = -Infinity;
98
+ if (Math.abs(x - x0) > 1) {
99
+ // Walks over beforehand when the block has the time (else the press waits for the arrival),
100
+ // facing the way they go; the walk turns them, and they turn to the point on arrival.
101
+ const dur = Math.abs(x - x0) / this.speedOf(actor, "walk");
102
+ arrive = this.walk(actor, x, at - IN - PUSH - dur, dur);
103
+ }
104
+ // The press itself on the beat's moment (the hand on its way before it), or as soon as they are there.
105
+ const pressAt = Math.max(at, arrive + IN + PUSH, this.t0 + IN + PUSH);
106
+ const contact = pressAt - PUSH;
107
+ this.face(actor, right ? "right" : "left", Math.max(arrive, contact - IN - 0.05));
108
+ const hold = until !== undefined ? Math.max(0.1, until - pressAt) : 0.1;
109
+ // The push: past the point along the reach (from the shoulder), then back on it.
110
+ const sx = this.xAt(actor, pressAt) + shoulderDx;
111
+ const dx = point[0] - sx, dl = Math.hypot(dx, dy) || 1, depth = Math.max(4, L * 0.08);
112
+ const pushed = [Math.round(point[0] + (dx / dl) * depth), Math.round(point[1] + (dy / dl) * depth)];
113
+ this.reach(actor, chain, target, contact - IN, IN);
114
+ this.reach(actor, chain, pushed, contact, PUSH);
115
+ this.reach(actor, chain, target, pressAt + hold, OUT);
116
+ this.reach(actor, chain, null, pressAt + hold + OUT, 0.35);
117
+ this.armBusy.push({ actor, side, t0: contact - IN, t1: pressAt + hold + OUT + 0.35 });
118
+ this.busy.push({ actor, t0: contact - IN, t1: pressAt + hold + OUT + 0.35 });
119
+ if (this.hasPart(actor, chain) && this.hasPartVariant(actor, chain, "point")) {
120
+ this.set(actor, `parts.${chain}.variant`, "point", contact - IN);
121
+ this.set(actor, `parts.${chain}.variant`, null, pressAt + hold + OUT);
122
+ }
123
+ if (b.value !== undefined && fixtures.includes(id))
124
+ this.fixture(id, b.value, pressAt);
125
+ }
126
+ /**
127
+ * The hand that presses, once turned to face the point (`right`): the near one, else the far one,
128
+ * when it holds nothing (a hung prop included), holds nobody's hand and no beat moves its arm; both
129
+ * taken, the near one (warned). A 2.5D rig turning round keeps its props in the same hand, which
130
+ * becomes the other side of the drawing.
131
+ */
132
+ export function pressHand(actor, abs, right, spec) {
133
+ const turns = this.is3d(actor) && this.facing(actor, abs) !== right;
134
+ const now = (sd) => (turns ? (sd === "F" ? "B" : "F") : sd);
135
+ const free = (sd) => this.handFree(actor, now(sd), abs) && !this.armBusy.some((b) => b.actor === actor && b.side === now(sd) && b.t0 < abs + 0.5 && b.t1 > abs - 0.6);
136
+ const anchors = (this.kit.characters[this.characterOf(actor)]?.anchors ?? {});
137
+ if (free("F"))
138
+ return "F";
139
+ if (anchors.handB && this.hasChain(actor, "handB") && free("B"))
140
+ return "B";
141
+ this.issue("warning", `${actor} presses "${spec}" with the near hand although it is busy (holding something, holding someone's hand or in a gesture) and the other one is too`);
142
+ return "F";
143
+ }
144
+ export function hasPartVariant(actor, part, variant) {
145
+ return !!(this.kit.characters[this.characterOf(actor)]?.parts ?? []).find((p) => p.id === part)?.variants?.[variant];
146
+ }
147
+ //# sourceMappingURL=fixtures.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fixtures.js","sourceRoot":"","sources":["../../src/direct/fixtures.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,EAAE,EAAe,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC;;;;GAIG;AACH,MAAM,UAAU,OAAO,CAAmB,EAAU,EAAE,KAAc,EAAE,EAAU;IAC9E,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;IACzD,IAAI,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC,KAAK,CAAC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C,CAAC;IAChL,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,UAAU,cAAc,CAAmB,KAAa,EAAE,IAAY,EAAE,OAAe;IAC3F,OAAO,CAAC,CAAE,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,IAAI,EAAE,CAA0D,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC;AACjL,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Flying actors: wings, flight paths, flying in, landing.
3
+ */
4
+ import type { Place } from "../types.js";
5
+ import type { BlockScene } from "./scene.js";
6
+ /** Characters that fly: `meta.canFly` on the rig, or a `fly` clip. Wings beat with `fly`, else `flap`. */
7
+ export declare function canFly(this: BlockScene, actor: string): boolean;
8
+ export declare function groundOf(this: BlockScene, actor: string): boolean;
9
+ export declare function wings(this: BlockScene, actor: string): "flap" | "fly" | undefined;
10
+ /**
11
+ * One smooth flight along a cubic Bézier path (scene points), sampled finely so speed and height
12
+ * change continuously (no stop in mid-air): `ease` spreads the progress (slow start and landing).
13
+ * The body pitches with the direction of travel, the wings beat, and the ground shadow stays on
14
+ * the floor, smaller and fainter the higher they are.
15
+ */
16
+ export declare function flight(this: BlockScene, actor: string, path: [number, number][], at: number, dur: number, ease: (u: number) => number, lands: boolean): void;
17
+ /** A little squash on touching down. */
18
+ export declare function touchDown(this: BlockScene, actor: string, at: number): void;
19
+ /** Comes in through the air (from a side, high, or from the top), glides down and lands at x. */
20
+ export declare function flyIn(this: BlockScene, actor: string, x: number, at: number, from: "left" | "right" | "top"): void;
21
+ /** Flies to a place (crouches, takes off, glides, lands) or away out of the frame ("offLeft", "offRight", "up"). */
22
+ export declare function fly(this: BlockScene, actor: string, to: Place | "offLeft" | "offRight" | "up", at: number, until?: number): void;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AK,CAAC,EAAE,MAAM,QAwBzH"}
@@ -0,0 +1,110 @@
1
+ import { r3 } from "./shared.js";
2
+ /** Characters that fly: `meta.canFly` on the rig, or a `fly` clip. Wings beat with `fly`, else `flap`. */
3
+ export function canFly(actor) {
4
+ const doc = this.kit.characters[this.characterOf(actor)];
5
+ return !!doc?.meta?.canFly || !!doc?.clips?.fly;
6
+ }
7
+ export function groundOf(actor) {
8
+ return !!this.kit.characters[this.characterOf(actor)]?.skeleton?.some((b) => b.id === "ground");
9
+ }
10
+ export function wings(actor) {
11
+ return this.hasClip(actor, "fly") ? "fly" : this.hasClip(actor, "flap") ? "flap" : undefined;
12
+ }
13
+ /**
14
+ * One smooth flight along a cubic Bézier path (scene points), sampled finely so speed and height
15
+ * change continuously (no stop in mid-air): `ease` spreads the progress (slow start and landing).
16
+ * The body pitches with the direction of travel, the wings beat, and the ground shadow stays on
17
+ * the floor, smaller and fainter the higher they are.
18
+ */
19
+ export function flight(actor, path, at, dur, ease, lands) {
20
+ const s = this.scaleOf(actor);
21
+ const floor = this.groundY(actor, at);
22
+ const doc = this.kit.characters[this.characterOf(actor)];
23
+ const ground = doc.skeleton?.some((b) => b.id === "ground"), shadow = doc.parts?.some((p) => p.id === "shadow");
24
+ const [p0, c1, c2, p3] = path;
25
+ const bez = (u) => {
26
+ const a = (1 - u) ** 3, b = 3 * (1 - u) ** 2 * u, c = 3 * (1 - u) * u * u, d = u ** 3;
27
+ return [a * p0[0] + b * c1[0] + c * c2[0] + d * p3[0], a * p0[1] + b * c1[1] + c * c2[1] + d * p3[1]];
28
+ };
29
+ const dirX = p3[0] >= p0[0] ? 1 : -1;
30
+ this.face(actor, dirX > 0 ? "right" : "left", at);
31
+ this.walks.push({ actor, t0: at, t1: at + dur, x0: p0[0], x1: p3[0] });
32
+ const n = Math.max(6, Math.ceil(dur * 12));
33
+ let prev = bez(0);
34
+ for (let k = 1; k <= n; k++) {
35
+ const t = at + ((k - 1) / n) * dur, d = dur / n;
36
+ const p = bez(ease(k / n));
37
+ const alt = Math.max(0, floor - p[1]);
38
+ this.set(actor, "x", Math.round(p[0]), t, d, "linear");
39
+ this.set(actor, "y", Math.round(p[1]), t, d, "linear");
40
+ // Nose up when climbing, down when descending (gently), level at the end of a landing.
41
+ const pitch = lands && k === n ? 0 : Math.max(-14, Math.min(14, (Math.atan2(p[1] - prev[1], Math.abs(p[0] - prev[0]) + 1e-3) * 180) / Math.PI * 0.35));
42
+ this.set(actor, "rotation", r3(pitch * dirX), t, d, "linear");
43
+ if (ground)
44
+ this.set(actor, "bones.ground.y", r3(alt / s), t, d, "linear");
45
+ if (shadow)
46
+ this.set(actor, "parts.shadow.opacity", r3(Math.max(0.15, 1 - alt / 600)), t, d, "linear");
47
+ prev = p;
48
+ }
49
+ const clip = this.wings(actor);
50
+ if (clip)
51
+ this.push({ at: this.t(at), actor, action: "play", clip, loop: true, duration: r3(dur), fadeIn: 0.15, fadeOut: 0.25 });
52
+ this.sfx("fly", at);
53
+ }
54
+ /** A little squash on touching down. */
55
+ export function touchDown(actor, at) {
56
+ if (this.anticipation > 0)
57
+ return this.squash(actor, at);
58
+ const s = this.scaleOf(actor);
59
+ this.set(actor, "scale", [r3(s * 1.1), r3(s * 0.88)], at, 0.08, "easeOut");
60
+ this.set(actor, "scale", s, at + 0.08, 0.22, "backOut");
61
+ }
62
+ /** Comes in through the air (from a side, high, or from the top), glides down and lands at x. */
63
+ export function flyIn(actor, x, at, from) {
64
+ if (!this.canFly(actor))
65
+ this.issue("error", `${actor} cannot fly (no "fly" clip nor meta.canFly on the rig)`);
66
+ const s = this.scaleOf(actor);
67
+ const floor = this.groundY(actor, at);
68
+ // From above the frame (and off the side it comes from).
69
+ const y0 = Math.min(floor - 700, -250);
70
+ const x0 = this.xAt(actor, at);
71
+ const dir = x >= x0 ? 1 : -1;
72
+ const dur = Math.max(2.6, (Math.hypot(x - x0, floor - y0) * 1.3) / ((this.member(actor)?.speed?.fly ?? 360) * s));
73
+ this.set(actor, "y", Math.round(y0), this.t0, 0);
74
+ if (this.groundOf(actor))
75
+ this.set(actor, "bones.ground.y", r3((floor - y0) / s), this.t0, 0);
76
+ // Placed up there first; the flight starts a moment later (keys at the same instant would merge).
77
+ const t = Math.max(at, this.t0 + 0.05);
78
+ // A swoop: down steeply at first, then gliding in nearly level to touch down.
79
+ const path = [[x0, y0], [x0 + (x - x0) * 0.35, y0 + (floor - y0) * 0.65], [x - dir * 220 * s, floor - 90 * s], [x, floor]];
80
+ this.flight(actor, path, t, dur, (u) => Math.sin((u * Math.PI) / 2), true);
81
+ this.touchDown(actor, t + dur);
82
+ }
83
+ /** Flies to a place (crouches, takes off, glides, lands) or away out of the frame ("offLeft", "offRight", "up"). */
84
+ export function fly(actor, to, at, until) {
85
+ if (!this.canFly(actor))
86
+ return this.issue("error", `${actor} cannot fly (no "fly" clip nor meta.canFly on the rig)`);
87
+ this.standUp(actor, at, 0.6);
88
+ const s = this.scaleOf(actor);
89
+ const floor = this.groundY(actor, at);
90
+ const x0 = this.xAt(actor, at);
91
+ const speed = this.speedOf(actor, "fly");
92
+ // Crouch before the jump into the air.
93
+ this.set(actor, "scale", [r3(s * 1.08), r3(s * 0.9)], at - 0.18, 0.15, "easeOut");
94
+ this.set(actor, "scale", s, at, 0.2, "easeOut");
95
+ if (to === "offLeft" || to === "offRight" || to === "up") {
96
+ const x1 = to === "offLeft" ? -500 : to === "offRight" ? (this.kit.width ?? 1920) + 500 : x0 + (this.facing(actor, at) ? 300 : -300);
97
+ const y1 = Math.min(floor - 900, -300);
98
+ const dur = until !== undefined ? until - at : Math.max(1.6, Math.hypot(x1 - x0, floor - y1) / speed);
99
+ // Up and away, speeding up.
100
+ this.flight(actor, [[x0, floor], [x0 + (x1 - x0) * 0.15, floor - 220 * s], [x0 + (x1 - x0) * 0.6, y1 + 200], [x1, y1]], at, dur, (u) => u * u * (2 - u) * 0.5 + u * u * 0.5, false);
101
+ return;
102
+ }
103
+ const x1 = this.placeX(to, at, actor);
104
+ const dur = until !== undefined ? until - at : Math.max(1.3, Math.abs(x1 - x0) / speed + 0.7);
105
+ const top = Math.min(280, 100 + Math.abs(x1 - x0) * 0.3) * s;
106
+ // A hop through the air: up steeply, a long arc, a soft landing.
107
+ this.flight(actor, [[x0, floor], [x0 + (x1 - x0) * 0.2, floor - top * 1.35], [x1 - (x1 - x0) * 0.2, floor - top * 1.35], [x1, floor]], at, dur, (u) => (1 - Math.cos(u * Math.PI)) / 2, true);
108
+ this.touchDown(actor, at + dur);
109
+ }
110
+ //# sourceMappingURL=flight.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flight.js","sourceRoot":"","sources":["../../src/direct/flight.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAE9B,0GAA0G;AAC1G,MAAM,UAAU,MAAM,CAAmB,KAAa;IACpD,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAA4F,CAAC;IACpJ,OAAO,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,CAAC;AAClD,CAAC;AAED,MAAM,UAAU,QAAQ,CAAmB,KAAa;IACtD,OAAO,CAAC,CAAE,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,QAAyC,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,QAAQ,CAAC,CAAC;AACpI,CAAC;AAED,MAAM,UAAU,KAAK,CAAmB,KAAa;IACnD,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CA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,GAAG,EAAE,CAAC,GAAG,GAAG,EAAE,KAAK,GAAG,GAAG,GAAG,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC;IAC9L,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,EAAE,GAAG,GAAG,CAAC,CAAC;AAClC,CAAC"}
@@ -0,0 +1,59 @@
1
+ import type { BlockScene } from "./scene.js";
2
+ import { type Action } from "./shared.js";
3
+ /** Furniture standing in the block. */
4
+ export declare function placeFurniture(this: BlockScene): void;
5
+ export declare function groundY(this: BlockScene, actor: string, abs: number): number;
6
+ /** Scene point of a furniture anchor in its setup pose (furniture stands still). */
7
+ export declare function furniturePoint(this: BlockScene, id: string, anchor: string): [number, number] | undefined;
8
+ export declare function hasBone(this: BlockScene, actor: string, id: string): boolean;
9
+ export declare function hasChain(this: BlockScene, actor: string, chain: string): boolean;
10
+ /** Both feet planted on the floor at x (scene), the near foot a little ahead. */
11
+ export declare function feetDown(this: BlockScene, actor: string, x: number, dir: number, y: number, at: number, dur: number): void;
12
+ /**
13
+ * Half thickness of the torso on one side (setup px): what rests on the bed or the ground when
14
+ * lying. `RigInfo.depth`, else a guess capped so tails, backpacks or snouts never lift the body.
15
+ */
16
+ export declare function depthOf(this: BlockScene, actor: string, side: "back" | "front"): number;
17
+ /**
18
+ * Lying flat: the spine (hip joint → head) horizontal, whatever the posture (a hunched old turtle's
19
+ * head sits far in front of its hips), face up (head towards the back) or face down. Returns the
20
+ * rotation, the setup point that rests on the surface (back or belly at the hips, `depth` out from
21
+ * the spine), the outward normal of the back, and where that point lands relative to the feet
22
+ * (scene px, after rotation and scale).
23
+ */
24
+ export declare function lying(this: BlockScene, actor: string, dir: number, side: "back" | "front"): {
25
+ rotation: number;
26
+ contact: import("@anime-studio/core").Vec2;
27
+ normal: import("@anime-studio/core").Vec2;
28
+ offset: import("@anime-studio/core").Vec2;
29
+ head: import("@anime-studio/core").Vec2;
30
+ neck: {
31
+ bone: string;
32
+ rotation: number;
33
+ spread?: number;
34
+ } | undefined;
35
+ };
36
+ /**
37
+ * The limbs of a body knocked down on its back: the rig's `knocked` clip over the flight (played
38
+ * once, at the speed that ends it as the hips touch down, its last pose held), then its lying clip
39
+ * `down` from the landing until it gets up (`getUp` ends it; kept on the fall's rest).
40
+ */
41
+ export declare function knockedLimbs(this: BlockScene, actor: string, at: number, dur: number): Action | undefined;
42
+ /** Bends (or straightens) the neck for lying. */
43
+ export declare function bendNeck(this: BlockScene, actor: string, neck: {
44
+ bone: string;
45
+ rotation: number;
46
+ spread?: number;
47
+ } | undefined, abs: number, dur: number): void;
48
+ export declare function hipOf(this: BlockScene, actor: string): [number, number];
49
+ /**
50
+ * Where to sit / lie: a furniture actor, a set mark with a `seat` height, or the ground
51
+ * (`"ground"` or nothing). Reports what is wrong and returns undefined.
52
+ */
53
+ export declare function restPlace(this: BlockScene, actor: string, on: string | null, kind: "sit" | "lie"): {
54
+ furniture: string;
55
+ } | {
56
+ x?: number;
57
+ h: number;
58
+ } | undefined;
59
+ //# sourceMappingURL=furniture.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"furniture.d.ts","sourceRoot":"","sources":["../../src/direct/furniture.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAM,KAAK,MAAM,EAAE,MAAM,UAAU,CAAC;AAG3C,uCAAuC;AACvC,wBAAgB,cAAc,CAAC,IAAI,EAAE,UAAU,QAyB9C;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,UAGnE;AAED,oFAAoF;AACpF,wBAAg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AA;CAAE,GAAG,SAAS,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,QAGxJ;AAED,wBAAgB,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAGvE;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,EAAE,IAAI,EAAE,KAAK,GAAG,KAAK,GAAG;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,CAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAWhK"}
@@ -0,0 +1,149 @@
1
+ /**
2
+ * Furniture and the ground: placing furniture, anchor points, lying geometry and resting places.
3
+ */
4
+ import { compileRig, lyingPose } from "@anime-studio/core";
5
+ import { r3 } from "./shared.js";
6
+ import { closest } from "./vocabulary.js";
7
+ /** Furniture standing in the block. */
8
+ export function placeFurniture() {
9
+ // The set's own furniture (always there) and the block's.
10
+ for (const f of [...(this.setDef.furniture ?? []), ...(this.block.furniture ?? [])]) {
11
+ const def = this.kit.furniture?.[f.kind];
12
+ if (!def) {
13
+ this.issue("error", `furniture "${f.id}": unknown kind "${f.kind}"${closest(f.kind, Object.keys(this.kit.furniture ?? {}))}`);
14
+ continue;
15
+ }
16
+ // Standing on its mark's floor line (e.g. a sofa against the back wall), else the near ground.
17
+ const y = this.markOf(f.at)?.y ?? this.setDef.ground.near;
18
+ this.addActor(f.id, this.placeX(f.at ?? "center", this.t0), { character: def.character, scale: def.scale, y, z: 1.9, flip: f.facing === "left", palette: f.color ? { paint: f.color } : undefined, holds: 0 });
19
+ // A blanket (`meta.cover`: its own rig, drawn over whoever lies there), hidden until then.
20
+ const cover = this.kit.characters[def.character]?.meta?.cover;
21
+ let coverId;
22
+ if (cover) {
23
+ if (!this.kit.characters[cover.character])
24
+ this.issue("error", `furniture "${f.id}": its cover rig "${cover.character}" is not in the kit`);
25
+ else {
26
+ coverId = `${f.id}Cover`;
27
+ this.addActor(coverId, this.placeX(f.at ?? "center", this.t0), { character: cover.character, scale: def.scale, y, z: 2.01, flip: f.facing === "left", palette: f.color ? { paint: f.color } : undefined, holds: 0 });
28
+ this.set(coverId, "opacity", 0, this.t0);
29
+ }
30
+ }
31
+ this.furnitureOf.set(f.id, { kind: f.kind, scale: def.scale, y, ...(coverId ? { cover: coverId } : {}) });
32
+ if (f.wear)
33
+ this.wear(f.id, f.wear, this.t0);
34
+ }
35
+ }
36
+ export function groundY(actor, abs) {
37
+ const far = this.crossed.has(actor) && abs >= this.crossed.get(actor);
38
+ return far ? (this.setDef.ground.far ?? this.setDef.ground.near) : this.setDef.ground.near;
39
+ }
40
+ /** Scene point of a furniture anchor in its setup pose (furniture stands still). */
41
+ export function furniturePoint(id, anchor) {
42
+ const at = (this.kit.characters[this.characterOf(id)]?.anchors ?? {})[anchor]?.at;
43
+ if (!at)
44
+ return undefined;
45
+ const s = this.furnitureOf.get(id).scale;
46
+ const dir = this.facing(id, this.t0) ? 1 : -1;
47
+ return [this.xAt(id, this.t0) + at[0] * s * dir, this.furnitureOf.get(id).y + at[1] * s];
48
+ }
49
+ export function hasBone(actor, id) {
50
+ return !!this.kit.characters[this.characterOf(actor)]?.skeleton?.some((b) => b.id === id);
51
+ }
52
+ export function hasChain(actor, chain) {
53
+ return (this.kit.characters[this.characterOf(actor)]?.ik ?? []).some((k) => k.id === chain);
54
+ }
55
+ /** Both feet planted on the floor at x (scene), the near foot a little ahead. */
56
+ export function feetDown(actor, x, dir, y, at, dur) {
57
+ const s = this.scaleOf(actor);
58
+ if (this.hasChain(actor, "footF"))
59
+ this.push({ at: this.t(at), actor, action: "reach", chain: "footF", target: [Math.round(x + dir * 4 * s), Math.round(y)], duration: dur });
60
+ if (this.hasChain(actor, "footB"))
61
+ this.push({ at: this.t(at), actor, action: "reach", chain: "footB", target: [Math.round(x - dir * 8 * s), Math.round(y)], duration: dur });
62
+ }
63
+ /**
64
+ * Half thickness of the torso on one side (setup px): what rests on the bed or the ground when
65
+ * lying. `RigInfo.depth`, else a guess capped so tails, backpacks or snouts never lift the body.
66
+ */
67
+ export function depthOf(actor, side) {
68
+ const rig = this.member(actor)?.rig;
69
+ return rig?.depth?.[side] ?? Math.min(rig?.extent[side] ?? 34, 34) * 0.7;
70
+ }
71
+ /**
72
+ * Lying flat: the spine (hip joint → head) horizontal, whatever the posture (a hunched old turtle's
73
+ * head sits far in front of its hips), face up (head towards the back) or face down. Returns the
74
+ * rotation, the setup point that rests on the surface (back or belly at the hips, `depth` out from
75
+ * the spine), the outward normal of the back, and where that point lands relative to the feet
76
+ * (scene px, after rotation and scale).
77
+ */
78
+ export function lying(actor, dir, side) {
79
+ const s = this.scaleOf(actor);
80
+ const character = this.characterOf(actor);
81
+ const doc = this.kit.characters[character];
82
+ let rig = this.rigs.get(character);
83
+ if (!rig)
84
+ this.rigs.set(character, (rig = compileRig(doc)));
85
+ // The shared geometry (core `lyingPose`), with the director's own measures of the body: the
86
+ // hip joint and the torso's depth from `RigInfo`, the head anchor, the neck bone drawn with a
87
+ // `from`; the spine lies flat (no lift for a big head).
88
+ const neckBone = doc.skeleton.find((b) => b.id === "neck" && b.from) ?? doc.skeleton.find((b) => b.id === "head" && b.from);
89
+ const g = lyingPose(rig, {
90
+ dir: dir < 0 ? -1 : 1,
91
+ side,
92
+ scale: s,
93
+ hip: this.hipOf(actor),
94
+ head: doc.anchors?.head?.at ?? [0, -(this.member(actor)?.rig.height ?? 200) * 0.85],
95
+ depth: this.depthOf(actor, side),
96
+ neck: neckBone?.id ?? null,
97
+ skull: false,
98
+ });
99
+ return { rotation: g.rotation, contact: g.contact, normal: g.normal, offset: g.offset, head: g.head, neck: g.neck };
100
+ }
101
+ /**
102
+ * The limbs of a body knocked down on its back: the rig's `knocked` clip over the flight (played
103
+ * once, at the speed that ends it as the hips touch down, its last pose held), then its lying clip
104
+ * `down` from the landing until it gets up (`getUp` ends it; kept on the fall's rest).
105
+ */
106
+ export function knockedLimbs(actor, at, dur) {
107
+ const clips = (this.kit.characters[this.characterOf(actor)]?.clips ?? {});
108
+ if (clips.knocked) {
109
+ this.push({ at: this.t(at), actor, action: "play", clip: "knocked", duration: r3(dur + 0.1), loop: false, speed: r3(clips.knocked.duration / dur), fadeIn: 0.02, fadeOut: 0.1 });
110
+ this.busy.push({ actor, t0: at, t1: at + dur });
111
+ }
112
+ if (!clips.down)
113
+ return undefined;
114
+ const down = { at: this.t(at + dur), actor, action: "play", clip: "down", duration: r3(Math.max(0.5, this.t1 - (at + dur) + 0.5)), loop: !!clips.down.loop, fadeIn: 0.1, fadeOut: 0.3 };
115
+ this.push(down);
116
+ return down;
117
+ }
118
+ /** Bends (or straightens) the neck for lying. */
119
+ export function bendNeck(actor, neck, abs, dur) {
120
+ if (neck)
121
+ this.set(actor, `bones.${neck.bone}.rotation`, neck.rotation, abs, dur, "sineInOut");
122
+ if (neck?.spread !== undefined)
123
+ this.set(actor, `bones.${neck.bone}.spread`, neck.spread, abs, dur, "sineInOut");
124
+ }
125
+ export function hipOf(actor) {
126
+ const rig = this.member(actor)?.rig;
127
+ return rig?.hip ?? [0, -Math.round((rig?.height ?? 200) * 0.4)];
128
+ }
129
+ /**
130
+ * Where to sit / lie: a furniture actor, a set mark with a `seat` height, or the ground
131
+ * (`"ground"` or nothing). Reports what is wrong and returns undefined.
132
+ */
133
+ export function restPlace(actor, on, kind) {
134
+ if (!on || on === "ground")
135
+ return { h: 0 };
136
+ if (this.furnitureOf.has(on))
137
+ return { furniture: on };
138
+ const m = this.setDef.marks[on];
139
+ if (m) {
140
+ if (m.seat === undefined)
141
+ return void this.issue("error", `${actor} cannot ${kind} on mark "${on}": it has no "seat" height (set "${this.block.set}")`);
142
+ if (kind === "lie" && !m.lie)
143
+ return void this.issue("error", `${actor} cannot lie on mark "${on}": it is a seat, not a place to lie ("lie": true)`);
144
+ return { x: m.x, h: m.seat };
145
+ }
146
+ const seats = Object.entries(this.setDef.marks).filter(([, mk]) => mk.seat !== undefined).map(([id]) => id);
147
+ return void this.issue("error", `${actor} cannot ${kind} on "${on}": not furniture of the block nor a seat of set "${this.block.set}"${closest(on, [...this.furnitureOf.keys(), ...seats])}`);
148
+ }
149
+ //# sourceMappingURL=furniture.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"furniture.js","sourceRoot":"","sources":["../../src/direct/furniture.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAE,EAAE,EAAe,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,uCAAuC;AACvC,MAAM,UAAU,cAAc;IAC5B,0DAA0D;IAC1D,KAAK,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;QACpF,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,EAAE,oBAAoB,CAAC,CAAC,IAAI,IAAI,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;YAC9H,SAAS;QACX,CAAC;QACD,+FAA+F;QAC/F,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,IAAI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AAE,CAAC,EAAE,CAAC,CAAC;IAC5G,OAAO,KAAK,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,KAAK,WAAW,IAAI,QAAQ,EAAE,oDAAoD,IAAI,CAAC,KAAK,CAAC,GAAG,IAAI,OAAO,CAAC,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,EAAE,GAAG,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;AAChM,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Gestures: hands on things, resolving clip gestures into reaches, seated gestures, cradling.
3
+ */
4
+ import { type SceneDoc } from "@anime-studio/core";
5
+ import type { BlockScene } from "./scene.js";
6
+ /** Scene point of an anchor of a placed rig (furniture, fixtures: they stand still). */
7
+ export declare function placedAnchor(this: BlockScene, id: string, anchor: string): [number, number] | undefined;
8
+ /** Forearms on a table (a fixture or furniture with a `top` anchor): both hands on its top. */
9
+ export declare function handsOn(this: BlockScene, actor: string, on: string, at: number): void;
10
+ /** The chain's staged reach target just before a moment (to come back to after a gesture). */
11
+ export declare function reachBefore(this: BlockScene, actor: string, chain: string, abs: number): unknown;
12
+ /**
13
+ * Front-view gestures as hand positions on the posed face: compiled once the block is staged
14
+ * (sitting, leaning and moving are all known), the near hand (both for some) goes there and back.
15
+ */
16
+ export declare function resolveGestures(this: BlockScene, doc: SceneDoc): void;
17
+ /**
18
+ * A gesture clip's arms, for someone seated on a 2.5D rig: its arm keys looped from `at` to
19
+ * `until` (else once) as sets, then back to rest.
20
+ */
21
+ export declare function gestureSeated(this: BlockScene, actor: string, clip: string, at: number, until?: number): boolean;
22
+ /**
23
+ * Holding a baby (or anyone small) in the arms: both arms in front of the chest in 3D, the little
24
+ * one sitting on them (riding the near hand), drawn in front; until `until`, then put down beside.
25
+ */
26
+ export declare function cradle(this: BlockScene, adult: string, baby: string, at: number, until?: number): void;
27
+ /** The arms a clip moves held at rest (no 3D pose under it) while it plays, kept for it. */
28
+ export declare function clearArms(this: BlockScene, actor: string, clip: string, at: number, until?: number): void;
29
+ /** Talking hands while seated: the near hand up in front of the chest and back, a beat every ~1.6 s. */
30
+ export declare function talkSeated(this: BlockScene, actor: string, s: number, e: number): void;
31
+ //# sourceMappingURL=gestures.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gestures.d.ts","sourceRoot":"","sources":["../../src/direct/gestures.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,KAAK,QAAQ,EAA6D,MAAM,oBAAoB,CAAC;AAC9G,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAG1C,wFAAwF;AACxF,wBAAgB,YAAY,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAMvG;AAED,+FAA+F;AAC/F,wBAAgB,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAM9E;AAED,8FAA8F;AAC9F,wBAAgB,WAAW,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,WAGtF;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,QAAQ,QA2B9D;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAuChH;AAED;;;GAGG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,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