@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.
Files changed (63) hide show
  1. package/README.md +6 -6
  2. package/docs/acting.md +68 -0
  3. package/docs/api-reference.md +3 -1
  4. package/docs/editor-guide.md +1 -1
  5. package/docs/examples.md +1 -1
  6. package/docs/getting-started.md +1 -1
  7. package/docs/gsap-compat.md +1 -1
  8. package/docs/llm-guide.md +25 -0
  9. package/docs/maps.md +2 -2
  10. package/docs/props.md +202 -0
  11. package/docs/scene-3d.md +141 -0
  12. package/docs/teaching.md +1 -1
  13. package/lib/addons/characters.js +5647 -2519
  14. package/lib/addons/scene-3d.js +140 -138
  15. package/lib/browser/tinyfly-scene-3d.iife.js +1 -1
  16. package/lib/browser/tinyfly.iife.js +15 -9
  17. package/lib/browser/tinyfly.js +7059 -3876
  18. package/lib/browser/tinyfly.umd.js +15 -9
  19. package/lib/engine/tinyfly-engine.js +612 -600
  20. package/lib/engine/tinyfly-engine.umd.cjs +2 -2
  21. package/lib/types/characters/acting/beat-check.d.ts +12 -5
  22. package/lib/types/characters/acting/custom.d.ts +66 -0
  23. package/lib/types/characters/acting/gags.d.ts +10 -0
  24. package/lib/types/characters/acting/hand-path.d.ts +3 -0
  25. package/lib/types/characters/acting/index.d.ts +2 -0
  26. package/lib/types/characters/acting/persona.d.ts +93 -0
  27. package/lib/types/characters/acting/script.d.ts +10 -5
  28. package/lib/types/characters/capabilities.d.ts +30 -2
  29. package/lib/types/characters/character-script-3d.d.ts +80 -0
  30. package/lib/types/characters/character.d.ts +19 -0
  31. package/lib/types/characters/figure-actions.d.ts +4 -3
  32. package/lib/types/characters/ground-path.d.ts +32 -0
  33. package/lib/types/characters/index.d.ts +3 -0
  34. package/lib/types/characters/props/clip.d.ts +5 -0
  35. package/lib/types/characters/props/draw.d.ts +60 -0
  36. package/lib/types/characters/props/effects.d.ts +12 -0
  37. package/lib/types/characters/props/families/aircraft.d.ts +37 -0
  38. package/lib/types/characters/props/families/animals.d.ts +156 -0
  39. package/lib/types/characters/props/families/birds.d.ts +86 -0
  40. package/lib/types/characters/props/families/environment.d.ts +71 -0
  41. package/lib/types/characters/props/families/vehicle.d.ts +129 -0
  42. package/lib/types/characters/props/hidden.d.ts +49 -0
  43. package/lib/types/characters/props/index.d.ts +23 -0
  44. package/lib/types/characters/props/mesh-3d.d.ts +24 -0
  45. package/lib/types/characters/props/presets.d.ts +34 -0
  46. package/lib/types/characters/props/ride-3d.d.ts +71 -0
  47. package/lib/types/characters/props/ride.d.ts +79 -0
  48. package/lib/types/characters/props/rig.d.ts +224 -0
  49. package/lib/types/characters/props/scene-objects.d.ts +2 -0
  50. package/lib/types/characters/props/script-3d.d.ts +85 -0
  51. package/lib/types/characters/props/script.d.ts +145 -0
  52. package/lib/types/characters/props/shapes.d.ts +96 -0
  53. package/lib/types/characters/props/slice.d.ts +66 -0
  54. package/lib/types/characters/props/target.d.ts +129 -0
  55. package/lib/types/characters/stick-figure.d.ts +7 -2
  56. package/lib/types/engine/authoring/index.d.ts +1 -0
  57. package/lib/types/engine/authoring/spring-follow.d.ts +25 -0
  58. package/lib/types/scene-3d/object-kind.d.ts +4 -1
  59. package/lib/types/scene-3d/scene-types.d.ts +41 -1
  60. package/llms-full.txt +512 -10
  61. package/llms.txt +28 -27
  62. package/package.json +1 -1
  63. package/skills/tinyfly/SKILL.md +11 -0
