@automovie/template 0.3.0 → 0.3.2
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automovie/template",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "The scaffold every AutoMovie production is created from and the function that creates its files.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"yaml": "^2.9.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@automovie/evidence": "^0.3.
|
|
45
|
+
"@automovie/evidence": "^0.3.2",
|
|
46
46
|
"@ttsc/evidence": "^0.37.1",
|
|
47
47
|
"@ttsc/lint": "^0.37.1",
|
|
48
48
|
"@types/node": "^22.19.17",
|
|
@@ -3,6 +3,7 @@ import type {
|
|
|
3
3
|
IAutoMovieMark,
|
|
4
4
|
IAutoMoviePhysicalFrame,
|
|
5
5
|
IAutoMoviePhysicalProfile,
|
|
6
|
+
IAutoMovieRenderSoftPropFrame,
|
|
6
7
|
} from "@automovie/interface";
|
|
7
8
|
import type * as THREE from "three";
|
|
8
9
|
|
|
@@ -11,7 +12,7 @@ import type * as THREE from "three";
|
|
|
11
12
|
*
|
|
12
13
|
* @evidence contracts/development/common.md#meaningful-documentation The comment names what one mount holds; each member states what it owns and when it runs.
|
|
13
14
|
* @evidence contracts/development/design.md#principled-representation Playback, seeking and capture all place the scene through one seek per second, so a second reached by any path draws the same state.
|
|
14
|
-
* @evidence contracts/development/design.md#minimal-and-owned-surface The
|
|
15
|
+
* @evidence contracts/development/design.md#minimal-and-owned-surface The hosts read the film scene and placement, optional soft surfaces, and the review sources: physical marks, named views, and film marks.
|
|
15
16
|
* @evidence contracts/development/design.md#prohibited-design-shortcuts No playback-only or capture-only member exists; named views move only a separate inspection camera, so the film camera and delivered captures are unchanged.
|
|
16
17
|
*/
|
|
17
18
|
export interface IFilmProduction {
|
|
@@ -21,6 +22,20 @@ export interface IFilmProduction {
|
|
|
21
22
|
/** Camera the Viewer renders through; camera entities move it in `seek`. */
|
|
22
23
|
camera: THREE.PerspectiveCamera;
|
|
23
24
|
|
|
25
|
+
/**
|
|
26
|
+
* Soft prop surfaces for an exact film second, read after the film's own
|
|
27
|
+
* seek. Absent leaves all object placement with the film.
|
|
28
|
+
*
|
|
29
|
+
* @evidence contracts/development/common.md#meaningful-documentation States the film timebase, placement order and absent behavior.
|
|
30
|
+
* @evidenceExclude contracts/development/implementation.md#principled-implementation The film owns the surface producer; this signature has no algorithm.
|
|
31
|
+
* @evidenceExclude contracts/development/implementation.md#clear-and-simple-structure The film owns the surface producer; this signature has no body.
|
|
32
|
+
* @evidenceExclude contracts/development/implementation.md#prohibited-implementation-shortcuts The signature maintains producer-owned surface data without providing a fallback.
|
|
33
|
+
* @evidenceExclude contracts/development/implementation.md#efficient-algorithms The signature chooses no traversal or allocation strategy.
|
|
34
|
+
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work The film owns the evaluation and its already planned solve.
|
|
35
|
+
* @evidenceExclude contracts/development/implementation.md#bound-retention-and-release-resources The signature acquires no resources; the film and the draw scene own their lifetimes.
|
|
36
|
+
*/
|
|
37
|
+
softPropsAt?: (seconds: number) => readonly IAutoMovieRenderSoftPropFrame[];
|
|
38
|
+
|
|
24
39
|
/** Inspection mark kinds that may first appear after second zero; `marks` still supplies their actual geometry at the drawn second. */
|
|
25
40
|
markKinds?: readonly string[];
|
|
26
41
|
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import type { IAutoMovieMark } from "@automovie/interface";
|
|
2
1
|
import type {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
IAutoMovieMark,
|
|
3
|
+
IAutoMovieRenderSoftPropFrame,
|
|
4
|
+
} from "@automovie/interface";
|
|
5
|
+
import {
|
|
6
|
+
type AutoMovieDrawSubjects,
|
|
7
|
+
type IAutoMovieDrawScene,
|
|
8
|
+
type IAutoMovieDrawSubject,
|
|
9
|
+
bindAutoMovieDrawSceneSoftProps,
|
|
6
10
|
} from "@automovie/render";
|
|
7
11
|
|
|
8
12
|
import type { IFilm } from "./IFilm";
|
|
@@ -17,12 +21,12 @@ import { markFilmProduction } from "./markFilmProduction";
|
|
|
17
21
|
* Each film is created as the Viewer creates it, at its delivery raster (1280 × 720 when it states none), seeked through its own `seek` at a second clamped to its running time, and marked by `markFilmProduction`, so a capture, a delivered frame and the Viewer show the same state.
|
|
18
22
|
*
|
|
19
23
|
* @evidence contracts/development/common.md#meaningful-documentation States what each subject is, who draws it, and how its raster, seek and marks are taken.
|
|
20
|
-
* @evidence contracts/development/implementation.md#principled-implementation
|
|
24
|
+
* @evidence contracts/development/implementation.md#principled-implementation Maps the film registry, placement and shared marks onto the draw contract, and binds optional soft surfaces after placement at the same clamped second.
|
|
21
25
|
* @evidence contracts/development/implementation.md#clear-and-simple-structure One mapping per film.
|
|
22
26
|
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts No film is named; the props are not read, since films need none.
|
|
23
27
|
* @evidence contracts/development/implementation.md#efficient-algorithms Linear in the registered films; a film is created only when its subject is.
|
|
24
28
|
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work A mapping made once per page.
|
|
25
|
-
* @evidence contracts/development/implementation.md#bound-retention-and-release-resources The
|
|
29
|
+
* @evidence contracts/development/implementation.md#bound-retention-and-release-resources The subject's dispose releases the film, and the render adapter independently releases any soft prop meshes it mounts.
|
|
26
30
|
*/
|
|
27
31
|
export const subjects: AutoMovieDrawSubjects = (): Readonly<
|
|
28
32
|
Record<string, IAutoMovieDrawSubject>
|
|
@@ -34,7 +38,7 @@ export const subjects: AutoMovieDrawSubjects = (): Readonly<
|
|
|
34
38
|
{
|
|
35
39
|
create: async (): Promise<IAutoMovieDrawScene> => {
|
|
36
40
|
const production: IFilmProduction = await film.create();
|
|
37
|
-
|
|
41
|
+
const subject: IAutoMovieDrawScene = {
|
|
38
42
|
scene: production.scene,
|
|
39
43
|
camera: production.camera,
|
|
40
44
|
durationSeconds: film.durationSeconds,
|
|
@@ -58,6 +62,17 @@ export const subjects: AutoMovieDrawSubjects = (): Readonly<
|
|
|
58
62
|
),
|
|
59
63
|
dispose: (): void => production.dispose(),
|
|
60
64
|
};
|
|
65
|
+
const softPropsAt: IFilmProduction["softPropsAt"] =
|
|
66
|
+
production.softPropsAt?.bind(production);
|
|
67
|
+
return softPropsAt === undefined
|
|
68
|
+
? subject
|
|
69
|
+
: bindAutoMovieDrawSceneSoftProps(
|
|
70
|
+
subject,
|
|
71
|
+
(seconds: number): readonly IAutoMovieRenderSoftPropFrame[] =>
|
|
72
|
+
softPropsAt(
|
|
73
|
+
clampProductionSeconds(seconds, film.durationSeconds),
|
|
74
|
+
),
|
|
75
|
+
);
|
|
61
76
|
},
|
|
62
77
|
},
|
|
63
78
|
],
|