@hatiolab/things-scene 10.1.66 → 10.1.68

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.
@@ -50,13 +50,32 @@ export declare class FigureRig {
50
50
  private evaluator?;
51
51
  /** Each appearance's material, copied once. */
52
52
  private readonly materials;
53
+ /**
54
+ * Each body as last dressed, by id: while the evaluator gives the same body object (it does when nothing the body
55
+ * depends on changed) and it is shown alike, the dressed body is the same object too -- not one copy per body per frame.
56
+ */
57
+ private dressed;
58
+ /** What each drawn alone body was last drawn with: its shape and segments, and its pose. */
59
+ private readonly drawnWith;
60
+ /** The asset's inputs, read once: unit by id, and the state inputs. The asset does not change under a rig. */
61
+ private inputFacts?;
53
62
  /**
54
63
  * The last batch plan and what it was made from: while every body keeps its id, its shape (the same object, which the
55
64
  * evaluator keeps when the shape did not change) and whether it is shown, only poses moved and the plan stands.
56
65
  */
57
66
  private planned?;
58
- /** The last evaluation, for readers that want the numbers behind the meshes. */
59
- last: FigureAssetEvaluation | null;
67
+ /**
68
+ * The last evaluation the meshes were made from (ADR-0108 C3: renamed from \`last\` when pose steps came, so a reader
69
+ * of the old name would not go on reading it unawares). Pose steps move the meshes past it: for the values as they
70
+ * stand now, read \`evaluation()\`.
71
+ */
72
+ lastEvaluation: FigureAssetEvaluation | null;
73
+ /**
74
+ * Where each body slot of the last evaluation is drawn, for pose steps (ADR-0108): a mesh drawn alone, or a copy of a
75
+ * batch at an index. Made with every evaluation, valid for its generation.
76
+ */
77
+ private slots;
78
+ private generation;
60
79
  constructor(asset: FigureAsset, options?: FigureRigOptions);
61
80
  get asset(): FigureAsset;
62
81
  /** The size the asset was authored at: its stored `size.*` design inputs, or null when it is not resizable. */
@@ -98,10 +117,21 @@ export declare class FigureRig {
98
117
  * the external value is withdrawn the driver's value at the clip's current time shows again.
99
118
  */
100
119
  stateOverrides(): Record<string, number>;
120
+ private inputsRead;
101
121
  /** The external values as last set, for readers that want to know what masks the drivers. */
102
122
  get externalState(): Record<string, number>;
103
- /** Evaluate at the current size, state and time, and bring the meshes up to date. */
104
- update(): FigureAssetEvaluation;
123
+ /**
124
+ * Bring the meshes up to the current size, state and time (ADR-0108). When only poses moved the evaluator says so and
125
+ * gives their numbers by body slot; they go straight into the matrices. Otherwise it evaluates and the meshes are
126
+ * made from the evaluation. Nothing is returned: read \`evaluation()\` for the values as they stand.
127
+ */
128
+ update(): void;
129
+ /** The values as they stand now -- an evaluation, made if pose steps moved past the last one (fresh on read). */
130
+ evaluation(): FigureAssetEvaluation;
131
+ /** A pose step: each written body slot's matrix, the rows that moved, the places that moved. */
132
+ private movePoses;
133
+ /** The meshes made from an evaluation, and where each of its body slots is drawn for the pose steps that follow. */
134
+ private draw;
105
135
  /**
106
136
  * The node a held thing hangs from at one place (`capabilities.bindings`). It is a child of the group that every
107
137
  * update moves to the place's pose, so what hangs from it follows the part it sits on -- through the joints too --
@@ -131,6 +161,8 @@ export declare class FigureRig {
131
161
  /** The inputs this rig evaluates at now: the figure's defaults, its drivers and external values, and its size. */
132
162
  evaluationInputs(): Record<string, number>;
133
163
  evaluate(): FigureAssetEvaluation;
164
+ /** An evaluation's bodies with their appearance: material, visibility and segments. */
165
+ private dress;
134
166
  private colourOf;
135
167
  private materialFor;
136
168
  /** Meshes by body id, for tests and for bindings that need a part's mesh. */
@@ -1 +1 @@
1
- {"version":3,"file":"figure-rig.d.ts","sourceRoot":"","sources":["../../src/figure/figure-rig.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAIL,KAAK,WAAW,EAChB,KAAK,qBAAqB,EAE1B,KAAK,YAAY,EAClB,MAAM,wBAAwB,CAAA;AAI/B,OAAO,EAAoB,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAGjF,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC/B;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AAC,MAAM,EAAE,MAAM,CAAC,CAE1C;IAED;;;;OAIG;IACH,MAAM,IAAI,IAAI;IASd,iHAAiH;IACjH,UAAU,IAAI,qBAAqB;IAInC,gGAAgG;IAChG,OAAO,CAAC,SAAS;IAuCjB,oHAAoH;IACpH,OAAO,CAAC,IAAI;IA4GZ;;;;OAIG;IACH,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,KAAK,CAAC,QAAQ,GAAG,IAAI;IAc5C,OAAO,CAAC,MAAM,CAAC,IAAI;IAKnB,uGAAuG;IACvG,OAAO,CAAC,MAAM;IAcd,uGAAuG;IACvG,OAAO,CAAC,MAAM,CAAC,QAAQ;IAMvB;;;OAGG;IACH,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,QAAQ,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAUvE,uGAAuG;IACvG,IAAI,KAAK,IAAI;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAIjE;IAED;;;OAGG;IACH,kHAAkH;IAClH,gBAAgB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAU1C,QAAQ,IAAI,qBAAqB;IAOjC,uFAAuF;IACvF,OAAO,CAAC,KAAK;IA0Bb,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,WAAW;IAqBnB,6EAA6E;IAC7E,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,KAAK,CAAC,IAAI,GAAG,SAAS;IAI1C,yHAAyH;IACzH,QAAQ,IAAI,MAAM,EAAE;IAMpB,OAAO,IAAI,IAAI;CAiBhB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hatiolab/things-scene",
3
- "version": "10.1.66",
3
+ "version": "10.1.68",
4
4
  "description": "A high-performance 2D/3D scene graph library for building interactive visual editors, combining HTML5 Canvas and Three.js to enable facility visualization, data-driven animations, and real-time monitoring dashboards",
5
5
  "main": "things-scene-min.js",
6
6
  "module": "things-scene.mjs",
@@ -91,7 +91,7 @@
91
91
  },
92
92
  "homepage": "https://github.com/hatiolab/things-scene#readme",
93
93
  "dependencies": {
94
- "@hatiolab/figure-model": "^0.2.10",
94
+ "@hatiolab/figure-model": "^0.2.14",
95
95
  "@wizpanda/super-gif": "^0.0.6",
96
96
  "dompurify": "^3.3.1",
97
97
  "jsonata": "^1.8.6",