@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.
@@ -47,6 +47,13 @@ export interface DanceMove {
47
47
  keys: DanceKey[];
48
48
  /** Easing between keys that do not name their own */
49
49
  easing?: EasingType;
50
+ /**
51
+ * Ground covered in one loop, as a fraction of the figure's height, at a
52
+ * steady speed: positive toward +x (the way a side-on figure faces), negative
53
+ * the other way. A glide or a moonwalk travels; most moves stay on the spot.
54
+ * Mirrored front-on it travels the other way; side-on it keeps its direction.
55
+ */
56
+ travel?: number;
50
57
  }
51
58
  /**
52
59
  * What every beat carries, whatever the move: a knee bounce (down on the beat
@@ -139,6 +146,40 @@ export declare function routineBeats(style: DanceStyle | DanceStyleName): number
139
146
  * {@link danceFrame} does, looping it.
140
147
  */
141
148
  export declare function danceTaps(style: DanceStyle | DanceStyleName, from: number, to: number, options?: DanceOptions): DanceTap[];
149
+ /**
150
+ * How far the dance has carried the figure at `beat`, as a fraction of its
151
+ * height (multiply by the height in px for an `x` offset). Travelling moves go
152
+ * at a steady speed, so it is a straight line between step changes; the
153
+ * other moves hold it still. A routine that does not come back to where it
154
+ * started keeps going that way each time it loops.
155
+ */
156
+ export declare function danceTravel(style: DanceStyle | DanceStyleName, beat: number, options?: DanceOptions): number;
157
+ export interface DanceTravelOptions extends DanceOptions {
158
+ /** Tempo (default the style's) */
159
+ bpm?: number;
160
+ /** How many beats (default the routine, or one loop of the move) */
161
+ beats?: number;
162
+ /** When the dance starts, ms (default 0) */
163
+ start?: number;
164
+ /** The figure's height, px: travel is measured in heights */
165
+ height: number;
166
+ /** The `x` offset the figure starts from (default 0) */
167
+ x?: number;
168
+ /**
169
+ * Beats the dance blends in from standing and back out over, as
170
+ * {@link danceTracks}' `fade` (default 1, the same): the glide eases in and
171
+ * out with the pose. 0 travels at full speed from the first beat to the last.
172
+ */
173
+ fade?: number;
174
+ }
175
+ /**
176
+ * The ground a dance covers as an `x` track, to play beside
177
+ * {@link danceTracks} (or {@link bakeDanceTracks}, which adds it itself).
178
+ * Travel goes at a steady speed, so the keys are linear and only where the
179
+ * speed changes, plus a few while it eases in and out with the `fade`.
180
+ * Undefined when the dance stays on the spot.
181
+ */
182
+ export declare function danceTravelTrack(target: string, style: DanceStyle | DanceStyleName, options: DanceTravelOptions): Track | undefined;
142
183
  /** Beats since `start` at `time` (both ms), at `bpm`. */
143
184
  export declare function beatAt(time: number, bpm: number, start?: number): number;
144
185
  /**
@@ -172,12 +213,17 @@ export interface DanceBakeOptions extends DanceOptions {
172
213
  start?: number;
173
214
  /** Keyframes per beat (default 4) */
174
215
  samplesPerBeat?: number;
216
+ /** The figure's height, px: with it a travelling dance (a glide, a moonwalk) moves it, as an `x` track */
217
+ height?: number;
218
+ /** The `x` offset it starts from (default 0) */
219
+ x?: number;
175
220
  }
176
221
  /**
177
222
  * The dance as plain pose keyframes, for any stick-figure target and for
178
223
  * timelines that must stand alone as JSON (no `dance` option needed). Only
179
224
  * joints that move get a track. Hand shapes are baked as `hand.left.*` /
180
225
  * `hand.right.*` tracks, which a target drawn with `style.hands` plays.
226
+ * With `height`, a dance that travels gets an `x` track too.
181
227
  */
182
228
  export declare function bakeDanceTracks(target: string, style: DanceStyle | DanceStyleName, options?: DanceBakeOptions): Track[];
183
229
  /** Ready-made dance styles. Each is plain data: copy one and change it to make your own. */
@@ -192,5 +238,6 @@ export declare const DANCE_STYLES: {
192
238
  bharatanatyam: DanceStyle;
193
239
  charleston: DanceStyle;
194
240
  tap: DanceStyle;
241
+ popping: DanceStyle;
195
242
  };
196
243
  export type DanceStyleName = keyof typeof DANCE_STYLES;
@@ -13,7 +13,7 @@ export * from './erase';
13
13
  export * from '../adapters/canvas/polyline';
14
14
  export * from './hand';
15
15
  export * from './character';
16
- export { humanPlan, humanPose, humanFieldLabel, HUMAN_REST, HUMAN_POSES, HUMAN_EXPRESSIONS, type HumanBuild, type HumanPoseName } from './species/human';
16
+ export { humanPlan, humanPose, mirrorHumanPose, humanFieldLabel, HUMAN_REST, HUMAN_POSES, HUMAN_EXPRESSIONS, type HumanBuild, type HumanPoseName } from './species/human';
17
17
  export type { BodyPlan, ChainSpec, BoneSpec, BoneAngles, ContactSpec, HeadSpec, Pose as CharacterPose, Vec3 } from './rig/body-plan';
18
18
  export { createPen, ellipsePoints, type Pen, type Look, type PencilOptions, type PenOptions } from './look/pen';
19
19
  export { basicOutfit, type BasicOutfitOptions } from './wardrobe/basic-outfit';
@@ -32,6 +32,14 @@ export interface HumanBuild {
32
32
  export declare const HUMAN_REST: Pose;
33
33
  /** A full human pose from the fields that differ from rest. */
34
34
  export declare function humanPose(changes?: Pose): Pose;
35
+ /**
36
+ * The mirror image of a pose, as if seen in a mirror beside the picture: the
37
+ * left limbs, eye, brow and hand take the right's values and the other way
38
+ * round, and the body turns, tips and rolls the other way (`turn` 1, facing
39
+ * screen-right, becomes -1, facing screen-left). Fields of other body plans
40
+ * pass through.
41
+ */
42
+ export declare function mirrorHumanPose(pose: Pose): Pose;
35
43
  /**
36
44
  * Ready-made human poses. Several rest on something other than the feet (a
37
45
  * knee, the hands, the back): the figure is set down on whatever is lowest.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@algorisys/tinyfly",
3
- "version": "0.81.0",
3
+ "version": "0.82.0",
4
4
  "type": "module",
5
5
  "description": "Lightweight, API-driven animation engine and editor. The engine is framework-agnostic and runs in browsers, Web Workers, and Node.",
6
6
  "license": "MIT",