@supersoniks/concorde 4.9.97-visual-stack.0 → 4.9.98-visual-stack.1
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/build-infos.json +1 -1
- package/concorde-3d.bundle.js +201 -152
- package/concorde-3d.es.js +14621 -13823
- package/concorde-core.bundle.js +1 -1
- package/concorde-core.es.js +1 -1
- package/concorde-hugging-face-infer.bundle.js +1 -1
- package/concorde-hugging-face-infer.es.js +1 -1
- package/concorde-shader.bundle.js +31 -20
- package/concorde-shader.es.js +3236 -2865
- package/concorde-webgpu.bundle.js +43 -32
- package/concorde-webgpu.es.js +2977 -2618
- package/dist/concorde-3d.bundle.js +201 -152
- package/dist/concorde-3d.es.js +14621 -13823
- package/dist/concorde-core.bundle.js +1 -1
- package/dist/concorde-core.es.js +1 -1
- package/dist/concorde-hugging-face-infer.bundle.js +1 -1
- package/dist/concorde-hugging-face-infer.es.js +1 -1
- package/dist/concorde-shader.bundle.js +31 -20
- package/dist/concorde-shader.es.js +3236 -2865
- package/dist/concorde-webgpu.bundle.js +43 -32
- package/dist/concorde-webgpu.es.js +2977 -2618
- package/dist/js/core/components/functional/3d/3d.js +100 -2
- package/dist/js/core/components/functional/3d/3d.js.map +1 -1
- package/dist/js/core/components/functional/3d/constants.js +3 -0
- package/dist/js/core/components/functional/3d/constants.js.map +1 -1
- package/dist/js/core/components/functional/3d/ensure.js +6 -3
- package/dist/js/core/components/functional/3d/ensure.js.map +1 -1
- package/dist/js/core/components/functional/3d/form-params.js +2 -0
- package/dist/js/core/components/functional/3d/form-params.js.map +1 -1
- package/dist/js/core/components/functional/3d/frame-source.js +22 -0
- package/dist/js/core/components/functional/3d/frame-source.js.map +1 -0
- package/dist/js/core/components/functional/3d/life.js +2 -1
- package/dist/js/core/components/functional/3d/life.js.map +1 -1
- package/dist/js/core/components/functional/3d/out-publish.js +3 -2
- package/dist/js/core/components/functional/3d/out-publish.js.map +1 -1
- package/dist/js/core/components/functional/3d/playback.js +6 -1
- package/dist/js/core/components/functional/3d/playback.js.map +1 -1
- package/dist/js/core/components/functional/3d/post-bind.js +207 -0
- package/dist/js/core/components/functional/3d/post-bind.js.map +1 -0
- package/dist/js/core/components/functional/3d/post-channels.js +39 -0
- package/dist/js/core/components/functional/3d/post-channels.js.map +1 -0
- package/dist/js/core/components/functional/3d/post-fx.js +495 -0
- package/dist/js/core/components/functional/3d/post-fx.js.map +1 -0
- package/dist/js/core/components/functional/3d/props.js +142 -0
- package/dist/js/core/components/functional/3d/props.js.map +1 -1
- package/dist/js/core/components/functional/3d/reload.js +5 -0
- package/dist/js/core/components/functional/3d/reload.js.map +1 -1
- package/dist/js/core/components/functional/3d/runtime.js +80 -3
- package/dist/js/core/components/functional/3d/runtime.js.map +1 -1
- package/dist/js/core/components/functional/3d/scene-runtime.js +1 -1
- package/dist/js/core/components/functional/3d/scene-runtime.js.map +1 -1
- package/dist/js/core/components/functional/3d/tune.js +21 -0
- package/dist/js/core/components/functional/3d/tune.js.map +1 -1
- package/dist/js/core/components/functional/3d/updated.js +13 -1
- package/dist/js/core/components/functional/3d/updated.js.map +1 -1
- package/dist/js/core/components/functional/shader/gl-runtime.js +280 -31
- package/dist/js/core/components/functional/shader/gl-runtime.js.map +1 -1
- package/dist/js/core/components/functional/shader/shader.js +207 -61
- package/dist/js/core/components/functional/shader/shader.js.map +1 -1
- package/dist/js/core/components/functional/shader/shadertoy-prelude.js +39 -5
- package/dist/js/core/components/functional/shader/shadertoy-prelude.js.map +1 -1
- package/dist/js/core/components/functional/shader/types.js +58 -7
- package/dist/js/core/components/functional/shader/types.js.map +1 -1
- package/dist/js/core/components/functional/webgpu/gl-fallback.js +27 -6
- package/dist/js/core/components/functional/webgpu/gl-fallback.js.map +1 -1
- package/dist/js/core/components/functional/webgpu/gpu-runtime.js +115 -13
- package/dist/js/core/components/functional/webgpu/gpu-runtime.js.map +1 -1
- package/dist/js/core/components/functional/webgpu/helpers.js +8 -2
- package/dist/js/core/components/functional/webgpu/helpers.js.map +1 -1
- package/dist/js/core/components/functional/webgpu/webgpu.js +43 -1
- package/dist/js/core/components/functional/webgpu/webgpu.js.map +1 -1
- package/dist/js/core/utils/mediaRef.js +86 -0
- package/dist/js/core/utils/mediaRef.js.map +1 -1
- package/dist/types/core/components/functional/3d/3d.d.ts +31 -3
- package/dist/types/core/components/functional/3d/3d.d.ts.map +1 -1
- package/dist/types/core/components/functional/3d/constants.d.ts +1 -1
- package/dist/types/core/components/functional/3d/constants.d.ts.map +1 -1
- package/dist/types/core/components/functional/3d/ensure.d.ts +3 -0
- package/dist/types/core/components/functional/3d/ensure.d.ts.map +1 -1
- package/dist/types/core/components/functional/3d/form-params.d.ts.map +1 -1
- package/dist/types/core/components/functional/3d/frame-source.d.ts +23 -0
- package/dist/types/core/components/functional/3d/frame-source.d.ts.map +1 -0
- package/dist/types/core/components/functional/3d/life.d.ts +2 -0
- package/dist/types/core/components/functional/3d/life.d.ts.map +1 -1
- package/dist/types/core/components/functional/3d/out-publish.d.ts +1 -0
- package/dist/types/core/components/functional/3d/out-publish.d.ts.map +1 -1
- package/dist/types/core/components/functional/3d/playback.d.ts +9 -0
- package/dist/types/core/components/functional/3d/playback.d.ts.map +1 -1
- package/dist/types/core/components/functional/3d/post-bind.d.ts +52 -0
- package/dist/types/core/components/functional/3d/post-bind.d.ts.map +1 -0
- package/dist/types/core/components/functional/3d/post-channels.d.ts +40 -0
- package/dist/types/core/components/functional/3d/post-channels.d.ts.map +1 -0
- package/dist/types/core/components/functional/3d/post-fx.d.ts +73 -0
- package/dist/types/core/components/functional/3d/post-fx.d.ts.map +1 -0
- package/dist/types/core/components/functional/3d/props.d.ts +42 -0
- package/dist/types/core/components/functional/3d/props.d.ts.map +1 -1
- package/dist/types/core/components/functional/3d/reload.d.ts +3 -0
- package/dist/types/core/components/functional/3d/reload.d.ts.map +1 -1
- package/dist/types/core/components/functional/3d/runtime.d.ts +16 -1
- package/dist/types/core/components/functional/3d/runtime.d.ts.map +1 -1
- package/dist/types/core/components/functional/3d/scene-runtime.d.ts +1 -1
- package/dist/types/core/components/functional/3d/scene-runtime.d.ts.map +1 -1
- package/dist/types/core/components/functional/3d/tune.d.ts +5 -0
- package/dist/types/core/components/functional/3d/tune.d.ts.map +1 -1
- package/dist/types/core/components/functional/3d/types.d.ts +16 -0
- package/dist/types/core/components/functional/3d/types.d.ts.map +1 -1
- package/dist/types/core/components/functional/3d/updated.d.ts.map +1 -1
- package/dist/types/core/components/functional/shader/gl-runtime.d.ts +53 -2
- package/dist/types/core/components/functional/shader/gl-runtime.d.ts.map +1 -1
- package/dist/types/core/components/functional/shader/shader.d.ts +41 -9
- package/dist/types/core/components/functional/shader/shader.d.ts.map +1 -1
- package/dist/types/core/components/functional/shader/shadertoy-prelude.d.ts +16 -2
- package/dist/types/core/components/functional/shader/shadertoy-prelude.d.ts.map +1 -1
- package/dist/types/core/components/functional/shader/types.d.ts +35 -5
- package/dist/types/core/components/functional/shader/types.d.ts.map +1 -1
- package/dist/types/core/components/functional/webgpu/gl-fallback.d.ts +4 -0
- package/dist/types/core/components/functional/webgpu/gl-fallback.d.ts.map +1 -1
- package/dist/types/core/components/functional/webgpu/gpu-runtime.d.ts +14 -0
- package/dist/types/core/components/functional/webgpu/gpu-runtime.d.ts.map +1 -1
- package/dist/types/core/components/functional/webgpu/helpers.d.ts +1 -0
- package/dist/types/core/components/functional/webgpu/helpers.d.ts.map +1 -1
- package/dist/types/core/components/functional/webgpu/webgpu.d.ts +11 -1
- package/dist/types/core/components/functional/webgpu/webgpu.d.ts.map +1 -1
- package/dist/types/core/utils/mediaRef.d.ts +34 -0
- package/dist/types/core/utils/mediaRef.d.ts.map +1 -1
- package/package.json +49 -1
- package/src/core/components/functional/3d/3d.md +46 -3
- package/src/core/components/functional/3d/3d.spec.ts +42 -0
- package/src/core/components/functional/3d/3d.ts +112 -3
- package/src/core/components/functional/3d/constants.ts +3 -0
- package/src/core/components/functional/3d/ensure.ts +11 -3
- package/src/core/components/functional/3d/form-params.ts +2 -0
- package/src/core/components/functional/3d/frame-source.ts +30 -0
- package/src/core/components/functional/3d/life.ts +4 -1
- package/src/core/components/functional/3d/out-publish.ts +4 -3
- package/src/core/components/functional/3d/playback.ts +13 -1
- package/src/core/components/functional/3d/post-bind.ts +262 -0
- package/src/core/components/functional/3d/post-channels.spec.ts +36 -0
- package/src/core/components/functional/3d/post-channels.ts +69 -0
- package/src/core/components/functional/3d/post-fx.ts +594 -0
- package/src/core/components/functional/3d/props.ts +45 -0
- package/src/core/components/functional/3d/reload.ts +8 -0
- package/src/core/components/functional/3d/runtime.ts +93 -4
- package/src/core/components/functional/3d/scene-runtime.ts +3 -0
- package/src/core/components/functional/3d/tune.ts +21 -0
- package/src/core/components/functional/3d/types.ts +14 -0
- package/src/core/components/functional/3d/updated.ts +17 -1
- package/src/core/components/functional/shader/gl-runtime.ts +374 -36
- package/src/core/components/functional/shader/shader.md +36 -11
- package/src/core/components/functional/shader/shader.spec.ts +350 -3
- package/src/core/components/functional/shader/shader.ts +236 -59
- package/src/core/components/functional/shader/shadertoy-prelude.ts +49 -5
- package/src/core/components/functional/shader/types.ts +92 -13
- package/src/core/components/functional/webgpu/gl-fallback.ts +28 -4
- package/src/core/components/functional/webgpu/gpu-runtime.ts +154 -18
- package/src/core/components/functional/webgpu/helpers.ts +8 -2
- package/src/core/components/functional/webgpu/webgpu.md +13 -2
- package/src/core/components/functional/webgpu/webgpu.spec.ts +37 -0
- package/src/core/components/functional/webgpu/webgpu.ts +48 -1
- package/src/core/utils/mediaRef.spec.ts +61 -0
- package/src/core/utils/mediaRef.ts +108 -0
- package/src/docs/_misc/visual-stack.md +37 -3
- package/src/docs/components/docs-demo-sources.ts +42 -0
- package/src/docs/docs.ts +3 -0
- package/src/docs/example/docs-3d-post-depth-demo.ts +68 -0
- package/src/docs/example/docs-3d-shader-live-demo.ts +98 -0
- package/src/docs/example/docs-3d-webgpu-live-demo.ts +83 -0
- package/src/docs/example/docs-harris-webgpu-demo.ts +53 -55
- package/src/docs/search/docs-search.json +2583 -863
- package/src/tsconfig.json +36 -0
- package/src/tsconfig.tsbuildinfo +1 -1
|
@@ -6,14 +6,22 @@ import { bootScene } from "./boot";
|
|
|
6
6
|
import { ops, type OpsCtx } from "./ops";
|
|
7
7
|
import type { SceneRuntimeOptions } from "./opts";
|
|
8
8
|
import type { SceneHit } from "./pick";
|
|
9
|
+
import {
|
|
10
|
+
PostFxCompileError,
|
|
11
|
+
PostFxPipeline,
|
|
12
|
+
type PostFxConfig,
|
|
13
|
+
type PostFxUniforms,
|
|
14
|
+
} from "./post-fx";
|
|
9
15
|
import { tune, type TuneCtx } from "./tune";
|
|
10
16
|
import type { Sonic3dAsset, Sonic3dOutput } from "./types";
|
|
11
17
|
import { view, type ViewCtx } from "./view";
|
|
12
18
|
|
|
13
19
|
export type { SceneHit, SceneRuntimeOptions };
|
|
20
|
+
export { PostFxCompileError };
|
|
21
|
+
export type { PostFxConfig, PostFxUniforms };
|
|
14
22
|
|
|
15
23
|
/**
|
|
16
|
-
* Runtime Three.js encapsulé : renderer, scène, caméra, load, fit, pick.
|
|
24
|
+
* Runtime Three.js encapsulé : renderer, scène, caméra, load, fit, pick, post FX.
|
|
17
25
|
* Le composant Lit gère RAF / viewport / DP.
|
|
18
26
|
*/
|
|
19
27
|
export class SceneRuntime {
|
|
@@ -46,6 +54,19 @@ export class SceneRuntime {
|
|
|
46
54
|
private highlighted: THREE.Mesh | null = null;
|
|
47
55
|
private prevEmissive = new THREE.Color();
|
|
48
56
|
private prevEmissiveIntensity = 0;
|
|
57
|
+
private postFx: PostFxPipeline;
|
|
58
|
+
private lastCssW = 1;
|
|
59
|
+
private lastCssH = 1;
|
|
60
|
+
private damping = 0.08;
|
|
61
|
+
private postFrame: PostFxUniforms = {
|
|
62
|
+
time: 0,
|
|
63
|
+
timeDelta: 1 / 60,
|
|
64
|
+
frame: 0,
|
|
65
|
+
mouse: [0, 0, 0, 0],
|
|
66
|
+
params: [0, 0, 0, 0],
|
|
67
|
+
near: 0.1,
|
|
68
|
+
far: 100,
|
|
69
|
+
};
|
|
49
70
|
|
|
50
71
|
constructor(opts: SceneRuntimeOptions) {
|
|
51
72
|
const b = bootScene(opts);
|
|
@@ -62,9 +83,32 @@ export class SceneRuntime {
|
|
|
62
83
|
this.fov = b.fov;
|
|
63
84
|
this.fitEnabled = b.fitEnabled;
|
|
64
85
|
this.limits = b.limits;
|
|
86
|
+
this.postFx = new PostFxPipeline(this.renderer);
|
|
65
87
|
this.applyCameraMode(this.mode);
|
|
66
88
|
if (b.autoRotate) this.setAutoRotate(true);
|
|
67
|
-
void [
|
|
89
|
+
void [
|
|
90
|
+
this.canvas,
|
|
91
|
+
this.perspCam,
|
|
92
|
+
this.orthoCam,
|
|
93
|
+
this.root,
|
|
94
|
+
this.content,
|
|
95
|
+
this.lights,
|
|
96
|
+
this.loader,
|
|
97
|
+
this.loadToken,
|
|
98
|
+
this.blobUrl,
|
|
99
|
+
this.dprMax,
|
|
100
|
+
this.fov,
|
|
101
|
+
this.fitEnabled,
|
|
102
|
+
this.limits,
|
|
103
|
+
this.bbox,
|
|
104
|
+
this.target,
|
|
105
|
+
this.raycaster,
|
|
106
|
+
this.pointerNdc,
|
|
107
|
+
this.highlighted,
|
|
108
|
+
this.prevEmissive,
|
|
109
|
+
this.prevEmissiveIntensity,
|
|
110
|
+
this.unbindWheelRelay,
|
|
111
|
+
];
|
|
68
112
|
}
|
|
69
113
|
|
|
70
114
|
get ready() {
|
|
@@ -79,6 +123,9 @@ export class SceneRuntime {
|
|
|
79
123
|
get isLost() {
|
|
80
124
|
return this.renderer.getContext()?.isContextLost?.() ?? false;
|
|
81
125
|
}
|
|
126
|
+
get hasPostFx() {
|
|
127
|
+
return this.postFx.isEnabled;
|
|
128
|
+
}
|
|
82
129
|
|
|
83
130
|
setDprMax(v: number) {
|
|
84
131
|
tune.setDprMax(this.asTuneCtx(), v);
|
|
@@ -95,6 +142,15 @@ export class SceneRuntime {
|
|
|
95
142
|
setAutoRotate(v: boolean) {
|
|
96
143
|
tune.setAutoRotate(this.asTuneCtx(), v);
|
|
97
144
|
}
|
|
145
|
+
setDamping(v: number) {
|
|
146
|
+
this.damping = Number.isFinite(v) ? Math.max(0, v) : 0.08;
|
|
147
|
+
tune.setDamping(this.asTuneCtx(), this.damping);
|
|
148
|
+
}
|
|
149
|
+
/** Coupe autoRotate + inertie OrbitControls. */
|
|
150
|
+
stopMotion() {
|
|
151
|
+
tune.setAutoRotate(this.asTuneCtx(), false);
|
|
152
|
+
tune.stopMotion(this.asTuneCtx());
|
|
153
|
+
}
|
|
98
154
|
setOrbitLimits(opts: Parameters<typeof tune.setOrbitLimits>[1]) {
|
|
99
155
|
tune.setOrbitLimits(this.asTuneCtx(), opts);
|
|
100
156
|
}
|
|
@@ -104,9 +160,17 @@ export class SceneRuntime {
|
|
|
104
160
|
|
|
105
161
|
applyCameraMode(mode: Sonic3dCameraMode) {
|
|
106
162
|
view.applyCameraMode(this.asViewCtx(), mode);
|
|
163
|
+
tune.setDamping(this.asTuneCtx(), this.damping);
|
|
107
164
|
}
|
|
108
165
|
resize(cssW: number, cssH: number) {
|
|
166
|
+
this.lastCssW = cssW;
|
|
167
|
+
this.lastCssH = cssH;
|
|
109
168
|
view.resize(this.asViewCtx(), cssW, cssH);
|
|
169
|
+
const dpr = Math.min(
|
|
170
|
+
typeof window !== "undefined" ? window.devicePixelRatio || 1 : 1,
|
|
171
|
+
this.dprMax,
|
|
172
|
+
);
|
|
173
|
+
this.postFx.resize(cssW * dpr, cssH * dpr);
|
|
110
174
|
}
|
|
111
175
|
async load(asset: Sonic3dAsset | null) {
|
|
112
176
|
return ops.runLoad(this.asOpsCtx(), asset);
|
|
@@ -114,9 +178,34 @@ export class SceneRuntime {
|
|
|
114
178
|
fitToContent() {
|
|
115
179
|
ops.fitToContent(this.asOpsCtx());
|
|
116
180
|
}
|
|
181
|
+
|
|
182
|
+
setPostConfig(config: PostFxConfig | null) {
|
|
183
|
+
this.postFx.setConfig(config);
|
|
184
|
+
if (config && this.lastCssW > 0) {
|
|
185
|
+
this.resize(this.lastCssW, this.lastCssH);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
setPostElementResolver(fn: ((key: string) => Element | null) | null) {
|
|
190
|
+
this.postFx.setElementResolver(fn);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
setPostFrame(frame: Partial<PostFxUniforms>) {
|
|
194
|
+
Object.assign(this.postFrame, frame);
|
|
195
|
+
const cam = this.activeCam as THREE.PerspectiveCamera;
|
|
196
|
+
if ("near" in cam && "far" in cam) {
|
|
197
|
+
this.postFrame.near = cam.near;
|
|
198
|
+
this.postFrame.far = cam.far;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
117
202
|
render() {
|
|
118
203
|
this.controls?.update();
|
|
119
|
-
|
|
204
|
+
if (this.postFx.isEnabled) {
|
|
205
|
+
this.postFx.render(this.scene, this.activeCam, this.postFrame);
|
|
206
|
+
} else {
|
|
207
|
+
this.renderer.render(this.scene, this.activeCam);
|
|
208
|
+
}
|
|
120
209
|
}
|
|
121
210
|
pick(normX: number, normY: number): SceneHit | null {
|
|
122
211
|
return ops.pick(this.asOpsCtx(), normX, normY);
|
|
@@ -138,6 +227,7 @@ export class SceneRuntime {
|
|
|
138
227
|
return ops.buildSnapshot(this.asOpsCtx(), base);
|
|
139
228
|
}
|
|
140
229
|
dispose(loseContext = false) {
|
|
230
|
+
this.postFx.dispose();
|
|
141
231
|
ops.dispose(this.asOpsCtx(), loseContext);
|
|
142
232
|
}
|
|
143
233
|
|
|
@@ -145,4 +235,3 @@ export class SceneRuntime {
|
|
|
145
235
|
private asViewCtx = () => this as unknown as ViewCtx;
|
|
146
236
|
private asOpsCtx = () => this as unknown as OpsCtx;
|
|
147
237
|
}
|
|
148
|
-
|
|
@@ -37,6 +37,25 @@ function setAutoRotate(ctx: TuneCtx, v: boolean) {
|
|
|
37
37
|
if (ctx.controls) ctx.controls.autoRotate = v;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
function setDamping(ctx: TuneCtx, v: number) {
|
|
41
|
+
if (!ctx.controls) return;
|
|
42
|
+
const d = Number.isFinite(v) ? Math.max(0, v) : 0.08;
|
|
43
|
+
ctx.controls.enableDamping = d > 0;
|
|
44
|
+
ctx.controls.dampingFactor = d > 0 ? d : 0.08;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** Coupe autoRotate + vide l’inertie OrbitControls. */
|
|
48
|
+
function stopMotion(ctx: TuneCtx) {
|
|
49
|
+
if (!ctx.controls) return;
|
|
50
|
+
ctx.controls.autoRotate = false;
|
|
51
|
+
const wasDamping = ctx.controls.enableDamping;
|
|
52
|
+
const factor = ctx.controls.dampingFactor;
|
|
53
|
+
ctx.controls.enableDamping = false;
|
|
54
|
+
ctx.controls.update();
|
|
55
|
+
ctx.controls.enableDamping = wasDamping;
|
|
56
|
+
ctx.controls.dampingFactor = factor;
|
|
57
|
+
}
|
|
58
|
+
|
|
40
59
|
function setOrbitLimits(ctx: TuneCtx, opts: Partial<OrbitLimits>) {
|
|
41
60
|
ctx.limits = orbit.mergeLimits(ctx.limits, opts);
|
|
42
61
|
orbit.applyLimitsToControls(ctx.controls, ctx.limits);
|
|
@@ -67,6 +86,8 @@ export const tune = {
|
|
|
67
86
|
setFov,
|
|
68
87
|
setFit,
|
|
69
88
|
setAutoRotate,
|
|
89
|
+
setDamping,
|
|
90
|
+
stopMotion,
|
|
70
91
|
setOrbitLimits,
|
|
71
92
|
setOrbitSpherical,
|
|
72
93
|
} as const;
|
|
@@ -65,6 +65,13 @@ export type Sonic3dConfig = {
|
|
|
65
65
|
playOnHover?: boolean;
|
|
66
66
|
/** Libère le renderer hors viewport (défaut true). */
|
|
67
67
|
releaseOffscreen?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Garde RAF / runtime hors viewport (pont live).
|
|
70
|
+
* Aussi auto via `registerFrameConsumer`.
|
|
71
|
+
*/
|
|
72
|
+
playOffscreen?: boolean;
|
|
73
|
+
/** Inertie OrbitControls (défaut 0.08, 0 = off). */
|
|
74
|
+
damping?: number;
|
|
68
75
|
dprMax?: number;
|
|
69
76
|
aspectRatio?: string;
|
|
70
77
|
|
|
@@ -124,6 +131,8 @@ export type Sonic3dOutput = {
|
|
|
124
131
|
distance: number;
|
|
125
132
|
yaw: number;
|
|
126
133
|
pitch: number;
|
|
134
|
+
/** 1 si la caméra bouge (orbit / inertie / autoRotate), sinon 0. */
|
|
135
|
+
moving?: number;
|
|
127
136
|
/** Présents après un pick réussi. */
|
|
128
137
|
hitX?: number;
|
|
129
138
|
hitY?: number;
|
|
@@ -142,4 +151,9 @@ export type Sonic3dOutput = {
|
|
|
142
151
|
frameUrl?: string;
|
|
143
152
|
/** MediaRef du canvas (url + dimensions) — chaînable vers `sonic-shader`. */
|
|
144
153
|
snapshot?: Sonic3dSnapshot;
|
|
154
|
+
/**
|
|
155
|
+
* Pont live (Lot 1) : `{ element: sonic-3d }` pour `channel0` sans JPEG.
|
|
156
|
+
* Publié une fois au ready si un lecteur écoute `frameSource`.
|
|
157
|
+
*/
|
|
158
|
+
frameSource?: { element: Element };
|
|
145
159
|
};
|
|
@@ -3,6 +3,7 @@ import type { LifeHost } from "./life";
|
|
|
3
3
|
import { life } from "./life";
|
|
4
4
|
import { parse } from "./parse";
|
|
5
5
|
import { playback } from "./playback";
|
|
6
|
+
import { postBind } from "./post-bind";
|
|
6
7
|
import { reload } from "./reload";
|
|
7
8
|
|
|
8
9
|
function hasAny(
|
|
@@ -61,10 +62,25 @@ function updated(
|
|
|
61
62
|
if (changed.has("autoRotate") || changed.has("play")) {
|
|
62
63
|
playback.syncAutoRotate(host as never);
|
|
63
64
|
}
|
|
64
|
-
if (
|
|
65
|
+
if (
|
|
66
|
+
changed.has("play") ||
|
|
67
|
+
changed.has("playOnHover") ||
|
|
68
|
+
changed.has("playOffscreen")
|
|
69
|
+
) {
|
|
65
70
|
host.syncPlayback();
|
|
66
71
|
}
|
|
72
|
+
if (changed.has("playOffscreen") || changed.has("releaseOffscreen")) {
|
|
73
|
+
ensure.syncVisibility(host as never);
|
|
74
|
+
}
|
|
75
|
+
if (changed.has("damping") && host.runtime) {
|
|
76
|
+
host.runtime.setDamping(
|
|
77
|
+
(host as unknown as { damping: number }).damping,
|
|
78
|
+
);
|
|
79
|
+
}
|
|
67
80
|
if (changed.has("src") || changed.has("asset")) void reload.run(host as never);
|
|
81
|
+
if (postBind.propsChanged(changed)) {
|
|
82
|
+
postBind.applyConfig(host as never);
|
|
83
|
+
}
|
|
68
84
|
}
|
|
69
85
|
|
|
70
86
|
export const propUpdate = { updated } as const;
|