@algorisys/tinyfly 0.93.0 → 0.95.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 +6 -6
- package/docs/acting.md +68 -0
- package/docs/api-reference.md +3 -1
- package/docs/editor-guide.md +1 -1
- package/docs/examples.md +1 -1
- package/docs/getting-started.md +1 -1
- package/docs/gsap-compat.md +1 -1
- package/docs/llm-guide.md +25 -0
- package/docs/maps.md +2 -2
- package/docs/props.md +202 -0
- package/docs/scene-3d.md +141 -0
- package/docs/teaching.md +1 -1
- package/lib/addons/characters.js +5647 -2519
- package/lib/addons/scene-3d.js +140 -138
- package/lib/browser/tinyfly-scene-3d.iife.js +1 -1
- package/lib/browser/tinyfly.iife.js +15 -9
- package/lib/browser/tinyfly.js +7059 -3876
- package/lib/browser/tinyfly.umd.js +15 -9
- package/lib/engine/tinyfly-engine.js +612 -600
- package/lib/engine/tinyfly-engine.umd.cjs +2 -2
- package/lib/types/characters/acting/beat-check.d.ts +12 -5
- package/lib/types/characters/acting/custom.d.ts +66 -0
- package/lib/types/characters/acting/gags.d.ts +10 -0
- package/lib/types/characters/acting/hand-path.d.ts +3 -0
- package/lib/types/characters/acting/index.d.ts +2 -0
- package/lib/types/characters/acting/persona.d.ts +93 -0
- package/lib/types/characters/acting/script.d.ts +10 -5
- package/lib/types/characters/capabilities.d.ts +30 -2
- package/lib/types/characters/character-script-3d.d.ts +80 -0
- package/lib/types/characters/character.d.ts +19 -0
- package/lib/types/characters/figure-actions.d.ts +4 -3
- package/lib/types/characters/ground-path.d.ts +32 -0
- package/lib/types/characters/index.d.ts +3 -0
- package/lib/types/characters/props/clip.d.ts +5 -0
- package/lib/types/characters/props/draw.d.ts +60 -0
- package/lib/types/characters/props/effects.d.ts +12 -0
- package/lib/types/characters/props/families/aircraft.d.ts +37 -0
- package/lib/types/characters/props/families/animals.d.ts +156 -0
- package/lib/types/characters/props/families/birds.d.ts +86 -0
- package/lib/types/characters/props/families/environment.d.ts +71 -0
- package/lib/types/characters/props/families/vehicle.d.ts +129 -0
- package/lib/types/characters/props/hidden.d.ts +49 -0
- package/lib/types/characters/props/index.d.ts +23 -0
- package/lib/types/characters/props/mesh-3d.d.ts +24 -0
- package/lib/types/characters/props/presets.d.ts +34 -0
- package/lib/types/characters/props/ride-3d.d.ts +71 -0
- package/lib/types/characters/props/ride.d.ts +79 -0
- package/lib/types/characters/props/rig.d.ts +224 -0
- package/lib/types/characters/props/scene-objects.d.ts +2 -0
- package/lib/types/characters/props/script-3d.d.ts +85 -0
- package/lib/types/characters/props/script.d.ts +145 -0
- package/lib/types/characters/props/shapes.d.ts +96 -0
- package/lib/types/characters/props/slice.d.ts +66 -0
- package/lib/types/characters/props/target.d.ts +129 -0
- package/lib/types/characters/stick-figure.d.ts +7 -2
- package/lib/types/engine/authoring/index.d.ts +1 -0
- package/lib/types/engine/authoring/spring-follow.d.ts +25 -0
- package/lib/types/scene-3d/object-kind.d.ts +4 -1
- package/lib/types/scene-3d/scene-types.d.ts +41 -1
- package/llms-full.txt +512 -10
- package/llms.txt +28 -27
- package/package.json +1 -1
- package/skills/tinyfly/SKILL.md +11 -0
package/llms-full.txt
CHANGED
|
@@ -204,7 +204,7 @@ with a GSAP-style call (durations are in seconds here):
|
|
|
204
204
|
```html
|
|
205
205
|
<div class="box" style="width:60px;height:60px;background:#4a9eff"></div>
|
|
206
206
|
|
|
207
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
207
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.95.0/cdn/tinyfly.iife.js"></script>
|
|
208
208
|
<script>
|
|
209
209
|
tinyfly.to('.box', { x: 200, duration: 1 })
|
|
210
210
|
</script>
|
|
@@ -412,7 +412,7 @@ Without a build step, the all-in-one bundle exposes the same functions on a
|
|
|
412
412
|
global — `tinyfly.to()`, `tinyfly.timeline()` and so on:
|
|
413
413
|
|
|
414
414
|
```html
|
|
415
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
415
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.95.0/cdn/tinyfly.iife.js"></script>
|
|
416
416
|
<script>
|
|
417
417
|
tinyfly.to('.box', { x: 200, duration: 1 })
|
|
418
418
|
</script>
|
|
@@ -2278,7 +2278,7 @@ For simple website embedding without a build system.
|
|
|
2278
2278
|
</html>
|
|
2279
2279
|
```
|
|
2280
2280
|
|
|
2281
|
-
Build the player with `npm run build:player` to generate `lib/player/tinyfly-player.iife.js`, or load it from the CDN: `https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
2281
|
+
Build the player with `npm run build:player` to generate `lib/player/tinyfly-player.iife.js`, or load it from the CDN: `https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.95.0/cdn/tinyfly-player.iife.js`.
|
|
2282
2282
|
|
|
2283
2283
|
---
|
|
2284
2284
|
|
|
@@ -3011,11 +3011,13 @@ new WebGL2Renderer(gl, { overlay? }) // @algorisys/tinyf
|
|
|
3011
3011
|
loadScene3D(scene, { kinds: [characterObjects] }) // object kinds beyond the built-ins: ObjectKind { kind, validate?, prepare?, resolve }
|
|
3012
3012
|
// from @algorisys/tinyfly/characters:
|
|
3013
3013
|
characterObjects // the `character` object kind (pen or solid look)
|
|
3014
|
+
propObjects // the `prop` object kind: { kind: 'prop', prop: 'car', options?, values?, look?, style? }
|
|
3015
|
+
propPreset(name, options?) / PROP_PRESETS // a prop preset by name (did-you-mean on a wrong one)
|
|
3014
3016
|
drawCharacterInView(ctx, character, pose, projection, { height, time? }) / characterJointsInView(…)
|
|
3015
3017
|
skeletonInView(plan, pose, { height }, projection) / stagePlanSpace(plan, pose, { height }) / solvePlanSpace(plan, pose, height)
|
|
3016
3018
|
```
|
|
3017
3019
|
|
|
3018
|
-
Types: `Scene3D`, `Object3D` (`group`, `mesh`, `camera`, `light`, `character`), `Geometry3D`,
|
|
3020
|
+
Types: `Scene3D`, `Object3D` (`group`, `mesh`, `camera`, `light`, `character`, `prop`), `Geometry3D`,
|
|
3019
3021
|
`Material3D`, `ResolvedScene3D`, `DrawTriangle`. Tracks address objects as
|
|
3020
3022
|
`<sceneId>/<objectId>`; see [3D Scenes](scene-3d.md) for the properties.
|
|
3021
3023
|
|
|
@@ -6464,7 +6466,7 @@ The dialog shows the generated HTML/JavaScript code with a **Copy Code** button.
|
|
|
6464
6466
|
**Steps to embed:**
|
|
6465
6467
|
1. Build the player: `npm run build:player`
|
|
6466
6468
|
2. Copy `lib/player/tinyfly-player.iife.js` to your project (or load
|
|
6467
|
-
`https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
6469
|
+
`https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.95.0/cdn/tinyfly-player.iife.js`
|
|
6468
6470
|
instead; see [Deployment](DEPLOYMENT.md))
|
|
6469
6471
|
3. Copy the generated code into your HTML
|
|
6470
6472
|
4. Adjust the script `src` path if needed
|
|
@@ -7334,6 +7336,213 @@ Both are safe to call twice.
|
|
|
7334
7336
|
|
|
7335
7337
|
---
|
|
7336
7338
|
|
|
7339
|
+
<!-- docs/props.md -->
|
|
7340
|
+
|
|
7341
|
+
# Props: Everyday Objects with Behaviours
|
|
7342
|
+
|
|
7343
|
+
Stories need a world: cars and buses, bikes and tractors, trees and houses,
|
|
7344
|
+
helicopters and planes. In tinyfly these are **props**: objects that act, the
|
|
7345
|
+
way the figures do, and that can be seen from any side.
|
|
7346
|
+
|
|
7347
|
+
```js
|
|
7348
|
+
import { car, propTarget, propScript, drawProp, drawPropEffects } from '@algorisys/tinyfly/characters'
|
|
7349
|
+
|
|
7350
|
+
const prop = car()
|
|
7351
|
+
const target = propTarget({ x: 200, y: 300, prop, scale: 52, values: { turn: 1 }, look: 'pencil' })
|
|
7352
|
+
const script = propScript('car', prop, [
|
|
7353
|
+
{ do: 'honk' },
|
|
7354
|
+
{ do: 'turn', toward: 'viewer' },
|
|
7355
|
+
{ do: 'turn', toward: 'right' },
|
|
7356
|
+
{ do: 'drive', to: 480 },
|
|
7357
|
+
{ do: 'bump' },
|
|
7358
|
+
{ do: 'brake', to: 620 },
|
|
7359
|
+
], { from: 200, ground: 300, scale: 52, start: { turn: 1 }, exaggeration: 1.5 })
|
|
7360
|
+
|
|
7361
|
+
// each frame:
|
|
7362
|
+
drawProp(ctx, target, { time, state }, 'car')
|
|
7363
|
+
drawPropEffects(ctx, script.effects, time)
|
|
7364
|
+
```
|
|
7365
|
+
|
|
7366
|
+
## What a prop is
|
|
7367
|
+
|
|
7368
|
+
A prop is a **3D rig of simple parts on pivots**: boxes, cylinders, ellipsoids,
|
|
7369
|
+
side profiles made solid (`extrude`), flat panels and tubes. Named **controls**
|
|
7370
|
+
move the parts (`wheelSpin` turns the wheels, `door` swings the doors), and
|
|
7371
|
+
**anchors** mark where other things attach (`seat`, `door`, `chimney`).
|
|
7372
|
+
|
|
7373
|
+
It is seen through the same kind of view as the v2 character, so it **turns
|
|
7374
|
+
toward the camera**:
|
|
7375
|
+
|
|
7376
|
+
- `turn` 0 faces the viewer, 1 screen-right, 2 away, 3 (or −1) screen-left,
|
|
7377
|
+
with every angle in between drawn in 3D.
|
|
7378
|
+
- `tilt` sets how far the camera looks down on it (12° gives the ¾ look).
|
|
7379
|
+
|
|
7380
|
+
It is drawn with the characters' pens, so `look: 'clean' | 'pencil' |
|
|
7381
|
+
'silhouette'` match the figures beside it. Each part has its own pencil seed,
|
|
7382
|
+
so lines don't jump as parts change drawing order while turning. Faces are
|
|
7383
|
+
shaded by how they face the light, outlines follow the silhouette and the
|
|
7384
|
+
creases, and a **contact shadow** keeps it on the ground. The shadow shrinks
|
|
7385
|
+
as the prop lifts.
|
|
7386
|
+
|
|
7387
|
+
Every prop has these common controls (plus its own):
|
|
7388
|
+
|
|
7389
|
+
| Control | Unit | What it does |
|
|
7390
|
+
|---|---|---|
|
|
7391
|
+
| `turn` | quarter turns | which way it faces |
|
|
7392
|
+
| `tilt` | degrees | how far the camera looks down on it |
|
|
7393
|
+
| `pitch` | degrees | nose up (+) or down (−) |
|
|
7394
|
+
| `roll` | degrees | tipped onto a side |
|
|
7395
|
+
| `squash` | factor | squash and stretch about the ground, keeping volume |
|
|
7396
|
+
| `lift` | metres | off the ground |
|
|
7397
|
+
| `lean` | shear | the top sheared forward (speed) or back (drag) |
|
|
7398
|
+
| `size` | factor | its size: 0 gone, 1 as built |
|
|
7399
|
+
|
|
7400
|
+
`describeTarget(target)` lists them all with the prop's own controls and its
|
|
7401
|
+
actions; `checkTracks` checks tracks against them.
|
|
7402
|
+
|
|
7403
|
+
## Behaviours and the 12 principles
|
|
7404
|
+
|
|
7405
|
+
`propScript(id, prop, beats, options)` compiles beats into tracks through the
|
|
7406
|
+
same acting pass the figures use. Families write their actions as key poses of
|
|
7407
|
+
the controls, and the pass adds the rest. The principles, and where they live:
|
|
7408
|
+
|
|
7409
|
+
| Principle | In props |
|
|
7410
|
+
|---|---|
|
|
7411
|
+
| Squash and stretch | `squash` (volume-preserving): bumps, landings, pops, honks |
|
|
7412
|
+
| Anticipation | a drive rocks back and squats before it lunges; a helicopter's skids squash as it spools up |
|
|
7413
|
+
| Staging, solid drawing | `turn` and `tilt`: any view, drawn in 3D |
|
|
7414
|
+
| Straight ahead and pose to pose | keyed beats, plus procedural motion (gusts, hovering bob) |
|
|
7415
|
+
| Follow-through, overlapping action | the acting rig's depths (the canopy trails the trunk); `springFollow` (a car's antenna trails on a spring) |
|
|
7416
|
+
| Slow in and slow out | eases, and the acting style |
|
|
7417
|
+
| Arcs | lift curves, flight paths, a plane's loop |
|
|
7418
|
+
| Secondary action | effects: dust, exhaust, skid marks, honk lines, leaves, smoke |
|
|
7419
|
+
| Timing | acting styles (`full`, `snappy`, `limited`), drawing on twos |
|
|
7420
|
+
| Exaggeration | `exaggeration`: 0.5 restrained, 1 as designed, 2 a cartoon |
|
|
7421
|
+
| Appeal | the families' design |
|
|
7422
|
+
|
|
7423
|
+
Options:
|
|
7424
|
+
- `from` / `ground`: where its middle was placed (its `x`/`y` tracks are offsets).
|
|
7425
|
+
- `scale`: px per metre, as its target draws it.
|
|
7426
|
+
- `style`: an acting style (default `snappy`).
|
|
7427
|
+
- `exaggeration`: as above.
|
|
7428
|
+
- `start`: its starting control values.
|
|
7429
|
+
|
|
7430
|
+
The result gives `tracks`, `beats` (with `contact` / `release` times, as figure
|
|
7431
|
+
beats do) and `effects` (cues for `drawPropEffects`).
|
|
7432
|
+
|
|
7433
|
+
Beats have the fields `do`, `at`, `for`, `to`, `toward`, `speed`, `open`, `on`,
|
|
7434
|
+
`height` and `wind`. `checkPropBeats(beats, prop)` reports wrong names with the
|
|
7435
|
+
one probably meant, and `propScript` throws on them.
|
|
7436
|
+
|
|
7437
|
+
**Every prop can:**
|
|
7438
|
+
- `hold`
|
|
7439
|
+
- `turn` (`toward`: viewer, right, away, left, or a number)
|
|
7440
|
+
- `pop`: spring into being, stretched, with overshoot
|
|
7441
|
+
- `vanish`
|
|
7442
|
+
|
|
7443
|
+
## The families
|
|
7444
|
+
|
|
7445
|
+
| Preset | Actions |
|
|
7446
|
+
|---|---|
|
|
7447
|
+
| `car()`, `truck()`, `bus()`, `tractor()`, `cart()`, `trainCar()`, `bike()`, `motorbike()` | `drive` (`to`), `brake` (`to`, a skid with locked wheels), `bump`, `honk`, `door` (`open`), `lights` (`on`) — doors and lights where it has them |
|
|
7448
|
+
| `tree()` | `sway` (`wind`, `for`), `shake`, `shedLeaves` |
|
|
7449
|
+
| `house()` | `door` (`open`), `lights` (`on`), `smoke` (`for`, runs in the background), `shake` |
|
|
7450
|
+
| `helicopter()` | `takeOff` (`height`), `fly` (`to`, `height`), `hover`, `land` |
|
|
7451
|
+
| `airplane()` | `takeOff` (`to`, `height`), `fly` (`to`, `height`), `loop`, `land` (`to`) |
|
|
7452
|
+
| `horse()` | `walk`, `trot`, `canter`, `gallop` (`to`), `rear`, `buck`, `neigh`, `graze`, `sit`, `jump`, `nod`, `swish` |
|
|
7453
|
+
| `dog()` | `walk`, `trot`, `run` (`to`), `bark`, `wag`, `sniff`, `sit`, `jump`, `nod`, `swish` |
|
|
7454
|
+
| `cat()` | `walk`, `trot`, `run` (`to`), `meow`, `arch`, `pounce` (`to`), `sit`, `jump`, `nod`, `swish` |
|
|
7455
|
+
| `cow()` | `walk`, `trot` (`to`), `moo`, `graze`, `sit`, `jump`, `nod`, `swish` |
|
|
7456
|
+
| `songbird()`, `crow()` | `hop`, `walk` (`to`), `peck` (`for`), `flap` (`for`), `fly` (`to`, `height`), `land` (`height`, `to`), `tweet` / `caw` |
|
|
7457
|
+
| `chicken()` | `walk` (`to`), `peck`, `flap`, `flutter`, `cluck` (it cannot fly) |
|
|
7458
|
+
|
|
7459
|
+
**Line art.** `propTarget({ …, style: 'stick' })` (or `drawSolvedProp(…, { style: 'stick' })`)
|
|
7460
|
+
draws a prop as line art to go with stick figures: tubes (legs, necks, tails,
|
|
7461
|
+
frames) as single even strokes, other shapes outlined and filled with the
|
|
7462
|
+
paper colour (`paper`), dark details kept dark. Both looks work with it.
|
|
7463
|
+
|
|
7464
|
+
**Animals.** `quadruped(spec)` builds a four-legged animal from proportions;
|
|
7465
|
+
`horse()`, `dog()`, `cat()` and `cow()` are presets. A horse is a prop too: a barrel body, neck, head, four jointed
|
|
7466
|
+
legs and a tail. A rig's `derive` works its legs out from its gait (`gait`: 0
|
|
7467
|
+
walk, 1 trot, 2 canter, 3 gallop) and the phase of its stride (`walk`), each
|
|
7468
|
+
gait with its own footfall pattern (four beats; diagonal pairs; three beats
|
|
7469
|
+
with a rock; the gallop). The phase is keyed with the distance, so the hooves
|
|
7470
|
+
keep pace with the ground. Rearing pitches it up about its hind hooves; its
|
|
7471
|
+
tail trails on a spring.
|
|
7472
|
+
|
|
7473
|
+
**Birds.** `bird(spec)` builds one from proportions; `songbird()`, `crow()` and
|
|
7474
|
+
`chicken()` are presets. Its wings fold back along the body at rest and open
|
|
7475
|
+
out with `spread`. They beat from the shoulders: `flap` raises or lowers them,
|
|
7476
|
+
and while `flapping` is on, the rig's `derive` beats them from a phase,
|
|
7477
|
+
`wingbeat`, keyed steadily so the wings keep their rhythm (a songbird nine beats
|
|
7478
|
+
a second, a crow four). Its head pecks from a neck joint (`peck`; a chicken's
|
|
7479
|
+
neck stretches down to reach), and it walks with its head bobbing or hops.
|
|
7480
|
+
`fly` takes off with a crouch and a leap (no crouch if it is already in the
|
|
7481
|
+
air) and flies to `height` metres; `land` comes down to the ground or to a
|
|
7482
|
+
perch (`height`). Perch it with anchors:
|
|
7483
|
+
|
|
7484
|
+
```js
|
|
7485
|
+
const branch = propAt(treeTarget, { time: 0 }, 'tree').anchor('branch')
|
|
7486
|
+
const perch = (GROUND - branch.y) / birdScale // metres above the ground
|
|
7487
|
+
propScript('robin', songbird(), [
|
|
7488
|
+
{ do: 'fly', to: 380, height: 0.25 }, { do: 'land' }, { do: 'hop', to: 410 }, { do: 'peck' },
|
|
7489
|
+
{ do: 'fly', to: branch.x, height: perch }, { do: 'land', height: perch }, { do: 'tweet' },
|
|
7490
|
+
], { from: branch.x, ground: GROUND, scale: birdScale, start: { turn: 1, lift: perch } })
|
|
7491
|
+
```
|
|
7492
|
+
|
|
7493
|
+
Wheels **roll exactly the distance driven**: `wheelSpin` is keyed in step with
|
|
7494
|
+
the motion, and wheels of different sizes (a tractor's) turn at their own
|
|
7495
|
+
rates. Rotors and propellers spin from `rotor`, keyed exactly, and blur into a
|
|
7496
|
+
disc at speed.
|
|
7497
|
+
|
|
7498
|
+
Make your own from the family generators: `vehicle(spec)` takes:
|
|
7499
|
+
- a body side profile and a width
|
|
7500
|
+
- a glass cabin with pillars
|
|
7501
|
+
- wheels (any radius; `side: 0` for a bike's middle line; `style: 'spoked'`)
|
|
7502
|
+
- doors, lights, side windows, frame tubes, an antenna, a seat and extra parts
|
|
7503
|
+
|
|
7504
|
+
`tree(spec)` and `house(spec)` take sizes and colours.
|
|
7505
|
+
|
|
7506
|
+
## Figures with props
|
|
7507
|
+
|
|
7508
|
+
- **Riding.** `propRide({ prop, propId, propTracks, anchor: 'seat', figure, figureId, start, end, offset })`
|
|
7509
|
+
writes a figure's `x`/`y` (and `turn`/`facing`) so it is carried at an
|
|
7510
|
+
anchor and turns with the prop. `spliceTracks(heroTracks, ride, { from, to })`
|
|
7511
|
+
puts that into the figure's script. Pass a rider to `drawProp(…, { rider })`
|
|
7512
|
+
and it is drawn between the prop's far and near parts: a driver behind the
|
|
7513
|
+
windscreen, a figure in a doorway behind a door until it opens.
|
|
7514
|
+
- **Towing.** `propTow({ leader, leaderId, leaderTracks, hitch: 'hitch', towed, towedId, anchor: 'shafts', start, end })`
|
|
7515
|
+
makes a prop follow another: a cart behind a horse turns with it, keeps its
|
|
7516
|
+
shaft tips on the horse's hitch, and rolls its wheels the distance it covers.
|
|
7517
|
+
- **Reaching.** Figure beats aim at anchors:
|
|
7518
|
+
`propAt(target, frame, id).anchor('door')` gives the scene point for a
|
|
7519
|
+
`put`, `grab` or `push`.
|
|
7520
|
+
|
|
7521
|
+
See the gallery cards **Road Trip**, **Windy Day**, **Helicopter**,
|
|
7522
|
+
**Traffic**, **Horse & Cart**, **Farmyard**, **Birds** and **3D Scene: Village**.
|
|
7523
|
+
|
|
7524
|
+
## In 3D scenes
|
|
7525
|
+
|
|
7526
|
+
Props stand in `@algorisys/tinyfly/scene-3d` scenes too:
|
|
7527
|
+
`{ kind: 'prop', prop: 'car', position, rotation, values }` with
|
|
7528
|
+
`loadScene3D(scene, { kinds: [characterObjects, propObjects] })`. The scene's
|
|
7529
|
+
camera sees them in perspective from anywhere, drawn with the same pens; each
|
|
7530
|
+
prop is drawn a column at a time, so figures walking round a bus or a house
|
|
7531
|
+
sort rightly against it. A part's `layer` says which of two parts that sit
|
|
7532
|
+
into each other is drawn over in 3D (a cabin over a car's body).
|
|
7533
|
+
`propScript3D(id, prop, beats, { scene, position, heading })` scripts them in
|
|
7534
|
+
world metres: `{ do: 'drive', to: [x, z] }`, `{ do: 'walk', through: [[x, z], …] }`,
|
|
7535
|
+
`{ do: 'fly', to, height }`, `{ do: 'face', toward }`, and their actions,
|
|
7536
|
+
with wheels and strides keyed with the distance (from each prop's `moves`).
|
|
7537
|
+
`propPreset(name, options)` makes a preset by name. See
|
|
7538
|
+
[3D Scenes](scene-3d.md#props) and the gallery card **3D Scene: Village**.
|
|
7539
|
+
|
|
7540
|
+
## Not yet
|
|
7541
|
+
|
|
7542
|
+
- Pedalling and steering poses for riders
|
|
7543
|
+
|
|
7544
|
+
---
|
|
7545
|
+
|
|
7337
7546
|
<!-- docs/llm-guide.md -->
|
|
7338
7547
|
|
|
7339
7548
|
# Building Animations with an LLM
|
|
@@ -7364,6 +7573,31 @@ It is also the last part of `llms-full.txt`.
|
|
|
7364
7573
|
From code, the same catalog is `capabilities()` (and `capabilitiesMarkdown()`)
|
|
7365
7574
|
in `@algorisys/tinyfly/characters`.
|
|
7366
7575
|
|
|
7576
|
+
## Props
|
|
7577
|
+
|
|
7578
|
+
For objects in a story (vehicles, trees, houses, aircraft, animals, birds),
|
|
7579
|
+
use the presets (`car()`, `tree()`, `helicopter()`, `dog()`, `crow()`…) with
|
|
7580
|
+
`propTarget` and `propScript`; the catalog lists each preset's actions,
|
|
7581
|
+
controls and anchors, and `checkPropBeats` checks prop beats. `style: 'stick'`
|
|
7582
|
+
draws any prop as line art to go with stick figures. A bird's `lift` is in
|
|
7583
|
+
metres: to perch it on a branch or a roof, work the height out from that
|
|
7584
|
+
prop's anchor (`propAt(tree, frame, 'tree').anchor('branch')`). In a 3D
|
|
7585
|
+
scene a prop is an object, `{ kind: 'prop', prop: 'car', position, rotation: [0, 90, 0] }` (`rotateY` is a track, not a field),
|
|
7586
|
+
loaded with `kinds: [characterObjects, propObjects]`; its controls are tracks
|
|
7587
|
+
on the object. Script it in world metres with `propScript3D` (`to: [x, z]`,
|
|
7588
|
+
`through: [[x, z], …]`, `face`), not with `propScript`, whose `to` is screen px.
|
|
7589
|
+
Characters in a 3D scene walk the same way with `characterScript3D`
|
|
7590
|
+
(`{ do: 'walk', to: [x, z] }`, `pose`, `gag`, `face`, `place`); a rider is
|
|
7591
|
+
seated with `propRide3D` and spliced into its script with `spliceTracks`. See `docs/props.md`.
|
|
7592
|
+
|
|
7593
|
+
## Your own behaviours
|
|
7594
|
+
|
|
7595
|
+
Write new actions with `defineAction()` (from beats, or as timed pose steps),
|
|
7596
|
+
new gaits with `defineGait()`, and characters with `persona()`. Pass them where
|
|
7597
|
+
they are used; `persona.describe()` and `capabilities(version, cast)` list them,
|
|
7598
|
+
and the checks accept them. See "Your own actions, gaits and personas" in
|
|
7599
|
+
`docs/acting.md`.
|
|
7600
|
+
|
|
7367
7601
|
## 2. Ask a target what it can do
|
|
7368
7602
|
|
|
7369
7603
|
```js
|
|
@@ -7491,7 +7725,7 @@ path for all of that:
|
|
|
7491
7725
|
</figure>
|
|
7492
7726
|
|
|
7493
7727
|
<!-- once, anywhere on the page (a site-wide footer is fine) -->
|
|
7494
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
7728
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.95.0/cdn/tinyfly-embed.iife.js" data-tinyfly-auto></script>
|
|
7495
7729
|
```
|
|
7496
7730
|
|
|
7497
7731
|
Every `[data-tinyfly-embed]` mounts when the page is ready, with no per-post
|
|
@@ -8566,8 +8800,8 @@ On a page with no build step, load the maps add-on after the browser bundle; it
|
|
|
8566
8800
|
adds to the same `tinyfly` global:
|
|
8567
8801
|
|
|
8568
8802
|
```html
|
|
8569
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
8570
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
8803
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.95.0/cdn/tinyfly.iife.js"></script>
|
|
8804
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.95.0/cdn/tinyfly-maps.iife.js"></script>
|
|
8571
8805
|
```
|
|
8572
8806
|
|
|
8573
8807
|
It is a separate script because the offline world map it carries adds about
|
|
@@ -9027,6 +9261,74 @@ leaves, with a time, a scene x and y and a length, ready for `drawDustPuff`.
|
|
|
9027
9261
|
Any beat can also take `onto` (a scene y): the figure is carried to that floor
|
|
9028
9262
|
over the beat, as when the line it stands on moves up.
|
|
9029
9263
|
|
|
9264
|
+
## Your own actions, gaits and personas
|
|
9265
|
+
|
|
9266
|
+
Behaviours of your own are plain values passed where they are used; nothing
|
|
9267
|
+
is registered globally.
|
|
9268
|
+
|
|
9269
|
+
**Actions** come in two kinds. Built from other beats (a macro):
|
|
9270
|
+
|
|
9271
|
+
```js
|
|
9272
|
+
const nervousPoint = defineAction({
|
|
9273
|
+
summary: 'Trembles, then points at the target.',
|
|
9274
|
+
needs: ['target'],
|
|
9275
|
+
beats: (beat) => [{ do: 'tremble' }, { do: 'point', target: beat.target }],
|
|
9276
|
+
})
|
|
9277
|
+
```
|
|
9278
|
+
|
|
9279
|
+
Or written as timed pose steps from the pose it starts on, like a gag:
|
|
9280
|
+
|
|
9281
|
+
```js
|
|
9282
|
+
const facepalm = defineAction({
|
|
9283
|
+
summary: 'Drops its face into its hand.',
|
|
9284
|
+
steps: (from) => [
|
|
9285
|
+
{ after: 220, pose: { rightShoulder: 150, rightElbow: 155, headTilt: from.headTilt - 10 }, easing: 'ease-out' },
|
|
9286
|
+
{ after: 900, pose: { headTilt: from.headTilt - 16 } },
|
|
9287
|
+
],
|
|
9288
|
+
})
|
|
9289
|
+
```
|
|
9290
|
+
|
|
9291
|
+
**Gaits** are data, like the built-in ones: `defineGait({ swing, knee, arm,
|
|
9292
|
+
elbow, lean, cycle?, sway?, … })` (degrees; `cycle` is ms per two steps).
|
|
9293
|
+
|
|
9294
|
+
Pass them to `scriptTracks(id, beats, { actions, gaits })`, `checkBeats(beats,
|
|
9295
|
+
{ actions, gaits })` and the figure that draws them
|
|
9296
|
+
(`stickFigureTarget({ …, cast: { actions, gaits } })`, which lists them in
|
|
9297
|
+
`describeTarget`). A custom name may not reuse a built-in one. A beats action's
|
|
9298
|
+
first beat keeps the original's `at`, and its `mood` and `say` go to the first
|
|
9299
|
+
beat that has none; the expanded beats are checked too.
|
|
9300
|
+
|
|
9301
|
+
**Personas** bundle a character: its look, acting style, gait, usual face,
|
|
9302
|
+
stance and own actions.
|
|
9303
|
+
|
|
9304
|
+
```js
|
|
9305
|
+
const junior = persona({
|
|
9306
|
+
name: 'Junior', summary: 'A nervous junior developer',
|
|
9307
|
+
look: { color: '#89b4fa', rubber: 0.7 }, height: 92,
|
|
9308
|
+
acting: 'full', gait: 'sneak', mood: 'worried', stance: 'rest',
|
|
9309
|
+
actions: { facepalm },
|
|
9310
|
+
})
|
|
9311
|
+
const hero = junior.figure({ x: 600, y: 300, facing: -1 })
|
|
9312
|
+
const script = junior.script('hero', [
|
|
9313
|
+
{ do: 'go', to: 300 }, // walks in its own gait
|
|
9314
|
+
{ do: 'facepalm', say: 'Oh no.' },
|
|
9315
|
+
{ do: 'stand' }, // back to its stance and usual face
|
|
9316
|
+
], { from: 600, ground: 300, facing: -1 })
|
|
9317
|
+
junior.check(beats) // its own actions count as known
|
|
9318
|
+
junior.describe() // { name, summary, habits, actions, own }
|
|
9319
|
+
junior.handPath('hero', script.tracks, { x: 600, y: 300, start, end })
|
|
9320
|
+
```
|
|
9321
|
+
|
|
9322
|
+
`go` is a built-in action: it walks in the persona's gait (in `walk` without
|
|
9323
|
+
one). Scripts are deterministic, so two personas can be timed against each
|
|
9324
|
+
other by reading one's `beats` before writing the other's (the **Code Review**
|
|
9325
|
+
example does).
|
|
9326
|
+
|
|
9327
|
+
## Props
|
|
9328
|
+
|
|
9329
|
+
Vehicles, trees, houses and aircraft act from beats through the same acting
|
|
9330
|
+
pass, and figures can ride them: see [Props](props.md).
|
|
9331
|
+
|
|
9030
9332
|
## Acting on code
|
|
9031
9333
|
|
|
9032
9334
|
`codePanel()` makes a code listing a scene object. Its layout is plain
|
|
@@ -9807,10 +10109,151 @@ plays in 3D: `stickToHuman(danceFrame(style, beat))` gives the pose, and
|
|
|
9807
10109
|
`lift` and ground contact behave as they do front-on; seen front-on through a
|
|
9808
10110
|
flat camera, a character is exactly the 2D figure.
|
|
9809
10111
|
|
|
10112
|
+
**Walking in metres.** `characterScript3D(id, beats, { scene, position, heading, height })`
|
|
10113
|
+
scripts a character in world metres, as `propScript3D` does props:
|
|
10114
|
+
|
|
10115
|
+
```js
|
|
10116
|
+
import { characterScript3D } from '@algorisys/tinyfly/characters'
|
|
10117
|
+
|
|
10118
|
+
const tum = characterScript3D('tum', [
|
|
10119
|
+
{ do: 'walk', to: [1.4, 1.6] }, // a gait, to a point [x, z] metres
|
|
10120
|
+
{ do: 'pose', pose: 'wave', for: 500 }, // a named pose (or pose fields)
|
|
10121
|
+
{ do: 'run', through: [[3.5, 0], [2.5, -3], [-3, 0]] }, // along a smooth path
|
|
10122
|
+
{ do: 'face', toward: [0, 3] }, // a point, or a heading in degrees
|
|
10123
|
+
{ do: 'gag', gag: 'take' },
|
|
10124
|
+
], { scene: 'village', position: [0.6, 0.2], heading: 0 })
|
|
10125
|
+
```
|
|
10126
|
+
|
|
10127
|
+
A move is a gait (`walk`, `run`, `sneak`, `strut`, `tired`, `bouncy`,
|
|
10128
|
+
`doubleBounce`, `shove`); it turns to face the way first and goes at the
|
|
10129
|
+
gait's pace for its height (or `speed`, `for`). It keys `walk` (the gait's
|
|
10130
|
+
phase) with the distance, one stride per cycle, so the feet stay planted, plus
|
|
10131
|
+
`walking` (eased in and out) and `gait`. The character object turns those into
|
|
10132
|
+
the stepping pose as it draws, on the pose it holds: a wave carries on while it
|
|
10133
|
+
walks. Objects take `gait` and `walking` as fields too.
|
|
10134
|
+
|
|
10135
|
+
**Riding.** `propRide3D({ prop, propId, propTracks, scene, placement, anchor, riderId, pose, start, end, mount?, dismount? })`
|
|
10136
|
+
keeps a rider's hips on a prop's seat anchor (a horse's `saddle`, a bike's or
|
|
10137
|
+
a cart's `seat`) as the prop moves, turns, bobs with its stride and pitches,
|
|
10138
|
+
writing the rider's `x`, `y`, `z` and `rotateY`; `mount: { from: [x, z] }` and
|
|
10139
|
+
`dismount: { to: [x, z] }` hop it on and off. `spliceTracks(riderTracks, ride, { from, to })`
|
|
10140
|
+
puts the ride into the rider's script, which holds the riding pose
|
|
10141
|
+
(`RIDING_POSES.astride` or `.seated`) meanwhile and `place`s it where it got
|
|
10142
|
+
off. A character in a scene is drawn part by part, each part at its own depth
|
|
10143
|
+
(`characterPartsInView`), so a leg astride a horse shows on each side of it.
|
|
10144
|
+
A seat inside a closed cabin (a car's) is not handled yet: its glass is opaque
|
|
10145
|
+
in 3D.
|
|
10146
|
+
|
|
9810
10147
|
Outside scenes, `drawCharacterInView(ctx, character, pose, projection, { height })`
|
|
9811
10148
|
draws a character through any camera (`projection.toView` / `toScreen`), and
|
|
9812
10149
|
`skeletonInView` / `stagePlanSpace` give its joints.
|
|
9813
10150
|
|
|
10151
|
+
## Props
|
|
10152
|
+
|
|
10153
|
+
Props (cars, trucks, trees, houses, aircraft, horses, dogs, birds…) stand in
|
|
10154
|
+
scenes too, named by their preset in plain data and drawn with the same pens
|
|
10155
|
+
as the characters, solid or as line art:
|
|
10156
|
+
|
|
10157
|
+
```js
|
|
10158
|
+
import { characterObjects, propObjects } from '@algorisys/tinyfly/characters'
|
|
10159
|
+
|
|
10160
|
+
const scene = loadScene3D({
|
|
10161
|
+
id: 'village', camera: 'cam', /* … */
|
|
10162
|
+
objects: [
|
|
10163
|
+
/* camera, lights, ground … */
|
|
10164
|
+
{ id: 'car', kind: 'prop', prop: 'car', position: [0, 0, 3], rotation: [0, 90, 0], values: { door: 1 } },
|
|
10165
|
+
{ id: 'barn', kind: 'prop', prop: 'house', position: [3.5, 0, -5], options: { colors: { walls: '#c0583f' } } },
|
|
10166
|
+
{ id: 'crow', kind: 'prop', prop: 'crow', position: [0, 3, 0], values: { spread: 1, flapping: 1 }, style: 'stick' },
|
|
10167
|
+
],
|
|
10168
|
+
}, { kinds: [characterObjects, propObjects] })
|
|
10169
|
+
```
|
|
10170
|
+
|
|
10171
|
+
| Field | |
|
|
10172
|
+
|---|---|
|
|
10173
|
+
| `prop` | the preset's name (`car`, `truck`, `bus`, `tractor`, `cart`, `trainCar`, `bike`, `motorbike`, `tree`, `house`, `helicopter`, `airplane`, `horse`, `dog`, `cat`, `cow`, `songbird`, `crow`, `chicken`); a wrong one is refused with the one probably meant |
|
|
10174
|
+
| `options` | the preset's options (colours, sizes) |
|
|
10175
|
+
| `values` | its control values as placed (`door`, `lights`, `spread`, …) |
|
|
10176
|
+
| `look` | `clean` (default), `pencil` or `silhouette`, drawn with the figures' pens; or `mesh`, built of the scene's own meshes |
|
|
10177
|
+
| `shading`, `outline` | the mesh look's shading (`toon` by default) and outline width in px (default 2) |
|
|
10178
|
+
| `style` | `solid` (default) or `stick` (line art) |
|
|
10179
|
+
| `ink`, `paper` | outline colour, and the paper a stick prop is filled with |
|
|
10180
|
+
| `shadow` | its contact shadow (default true) |
|
|
10181
|
+
|
|
10182
|
+
A prop is built in metres, faces +z and stands on its object's ground; the
|
|
10183
|
+
scene's camera turns it (its own `turn` and `tilt` are not used), and faces
|
|
10184
|
+
are culled toward the camera's eye, so it is right in perspective close up.
|
|
10185
|
+
Its controls are tracks on its object: `village/car` `wheelSpin`,
|
|
10186
|
+
`village/horse` `walk` and `walking`, `village/crow` `wingbeat`. Keep wheels
|
|
10187
|
+
and strides honest the way the 2D scripts do: key `wheelSpin` as the distance
|
|
10188
|
+
over the wheel radius (`car().wheelRadius`), and a horse's `walk` phase as the
|
|
10189
|
+
distance over `horseStrideLength('walk')`.
|
|
10190
|
+
|
|
10191
|
+
**Scripting props in metres.** `propScript3D(id, prop, beats, { scene, position, heading })`
|
|
10192
|
+
compiles beats with world targets into the object's tracks (`x`, `z`,
|
|
10193
|
+
`rotateY` and its controls):
|
|
10194
|
+
|
|
10195
|
+
```js
|
|
10196
|
+
import { propScript3D, car, horse, crow } from '@algorisys/tinyfly/characters'
|
|
10197
|
+
|
|
10198
|
+
const drive = propScript3D('car', car(), [
|
|
10199
|
+
{ do: 'drive', to: [9, 3] }, // a point on the ground, [x, z] metres
|
|
10200
|
+
{ do: 'honk' }, // any action, as in 2D (controls only)
|
|
10201
|
+
{ do: 'drive', through: [[11, 4.6], [9, 6.2], [-9, 6.2]] }, // a smooth path through points
|
|
10202
|
+
{ do: 'face', toward: [0, 0] }, // a point, or a heading in degrees
|
|
10203
|
+
], { scene: 'village', position: [-9, 3], heading: 90 })
|
|
10204
|
+
const flight = propScript3D('crow', crow(), [{ do: 'fly', to: [2, 1], height: 0 }], { scene: 'village', position: [0, 5], values: { lift: 3 } })
|
|
10205
|
+
const timeline = deserializeTimeline({ id: 'village', tracks: [...drive.tracks, ...flight.tracks] })
|
|
10206
|
+
```
|
|
10207
|
+
|
|
10208
|
+
A move (a prop's `moves`: `drive`; `walk`, `trot`, `canter`, `gallop` or
|
|
10209
|
+
`run`; a bird's `walk` and `fly`; an aircraft's `fly`) turns to face the way
|
|
10210
|
+
first, then goes at its own speed (or `speed`, metres per second, or `for`
|
|
10211
|
+
ms), easing in and out. Its wheels and strides are keyed with the distance at
|
|
10212
|
+
every moment, so wheels roll and feet step exactly; a wingbeat or a rotor
|
|
10213
|
+
keeps time. A flier's `height` is how high it goes (`0` lands it); between
|
|
10214
|
+
flights it stays up with its wings beating. `face`, `hold` and the prop's own
|
|
10215
|
+
actions (`honk`, `bark`, `peck`, `door`…) work as in 2D. `checkPropBeats3D`
|
|
10216
|
+
names what was probably meant; `end` gives where it finished, for the next
|
|
10217
|
+
script.
|
|
10218
|
+
|
|
10219
|
+
**Lit by the scene.** A pen-drawn prop is lit by the scene's lights as its
|
|
10220
|
+
meshes are (ambient, directional, point and spot, with fog): each face at its
|
|
10221
|
+
place in the world, so a low orange sun warms its sunlit sides and a night's
|
|
10222
|
+
blue moon darkens it. Glowing parts (lit windows, headlights: a house's or a
|
|
10223
|
+
car's `lights` control) glow over the top, so they shine in the dark. A scene
|
|
10224
|
+
with no lights keeps the props' own light, which follows the camera; line art
|
|
10225
|
+
(`style: 'stick'`) stays unlit. A pen-drawn character's skin takes the light
|
|
10226
|
+
reaching its chest from the camera's side (at most its own colour) and the fog
|
|
10227
|
+
there: lit from behind the camera its face shows, against a low sun it goes
|
|
10228
|
+
dark, at night it dims. Its ink is its own, so give a character a light ink in
|
|
10229
|
+
a dark scene (`character: { ink: '#dfe5f0' }`). The solid look is lit as
|
|
10230
|
+
meshes are.
|
|
10231
|
+
|
|
10232
|
+
**The mesh look.** `look: 'mesh'` builds a prop of the scene's own meshes, as
|
|
10233
|
+
a character's `look: 'solid'` does: each part's shape is built once and placed
|
|
10234
|
+
each frame, lit and outlined like everything else, glass see-through (so a
|
|
10235
|
+
driver shows behind a windscreen), glowing parts as light of their own, hidden
|
|
10236
|
+
faces left out, its shadow a soft disc. With the WebGL2 renderer its depth
|
|
10237
|
+
order is exact, pixel by pixel; the canvas renderer sorts it triangle by
|
|
10238
|
+
triangle, which can slip where a small part lies on a big face (a window on a
|
|
10239
|
+
wall). For the canvas, the pen looks sort better (below); for exact depth, use
|
|
10240
|
+
the mesh look with WebGL2.
|
|
10241
|
+
|
|
10242
|
+
**How props sort.** A pen-drawn prop is not drawn whole at one depth. It is
|
|
10243
|
+
cut into columns about a metre across (along its length and width), and each
|
|
10244
|
+
column sorts at its own depth among the scene's other things, so a figure
|
|
10245
|
+
walking past a bus is covered by its front end and covers its back. Inside a
|
|
10246
|
+
column, faces are drawn far to near, each with its own outlines. Faces no one
|
|
10247
|
+
can see are left out: those inside another solid part, or lying against one
|
|
10248
|
+
(a house's wall tops under its roof, a tyre's tread inside the fender). A
|
|
10249
|
+
face lying on another part's face (a light, a window, a door) is drawn just
|
|
10250
|
+
after it. Where a part sits partly into another, its `layer` says which is
|
|
10251
|
+
drawn over (a car's cabin over its body, a roof over its walls). What is
|
|
10252
|
+
nearer than the camera's near plane is cut away, so a camera can come close or
|
|
10253
|
+
go inside. A pen-drawn character is still drawn whole at its middle's depth,
|
|
10254
|
+
and painter's order has limits: for exact order use the solid look and the
|
|
10255
|
+
WebGL2 renderer.
|
|
10256
|
+
|
|
9814
10257
|
**Other object kinds** come the same way: an `ObjectKind` validates its
|
|
9815
10258
|
objects, prepares them once, and each frame returns meshes (shaded and sorted
|
|
9816
10259
|
with the scene's) and drawables (drawn whole at their depth). Pass it in
|
|
@@ -12301,7 +12744,7 @@ magnet.addEventListener('pointerleave', () => {
|
|
|
12301
12744
|
|
|
12302
12745
|
<!-- capabilities: generated from the library -->
|
|
12303
12746
|
|
|
12304
|
-
# tinyfly capabilities (v0.
|
|
12747
|
+
# tinyfly capabilities (v0.95.0)
|
|
12305
12748
|
|
|
12306
12749
|
Generated from the library itself: every name below is accepted, and names not listed are rejected (beat scripts, code panels and `checkTracks` say which name was probably meant).
|
|
12307
12750
|
|
|
@@ -12481,7 +12924,8 @@ With `style.hands`, each hand has `hand.left.<field>` / `hand.right.<field>` pro
|
|
|
12481
12924
|
| `face` | | Turns the whole figure toward a scene x (turning round if needed), `viewer`, `ahead` or `back`. |
|
|
12482
12925
|
| `say` | `say` | Lip-syncs the `say` line with small nods; the beat lasts as long as the line. |
|
|
12483
12926
|
| `hold` | | Holds the pose (the acting pass drifts long holds). |
|
|
12484
|
-
| `stand` | | Back to the rest pose, keeping the way it is turned. |
|
|
12927
|
+
| `stand` | | Back to its resting stance (a character’s own, else the rest pose), keeping the way it is turned. |
|
|
12928
|
+
| `go` | `to` | Walks to `to` in its own gait (a character’s, else walk). |
|
|
12485
12929
|
| `zip` | `to` | The cartoon exit: winds up, wheels its legs in place, then shoots off to `to`, leaving dust. |
|
|
12486
12930
|
| `leap` | | Crouches, springs, arcs and lands squashed at `to`, on the floor `onto` (a scene y). |
|
|
12487
12931
|
| `swipe` | | Winds an arm up, then slides along the target with the arm out so the hand crosses it edge to edge. |
|
|
@@ -12500,6 +12944,64 @@ Beats that touch something report `contact` (and `release`) times in `result.bea
|
|
|
12500
12944
|
|
|
12501
12945
|
**Hand shapes**: `relaxed`, `open`, `spread`, `flat`, `fist`, `point`, `thumbsUp`, `peace`, `ok`, `pinch`, `cupped`, `wave`, `pencilGrip`, `hold`. **Mudras**: `pataka`, `tripataka`, `alapadma`, `mushti`, `shikhara`, `hamsasya`, `katakamukha`.
|
|
12502
12946
|
|
|
12947
|
+
### Your own actions, gaits and personas
|
|
12948
|
+
|
|
12949
|
+
Nothing is registered globally: pass your definitions where they are used.
|
|
12950
|
+
|
|
12951
|
+
- `defineAction({ summary, needs?, steps: (from, beat) => [{ after, pose, easing? }] })`: a new action written as timed pose steps from the current pose, like a gag
|
|
12952
|
+
- `defineAction({ summary, needs?, beats: (beat) => [beats] })`: a new action built from other beats (which may be custom too)
|
|
12953
|
+
- `defineGait({ swing, knee, arm, elbow, lean, cycle?, … })`: a new gait (the Gait fields in degrees; cycle is ms per two steps)
|
|
12954
|
+
- `scriptTracks(id, beats, { actions, gaits })`: beats may then use those names; checkBeats(beats, { actions, gaits }) knows them
|
|
12955
|
+
- `stickFigureTarget({ …, cast: { actions, gaits } })`: a figure that draws the gaits and lists the actions in describeTarget
|
|
12956
|
+
- `persona({ name, summary?, height?, look?, acting?, gait?, mood?, stance?, energy?, actions?, gaits? })`: a character’s look, acting style and habits: .figure({ x, y }), .script(id, beats, { from, ground }), .check(beats), .handPath(…), .describe(); `go` walks in its gait, `stand` returns to its stance and face
|
|
12957
|
+
|
|
12958
|
+
## Props (everyday objects with behaviours)
|
|
12959
|
+
|
|
12960
|
+
A prop is a 3D rig of simple parts drawn with the characters’ pens (clean, pencil, silhouette), so it turns toward the camera (`turn`), and its beats go through the same acting pass (anticipation, overshoot, overlap; `exaggeration` scales them).
|
|
12961
|
+
|
|
12962
|
+
- `car() · truck() · bus() · tractor() · cart() · trainCar() · bike() · motorbike()`: wheeled vehicles (vehicle(spec) makes your own)
|
|
12963
|
+
- `tree() · house()`: environment (tree(spec), house(spec))
|
|
12964
|
+
- `helicopter() · airplane()`: aircraft
|
|
12965
|
+
- `horse() · dog() · cat() · cow()`: animals (quadruped(spec) makes your own): gaits with footfall patterns keyed in step with the distance, sit, jump, their calls, species actions
|
|
12966
|
+
- `songbird() · crow() · chicken()`: birds (bird(spec) makes your own): hop, walk, peck, flap, fly and land (a chicken flutters), their calls; wings fold and beat in rhythm
|
|
12967
|
+
- `{ kind: 'prop', prop: 'car', position, rotation, values } with loadScene3D(scene, { kinds: [characterObjects, propObjects] })`: props in 3D scenes, by preset name, seen in perspective by the scene camera; controls are tracks on the object
|
|
12968
|
+
- `characterScript3D(id, beats, { scene, position?, heading?, height?, pose? })`: a v2 character in a 3D scene in world metres: gaits to [x, z] or through points (its walk phase keyed with the distance), face, hold, pose, gag; checkCharacterBeats3D checks the beats
|
|
12969
|
+
- `propRide3D({ prop, propId, propTracks, scene, placement, anchor, riderId, pose, start, end, mount?, dismount? })`: a character riding a prop in a 3D scene: hips on a seat anchor (saddle, seat) as it moves, hopping on and off; RIDING_POSES.astride / .seated
|
|
12970
|
+
- `propScript3D(id, prop, beats, { scene, position?, heading?, values? })`: props scripted in world metres for 3D scenes: moves to [x, z] or through points (wheels and strides keyed with the distance), face, hold, and their actions; checkPropBeats3D checks the beats
|
|
12971
|
+
- `propPreset(name, options?)`: a prop preset by name (did-you-mean on a wrong one)
|
|
12972
|
+
- `propTarget({ …, style: 'stick' })`: line art to go with stick figures: tubes as single strokes, shapes outlined over paper
|
|
12973
|
+
- `propTow({ leader, leaderId, leaderTracks, hitch, towed, towedId, anchor, start, end })`: a prop towed by another (a cart behind a horse): turns with it, its wheels roll exactly
|
|
12974
|
+
- `propTarget({ x, y, prop, scale?, values?, look?, ink? })`: a canvas target that draws a prop (x, y: its middle on the ground; scale px per metre, default 60)
|
|
12975
|
+
- `propScript(id, prop, beats, { from, ground, scale, style?, exaggeration?, start? })`: beats → acted tracks, with contact times and effect cues; checkPropBeats(beats, prop) checks them
|
|
12976
|
+
- `drawProp(ctx, target, frame, id, { rider? })`: draw it as it is in a frame (a rider is drawn between its far and near parts)
|
|
12977
|
+
- `propAt(target, frame, id).anchor(name)`: where an anchor (seat, door, chimney…) is, in scene px
|
|
12978
|
+
- `propRide({ prop, propId, propTracks, anchor, figure, figureId, start, end, offset? })`: a figure carried at an anchor, turning with the prop; spliceTracks() puts it into the figure’s tracks
|
|
12979
|
+
- `drawPropEffects(ctx, effects, time)`: dust, exhaust, skid marks, honk lines, leaves, smoke
|
|
12980
|
+
|
|
12981
|
+
Prop beat fields: `do`, `at`, `for`, `to`, `toward`, `speed`, `open`, `on`, `height`, `wind`. Every prop has the controls `turn`, `tilt`, `pitch`, `roll`, `squash`, `lift`, `lean`, `size` and the actions `hold`, `turn`, `pop`, `vanish`.
|
|
12982
|
+
|
|
12983
|
+
| Preset | Family | Actions (needs) | Controls | Anchors |
|
|
12984
|
+
|---|---|---|---|---|
|
|
12985
|
+
| `car()` | vehicle | `drive` (to), `brake` (to), `bump`, `honk`, `door` (open), `lights` (on) | `wheelSpin`, `door`, `lights`, `antenna` | seat, front, back, roof, door |
|
|
12986
|
+
| `truck()` | vehicle | `drive` (to), `brake` (to), `bump`, `honk`, `door` (open), `lights` (on) | `wheelSpin`, `door`, `lights` | seat, front, back, roof, door |
|
|
12987
|
+
| `bus()` | vehicle | `drive` (to), `brake` (to), `bump`, `honk`, `door` (open), `lights` (on) | `wheelSpin`, `door`, `lights` | seat, front, back, roof, door |
|
|
12988
|
+
| `tractor()` | vehicle | `drive` (to), `brake` (to), `bump`, `honk`, `lights` (on) | `wheelSpin`, `lights` | seat, front, back, roof |
|
|
12989
|
+
| `cart()` | vehicle | `drive` (to), `brake` (to), `bump`, `honk` | `wheelSpin` | seat, front, back, roof, shafts |
|
|
12990
|
+
| `trainCar()` | vehicle | `drive` (to), `brake` (to), `bump`, `honk`, `lights` (on) | `wheelSpin`, `lights` | seat, front, back, roof |
|
|
12991
|
+
| `bike()` | vehicle | `drive` (to), `brake` (to), `bump`, `honk` | `wheelSpin` | seat, front, back, roof |
|
|
12992
|
+
| `motorbike()` | vehicle | `drive` (to), `brake` (to), `bump`, `honk`, `lights` (on) | `wheelSpin`, `lights` | seat, front, back, roof |
|
|
12993
|
+
| `tree()` | plant | `sway`, `shake`, `shedLeaves` | `sway`, `canopySway` | canopy, top, base, branch |
|
|
12994
|
+
| `house()` | building | `door` (open), `lights` (on), `shake`, `smoke` | `door`, `lights` | door, doorstep, ridge, chimney |
|
|
12995
|
+
| `helicopter()` | aircraft | `takeOff`, `fly` (to), `hover`, `land` | `rotor`, `blur` | seat, door, rotor, skids, hook |
|
|
12996
|
+
| `airplane()` | aircraft | `takeOff` (to), `fly` (to), `loop`, `land` (to) | `rotor`, `blur` | seat, nose, tail, wingtip |
|
|
12997
|
+
| `horse()` | animal | `walk` (to), `trot` (to), `canter` (to), `gallop` (to), `neigh`, `sit`, `jump`, `nod`, `swish`, `graze`, `rear`, `buck` | `walk`, `walking`, `gait`, `neck`, `tail`, `wag`, `fl.swing`, `fl.knee`, `fl.ankle`, `fr.swing`, `fr.knee`, `fr.ankle`, `hl.swing`, `hl.knee`, `hl.ankle`, `hr.swing`, `hr.knee`, `hr.ankle` | back, head, mouth, front, hitch, saddle |
|
|
12998
|
+
| `dog()` | animal | `walk` (to), `trot` (to), `run` (to), `gallop` (to), `bark`, `sit`, `jump`, `nod`, `swish`, `wag`, `sniff` | `walk`, `walking`, `gait`, `neck`, `tail`, `wag`, `fl.swing`, `fl.knee`, `fl.ankle`, `fr.swing`, `fr.knee`, `fr.ankle`, `hl.swing`, `hl.knee`, `hl.ankle`, `hr.swing`, `hr.knee`, `hr.ankle` | back, head, mouth, front, leash |
|
|
12999
|
+
| `cat()` | animal | `walk` (to), `trot` (to), `run` (to), `gallop` (to), `meow`, `sit`, `jump`, `nod`, `swish`, `arch`, `pounce` (to) | `walk`, `walking`, `gait`, `neck`, `tail`, `wag`, `fl.swing`, `fl.knee`, `fl.ankle`, `fr.swing`, `fr.knee`, `fr.ankle`, `hl.swing`, `hl.knee`, `hl.ankle`, `hr.swing`, `hr.knee`, `hr.ankle` | back, head, mouth, front |
|
|
13000
|
+
| `cow()` | animal | `walk` (to), `trot` (to), `moo`, `sit`, `jump`, `nod`, `swish`, `graze` | `walk`, `walking`, `gait`, `neck`, `tail`, `wag`, `fl.swing`, `fl.knee`, `fl.ankle`, `fr.swing`, `fr.knee`, `fr.ankle`, `hl.swing`, `hl.knee`, `hl.ankle`, `hr.swing`, `hr.knee`, `hr.ankle` | back, head, mouth, front |
|
|
13001
|
+
| `songbird()` | bird | `hop` (to), `walk` (to), `peck`, `flap`, `tweet`, `fly` (to), `land` | `spread`, `flap`, `wingbeat`, `flapping`, `peck`, `step`, `stepping`, `leg.left`, `leg.right` | beak, head, back, feet |
|
|
13002
|
+
| `crow()` | bird | `hop` (to), `walk` (to), `peck`, `flap`, `caw`, `fly` (to), `land` | `spread`, `flap`, `wingbeat`, `flapping`, `peck`, `step`, `stepping`, `leg.left`, `leg.right` | beak, head, back, feet |
|
|
13003
|
+
| `chicken()` | bird | `hop` (to), `walk` (to), `peck`, `flap`, `cluck`, `flutter` | `spread`, `flap`, `wingbeat`, `flapping`, `peck`, `step`, `stepping`, `leg.left`, `leg.right` | beak, head, back, feet |
|
|
13004
|
+
|
|
12503
13005
|
## Character (v2 human)
|
|
12504
13006
|
|
|
12505
13007
|
Poses: `rest`, `wave`, `cheer`, `point`, `handsOnHips`, `think`, `shrug`, `sit`, `kneel`, `crouch`, `crawl`, `lieDown`. Expressions: `neutral`, `happy`, `joyful`, `sad`, `crying`, `surprised`, `shocked`, `angry`, `furious`, `worried`, `scared`, `confused`, `skeptical`, `thinking`, `sleepy`, `disgusted`, `smug`, `wink`. Gags: `take`, `doubleTake`, `windUp`, `land`, `tremble`, `deflate`.
|