@@ -117,6 +117,10 @@ export interface CharacterObject3D extends ObjectBase {
117
117
  pose?: Record<string, number>;
118
118
  /** A soft shadow on the ground under it (default true) */
119
119
  shadow?: boolean;
120
+ /** The gait it walks in when walking (`walk`, `run`, `sneak`, `strut`, `tired`, `bouncy`…; default walk); a `gait` track can change it */
121
+ gait?: string;
122
+ /** How much of its gait is applied, 0..1 (default 0); its `walk` track (the gait's phase, in cycles) steps it — see `characterScript3D` */
123
+ walking?: number;
120
124
  /**
121
125
  * `pen` (default): drawn by its pens, in its 2D look (clean, pencil,
122
126
  * silhouette) seen in perspective. `solid`: built of shaded capsules and an
@@ -134,6 +138,40 @@ export interface CharacterObject3D extends ObjectBase {
134
138
  } | false;
135
139
  };
136
140
  }
141
+ /**
142
+ * A prop (a car, a tree, a house, a horse, a bird…) named by its preset,
143
+ * drawn with the characters' pens in its look. Like characters, it needs the
144
+ * characters add-on: `loadScene3D(scene, { kinds: [characterObjects, propObjects] })`
145
+ * with both from `@algorisys/tinyfly/characters`. It stands on its object's
146
+ * ground and faces +z; `rotateY` turns it. Its controls (`door`, `wheelSpin`,
147
+ * `spread`, …) are tracks on the object too.
148
+ */
149
+ export interface PropObject3D extends ObjectBase {
150
+ kind: 'prop';
151
+ /** The preset: car, truck, bus, tractor, cart, trainCar, bike, motorbike, tree, house, helicopter, airplane, horse, dog, cat, cow, songbird, crow, chicken */
152
+ prop: string;
153
+ /** The preset's options (colours, sizes) */
154
+ options?: Record<string, unknown>;
155
+ /** Its control values as placed (`door: 1`, `lights: 1`); tracks animate them */
156
+ values?: Record<string, number>;
157
+ /** clean (default), pencil or silhouette, as the figures */
158
+ /**
159
+ * clean (default), pencil or silhouette: drawn with the figures' pens. `mesh`: built of the scene's own
160
+ * meshes, lit, outlined and depth-sorted with them (exact with the WebGL2 renderer); glass is see-through
161
+ */
162
+ look?: 'clean' | 'pencil' | 'silhouette' | 'mesh';
163
+ /** The mesh look's shading (default toon) and outline width in px (default 2) */
164
+ shading?: 'unlit' | 'flat' | 'lambert' | 'toon';
165
+ outline?: number;
166
+ /** solid (default) or stick (line art) */
167
+ style?: 'solid' | 'stick';
168
+ /** Outline colour */
169
+ ink?: string;
170
+ /** The paper a stick prop's shapes are filled with */
171
+ paper?: string;
172
+ /** A contact shadow on the ground under it (default true) */
173
+ shadow?: boolean;
174
+ }
137
175
  /** How a line or trail looks: a flat band facing the camera, drawn among the meshes by depth. */
138
176
  export interface StrokeStyle3D {
139
177
  color: string;
@@ -173,7 +211,7 @@ export interface TrailObject3D extends ObjectBase, StrokeStyle3D {
173
211
  /** Motion that repeats every `period` ms: the trail wraps, so a loop's first frame shows the last lap */
174
212
  period?: number;
175
213
  }
176
- export type Object3D = GroupObject | MeshObject | CameraObject | LightObject | CharacterObject3D | LineObject3D | TrailObject3D;
214
+ export type Object3D = GroupObject | MeshObject | CameraObject | LightObject | CharacterObject3D | PropObject3D | LineObject3D | TrailObject3D;
177
215
  export type Geometry3D = {
178
216
  type: 'box';
179
217
  size: Vec3Tuple;
@@ -219,6 +257,8 @@ export interface Material3D {
219
257
  shading?: 'unlit' | 'flat' | 'lambert' | 'toon';
220
258
  /** Toon: number of light bands (default 3) */
221
259
  bands?: number;
260
+ /** Inked creases too, where faces meet at a sharp angle (default true); false for smooth surfaces built of facets: only their silhouettes */
261
+ creases?: boolean;
222
262
  /** Ink outline along silhouettes and creases, px */
223
263
  outline?: {
224
264
  width: number;