@algorisys/tinyfly 0.91.0 → 0.92.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 +1222 -1116
- package/lib/browser/tinyfly.iife.js +4 -4
- package/lib/browser/tinyfly.js +2452 -2346
- package/lib/browser/tinyfly.umd.js +4 -4
- package/lib/types/characters/index.d.ts +1 -0
- package/lib/types/characters/species/human-motion.d.ts +45 -0
- package/lib/types/characters/species/human.d.ts +2 -0
- package/package.json +1 -1
|
@@ -18,6 +18,7 @@ export * from '../adapters/canvas/polyline';
|
|
|
18
18
|
export * from './hand';
|
|
19
19
|
export * from './character';
|
|
20
20
|
export { humanPlan, humanPose, mirrorHumanPose, humanFieldLabel, HUMAN_REST, HUMAN_POSES, HUMAN_EXPRESSIONS, type HumanBuild, type HumanPoseName } from './species/human';
|
|
21
|
+
export * from './species/human-motion';
|
|
21
22
|
export type { BodyPlan, ChainSpec, BoneSpec, BoneAngles, ContactSpec, HeadSpec, Pose as CharacterPose, Vec3 } from './rig/body-plan';
|
|
22
23
|
export { createPen, ellipsePoints, type Pen, type Look, type PencilOptions, type PenOptions } from './look/pen';
|
|
23
24
|
export { basicOutfit, type BasicOutfitOptions } from './wardrobe/basic-outfit';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { EasingType } from '../../engine/types';
|
|
2
|
+
import type { Pose } from '../rig/body-plan';
|
|
3
|
+
import type { CharacterPoseKey } from '../character';
|
|
4
|
+
import { type Gait, type GaitName } from '../gaits';
|
|
5
|
+
/**
|
|
6
|
+
* The pose `phase` cycles into a gait (0 → 1 is two steps), built on `base`:
|
|
7
|
+
* legs and hanging arms move; raised arms, the face and the view keep
|
|
8
|
+
* `base`'s. `stride` scales the swing.
|
|
9
|
+
*/
|
|
10
|
+
export declare function humanGaitPose(gait: GaitName | Gait | string | undefined, phase: number, base?: Pose, stride?: number): Pose;
|
|
11
|
+
/** Ground covered by one gait cycle (two steps) for a character `height` px tall: the feet stay planted. */
|
|
12
|
+
export declare function humanGaitStrideLength(gait: GaitName | Gait | string | undefined, height: number, stride?: number): number;
|
|
13
|
+
/** One step of a gag: when (ms in), what changes from the pose so far, and the ease into it. */
|
|
14
|
+
export interface HumanGagStep {
|
|
15
|
+
after: number;
|
|
16
|
+
pose: Pose;
|
|
17
|
+
easing?: EasingType;
|
|
18
|
+
}
|
|
19
|
+
/** The gags, each built on the pose it starts from. Same names and timing as the stick figure's `GAGS`. */
|
|
20
|
+
export declare const HUMAN_GAGS: {
|
|
21
|
+
/** Squash down in a squint, shoot up stretched with arms flung up, hang, land squashed, end surprised. */
|
|
22
|
+
take: (from: Pose) => HumanGagStep[];
|
|
23
|
+
/** Glance ahead, look away unbothered, then snap back in shock with a little hop. */
|
|
24
|
+
doubleTake: (from: Pose) => HumanGagStep[];
|
|
25
|
+
/** Rear back for a zip-off: lean back, a knee up, arms cocked; hold; pitch forward ready to run. */
|
|
26
|
+
windUp: () => HumanGagStep[];
|
|
27
|
+
/** Coming down: stretched in the fall, squashed on contact, a spring back up. */
|
|
28
|
+
land: (from: Pose) => HumanGagStep[];
|
|
29
|
+
/** A frightened shiver: paws up, fast small shakes side to side, then still. */
|
|
30
|
+
tremble: (from: Pose) => HumanGagStep[];
|
|
31
|
+
/** A sigh: the body sags, the back curls, the head and arms drop. */
|
|
32
|
+
deflate: (from: Pose) => HumanGagStep[];
|
|
33
|
+
};
|
|
34
|
+
export type HumanGagName = keyof typeof HUMAN_GAGS;
|
|
35
|
+
/**
|
|
36
|
+
* A gag's key poses from `at`, built on the pose it starts from (its view
|
|
37
|
+
* kept). Keys after the first are `act: false`: a gag's timing is already acted.
|
|
38
|
+
*/
|
|
39
|
+
export declare function humanGag(name: HumanGagName, options: {
|
|
40
|
+
at: number;
|
|
41
|
+
from?: Pose;
|
|
42
|
+
speed?: number;
|
|
43
|
+
}): Array<CharacterPoseKey & {
|
|
44
|
+
pose: Pose;
|
|
45
|
+
}>;
|
|
@@ -7,6 +7,8 @@ import { type ExpressionName } from '../stick-figure';
|
|
|
7
7
|
* Pose fields (degrees unless noted):
|
|
8
8
|
* - `turn`: 0 faces the viewer, 1 faces screen-right, 2 shows the back, 3 faces screen-left
|
|
9
9
|
* - `lean` (forward +), `side` (toward the character's left +): the upper body
|
|
10
|
+
* - `bend` (forward +): the line of action, the back curved rather than tipped:
|
|
11
|
+
* it grows up the spine and carries on into the neck
|
|
10
12
|
* - `head.turn` (toward its left +), `head.nod` (down +), `head.tilt` (toward its left shoulder +)
|
|
11
13
|
* - `arm.left.swing` (forward +), `arm.left.spread` (out +), `arm.left.elbow`
|
|
12
14
|
* (forearm forward +), `arm.left.bend` (forearm out +), and the same for `.right`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@algorisys/tinyfly",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.92.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",
|