@geometra/renderer-three 0.2.0 → 1.4.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/dist/__tests__/scene3d-manager.test.d.ts +2 -0
- package/dist/__tests__/scene3d-manager.test.d.ts.map +1 -0
- package/dist/__tests__/scene3d-manager.test.js +80 -0
- package/dist/__tests__/scene3d-manager.test.js.map +1 -0
- package/dist/host-css-coerce.d.ts +39 -0
- package/dist/host-css-coerce.d.ts.map +1 -0
- package/dist/host-css-coerce.js +69 -0
- package/dist/host-css-coerce.js.map +1 -0
- package/dist/host-layout-plain.d.ts +164 -0
- package/dist/host-layout-plain.d.ts.map +1 -0
- package/dist/host-layout-plain.js +255 -0
- package/dist/host-layout-plain.js.map +1 -0
- package/dist/index.d.ts +43 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +42 -5
- package/dist/index.js.map +1 -1
- package/dist/layout-sync.d.ts +51 -0
- package/dist/layout-sync.d.ts.map +1 -0
- package/dist/layout-sync.js +59 -0
- package/dist/layout-sync.js.map +1 -0
- package/dist/page-host.d.ts +41 -0
- package/dist/page-host.d.ts.map +1 -0
- package/dist/page-host.js +89 -0
- package/dist/page-host.js.map +1 -0
- package/dist/scene3d-manager.d.ts +33 -0
- package/dist/scene3d-manager.d.ts.map +1 -0
- package/dist/scene3d-manager.js +394 -0
- package/dist/scene3d-manager.js.map +1 -0
- package/dist/split-host.d.ts +65 -9
- package/dist/split-host.d.ts.map +1 -1
- package/dist/split-host.js +115 -39
- package/dist/split-host.js.map +1 -1
- package/dist/stacked-host.d.ts +64 -14
- package/dist/stacked-host.d.ts.map +1 -1
- package/dist/stacked-host.js +77 -41
- package/dist/stacked-host.js.map +1 -1
- package/dist/three-scene-basics.d.ts +313 -2
- package/dist/three-scene-basics.d.ts.map +1 -1
- package/dist/three-scene-basics.js +418 -1
- package/dist/three-scene-basics.js.map +1 -1
- package/dist/utils.d.ts +156 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +207 -6
- package/dist/utils.js.map +1 -1
- package/package.json +15 -18
- package/LICENSE +0 -21
- package/README.md +0 -111
package/dist/split-host.js
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
1
|
import { createBrowserCanvasClient, } from '@geometra/renderer-canvas';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { GEOMETRA_THREE_HOST_SCENE_DEFAULTS, createGeometraThreeWebGLWithSceneBasics, disposeGeometraThreeWebGLWithSceneBasics, } from './three-scene-basics.js';
|
|
3
|
+
import { createGeometraHostLayoutSyncRaf } from './layout-sync.js';
|
|
4
|
+
import { coerceHostNonNegativeCssPx } from './host-css-coerce.js';
|
|
5
|
+
import { resizeGeometraThreePerspectiveView, resolveHostDevicePixelRatio } from './utils.js';
|
|
6
|
+
/**
|
|
7
|
+
* Default Geometra column width for {@link createThreeGeometraSplitHost}; same value as the
|
|
8
|
+
* `geometraWidth` option fallback and README.
|
|
9
|
+
*/
|
|
10
|
+
export const GEOMETRA_SPLIT_HOST_LAYOUT_DEFAULTS = {
|
|
11
|
+
geometraWidth: 420,
|
|
12
|
+
};
|
|
5
13
|
function panelStyle(el, flex) {
|
|
6
14
|
el.style.flex = flex;
|
|
7
15
|
el.style.minWidth = '0';
|
|
@@ -19,18 +27,28 @@ function fullSizeCanvas(canvas) {
|
|
|
19
27
|
*
|
|
20
28
|
* This is the recommended **hybrid** layout: 3D stays in Three; chrome and data panes stay in Geometra’s protocol.
|
|
21
29
|
* Geometra’s client still uses `resizeTarget: window` by default; when only the Geometra column changes size,
|
|
22
|
-
* a `ResizeObserver`
|
|
23
|
-
*
|
|
30
|
+
* a `ResizeObserver` schedules a synthetic `resize` on `window` so layout width/height track the panel.
|
|
31
|
+
* The host `root` and both flex panes are observed (same idea as {@link createThreeGeometraStackedHost} observing
|
|
32
|
+
* its `root`) so container-driven root box changes still coalesce into the same rAF pass even if a panel callback
|
|
33
|
+
* ordering quirk would otherwise miss a tick.
|
|
34
|
+
* Panel-driven updates coalesce to at most **one** animation frame per burst: a single `requestAnimationFrame`
|
|
35
|
+
* pass runs the Three.js buffer resize and (when needed) that synthetic `resize`, so both flex panes firing
|
|
36
|
+
* in the same frame do not call `renderer.setSize` twice.
|
|
37
|
+
*
|
|
38
|
+
* Real `window` `resize` events schedule the same coalesced Three.js pass **without** an extra synthetic
|
|
39
|
+
* `resize`, so the thin client is not double-notified when the browser already fired `resize`.
|
|
24
40
|
*
|
|
25
41
|
* The Three.js pane listens to `window` `resize` as well so `devicePixelRatio` updates (zoom / display changes)
|
|
26
|
-
* refresh the WebGL drawing buffer without relying on panel `ResizeObserver` alone.
|
|
42
|
+
* refresh the WebGL drawing buffer without relying on panel `ResizeObserver` alone. Optional
|
|
43
|
+
* {@link ThreeGeometraSplitHostOptions.maxDevicePixelRatio} caps the ratio used for the WebGL buffer.
|
|
27
44
|
*
|
|
28
45
|
* Pass through {@link BrowserCanvasClientOptions} from `@geometra/renderer-canvas` / `@geometra/client`
|
|
29
46
|
* (for example `binaryFraming`, `onError`, `onFrameMetrics`, `onData` for JSON side-channels on the same
|
|
30
47
|
* socket as layout; channel names are defined by your app and the Geometra server).
|
|
31
48
|
*/
|
|
32
49
|
export function createThreeGeometraSplitHost(options) {
|
|
33
|
-
const { container, geometraWidth =
|
|
50
|
+
const { container, geometraWidth: geometraWidthOpt = GEOMETRA_SPLIT_HOST_LAYOUT_DEFAULTS.geometraWidth, geometraOnLeft = false, maxDevicePixelRatio, threeBackground = GEOMETRA_THREE_HOST_SCENE_DEFAULTS.threeBackground, cameraFov = GEOMETRA_THREE_HOST_SCENE_DEFAULTS.cameraFov, cameraNear = GEOMETRA_THREE_HOST_SCENE_DEFAULTS.cameraNear, cameraFar = GEOMETRA_THREE_HOST_SCENE_DEFAULTS.cameraFar, cameraPosition = GEOMETRA_THREE_HOST_SCENE_DEFAULTS.cameraPosition, onThreeReady, onThreeFrame, overlayUrl, overlayRendererOptions, overlayPointerEvents = 'none', overlayBinaryFraming, window: providedWindow, ...browserOptions } = options;
|
|
51
|
+
const geometraWidth = coerceHostNonNegativeCssPx(geometraWidthOpt, GEOMETRA_SPLIT_HOST_LAYOUT_DEFAULTS.geometraWidth);
|
|
34
52
|
const doc = container.ownerDocument;
|
|
35
53
|
const win = providedWindow ?? doc.defaultView;
|
|
36
54
|
if (!win) {
|
|
@@ -59,15 +77,24 @@ export function createThreeGeometraSplitHost(options) {
|
|
|
59
77
|
const threeCanvas = doc.createElement('canvas');
|
|
60
78
|
fullSizeCanvas(threeCanvas);
|
|
61
79
|
threePanel.appendChild(threeCanvas);
|
|
80
|
+
// Overlay canvas on the Three.js panel (optional)
|
|
81
|
+
let overlayCanvasEl;
|
|
82
|
+
if (overlayUrl) {
|
|
83
|
+
overlayCanvasEl = doc.createElement('canvas');
|
|
84
|
+
overlayCanvasEl.style.display = 'block';
|
|
85
|
+
overlayCanvasEl.style.position = 'absolute';
|
|
86
|
+
overlayCanvasEl.style.left = '0';
|
|
87
|
+
overlayCanvasEl.style.top = '0';
|
|
88
|
+
overlayCanvasEl.style.width = '100%';
|
|
89
|
+
overlayCanvasEl.style.height = '100%';
|
|
90
|
+
overlayCanvasEl.style.pointerEvents = overlayPointerEvents;
|
|
91
|
+
overlayCanvasEl.style.zIndex = '1';
|
|
92
|
+
threePanel.appendChild(overlayCanvasEl);
|
|
93
|
+
}
|
|
62
94
|
const geometraCanvas = doc.createElement('canvas');
|
|
63
95
|
fullSizeCanvas(geometraCanvas);
|
|
64
96
|
geometraPanel.appendChild(geometraCanvas);
|
|
65
|
-
const glRenderer =
|
|
66
|
-
canvas: threeCanvas,
|
|
67
|
-
antialias: true,
|
|
68
|
-
alpha: false,
|
|
69
|
-
});
|
|
70
|
-
const { scene, camera, clock } = createGeometraThreeSceneBasics({
|
|
97
|
+
const { renderer: glRenderer, scene, camera, clock } = createGeometraThreeWebGLWithSceneBasics(threeCanvas, {
|
|
71
98
|
threeBackground,
|
|
72
99
|
cameraFov,
|
|
73
100
|
cameraNear,
|
|
@@ -75,35 +102,68 @@ export function createThreeGeometraSplitHost(options) {
|
|
|
75
102
|
cameraPosition,
|
|
76
103
|
});
|
|
77
104
|
const resizeThree = () => {
|
|
78
|
-
resizeGeometraThreePerspectiveView(glRenderer, camera, threePanel.clientWidth, threePanel.clientHeight, win.devicePixelRatio || 1);
|
|
105
|
+
resizeGeometraThreePerspectiveView(glRenderer, camera, threePanel.clientWidth, threePanel.clientHeight, resolveHostDevicePixelRatio(win.devicePixelRatio || 1, maxDevicePixelRatio));
|
|
79
106
|
};
|
|
107
|
+
let destroyed = false;
|
|
108
|
+
const layoutSync = createGeometraHostLayoutSyncRaf(win, {
|
|
109
|
+
isDestroyed: () => destroyed,
|
|
110
|
+
syncLayout: resizeThree,
|
|
111
|
+
dispatchGeometraResize: () => {
|
|
112
|
+
win.dispatchEvent(new Event('resize'));
|
|
113
|
+
},
|
|
114
|
+
});
|
|
80
115
|
const onWindowResize = () => {
|
|
81
|
-
|
|
116
|
+
layoutSync.schedule(false);
|
|
82
117
|
};
|
|
83
118
|
win.addEventListener('resize', onWindowResize, { passive: true });
|
|
84
119
|
resizeThree();
|
|
85
|
-
const geometraHandle =
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
120
|
+
const geometraHandle = (() => {
|
|
121
|
+
try {
|
|
122
|
+
return createBrowserCanvasClient({
|
|
123
|
+
...browserOptions,
|
|
124
|
+
canvas: geometraCanvas,
|
|
125
|
+
window: win,
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
catch (err) {
|
|
129
|
+
layoutSync.cancel();
|
|
130
|
+
win.removeEventListener('resize', onWindowResize);
|
|
131
|
+
disposeGeometraThreeWebGLWithSceneBasics({ renderer: glRenderer, clock });
|
|
132
|
+
root.remove();
|
|
133
|
+
throw err;
|
|
134
|
+
}
|
|
135
|
+
})();
|
|
136
|
+
// Overlay Geometra client (optional)
|
|
137
|
+
let overlayHandle;
|
|
138
|
+
if (overlayUrl && overlayCanvasEl) {
|
|
139
|
+
try {
|
|
140
|
+
overlayHandle = createBrowserCanvasClient({
|
|
141
|
+
url: overlayUrl,
|
|
142
|
+
binaryFraming: overlayBinaryFraming ?? browserOptions.binaryFraming,
|
|
143
|
+
canvas: overlayCanvasEl,
|
|
144
|
+
window: win,
|
|
145
|
+
rendererOptions: {
|
|
146
|
+
background: 'transparent',
|
|
147
|
+
...overlayRendererOptions,
|
|
148
|
+
},
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
catch (err) {
|
|
152
|
+
layoutSync.cancel();
|
|
153
|
+
win.removeEventListener('resize', onWindowResize);
|
|
154
|
+
geometraHandle.destroy();
|
|
155
|
+
disposeGeometraThreeWebGLWithSceneBasics({ renderer: glRenderer, clock });
|
|
156
|
+
root.remove();
|
|
157
|
+
throw err;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
99
160
|
const roContainer = new ResizeObserver(() => {
|
|
100
|
-
|
|
101
|
-
triggerGeometraResize();
|
|
161
|
+
layoutSync.schedule(true);
|
|
102
162
|
});
|
|
163
|
+
roContainer.observe(root);
|
|
103
164
|
roContainer.observe(threePanel);
|
|
104
165
|
roContainer.observe(geometraPanel);
|
|
105
166
|
let rafId;
|
|
106
|
-
let destroyed = false;
|
|
107
167
|
const destroy = () => {
|
|
108
168
|
if (destroyed)
|
|
109
169
|
return;
|
|
@@ -112,14 +172,12 @@ export function createThreeGeometraSplitHost(options) {
|
|
|
112
172
|
win.cancelAnimationFrame(rafId);
|
|
113
173
|
rafId = undefined;
|
|
114
174
|
}
|
|
115
|
-
|
|
116
|
-
win.cancelAnimationFrame(geometraResizeRafId);
|
|
117
|
-
geometraResizeRafId = undefined;
|
|
118
|
-
}
|
|
175
|
+
layoutSync.cancel();
|
|
119
176
|
win.removeEventListener('resize', onWindowResize);
|
|
120
177
|
roContainer.disconnect();
|
|
178
|
+
overlayHandle?.destroy();
|
|
121
179
|
geometraHandle.destroy();
|
|
122
|
-
glRenderer
|
|
180
|
+
disposeGeometraThreeWebGLWithSceneBasics({ renderer: glRenderer, clock });
|
|
123
181
|
root.remove();
|
|
124
182
|
};
|
|
125
183
|
const ctxBase = {
|
|
@@ -129,14 +187,30 @@ export function createThreeGeometraSplitHost(options) {
|
|
|
129
187
|
threeCanvas,
|
|
130
188
|
destroy,
|
|
131
189
|
};
|
|
132
|
-
|
|
190
|
+
try {
|
|
191
|
+
onThreeReady?.(ctxBase);
|
|
192
|
+
}
|
|
193
|
+
catch (err) {
|
|
194
|
+
destroy();
|
|
195
|
+
throw err;
|
|
196
|
+
}
|
|
133
197
|
const loop = () => {
|
|
134
198
|
if (destroyed)
|
|
135
199
|
return;
|
|
136
200
|
rafId = win.requestAnimationFrame(loop);
|
|
137
201
|
const delta = clock.getDelta();
|
|
138
202
|
const elapsed = clock.elapsedTime;
|
|
139
|
-
|
|
203
|
+
try {
|
|
204
|
+
if (onThreeFrame?.({ ...ctxBase, clock, delta, elapsed }) === false) {
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
catch (err) {
|
|
209
|
+
destroy();
|
|
210
|
+
throw err;
|
|
211
|
+
}
|
|
212
|
+
if (destroyed)
|
|
213
|
+
return;
|
|
140
214
|
glRenderer.render(scene, camera);
|
|
141
215
|
};
|
|
142
216
|
if (!destroyed) {
|
|
@@ -148,11 +222,13 @@ export function createThreeGeometraSplitHost(options) {
|
|
|
148
222
|
geometraPanel,
|
|
149
223
|
threeCanvas,
|
|
150
224
|
geometraCanvas,
|
|
225
|
+
overlayCanvas: overlayCanvasEl,
|
|
151
226
|
renderer: glRenderer,
|
|
152
227
|
scene,
|
|
153
228
|
camera,
|
|
154
229
|
clock,
|
|
155
230
|
geometra: geometraHandle,
|
|
231
|
+
overlay: overlayHandle,
|
|
156
232
|
destroy,
|
|
157
233
|
};
|
|
158
234
|
}
|
package/dist/split-host.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"split-host.js","sourceRoot":"","sources":["../src/split-host.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"split-host.js","sourceRoot":"","sources":["../src/split-host.ts"],"names":[],"mappings":"AACA,OAAO,EACL,yBAAyB,GAG1B,MAAM,2BAA2B,CAAA;AAClC,OAAO,EACL,kCAAkC,EAClC,uCAAuC,EACvC,wCAAwC,GAEzC,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,+BAA+B,EAAE,MAAM,kBAAkB,CAAA;AAClE,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAA;AACjE,OAAO,EAAE,kCAAkC,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAA;AAS5F;;;GAGG;AACH,MAAM,CAAC,MAAM,mCAAmC,GAAG;IACjD,aAAa,EAAE,GAAG;CACV,CAAA;AAwFV,SAAS,UAAU,CAAC,EAAe,EAAE,IAAY;IAC/C,EAAE,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAA;IACpB,EAAE,CAAC,KAAK,CAAC,QAAQ,GAAG,GAAG,CAAA;IACvB,EAAE,CAAC,KAAK,CAAC,SAAS,GAAG,GAAG,CAAA;IACxB,EAAE,CAAC,KAAK,CAAC,QAAQ,GAAG,UAAU,CAAA;IAC9B,EAAE,CAAC,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAA;AAC9B,CAAC;AAED,SAAS,cAAc,CAAC,MAAyB;IAC/C,MAAM,CAAC,KAAK,CAAC,OAAO,GAAG,OAAO,CAAA;IAC9B,MAAM,CAAC,KAAK,CAAC,KAAK,GAAG,MAAM,CAAA;IAC3B,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,MAAM,CAAA;AAC9B,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,4BAA4B,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AI,CAAC;YACH,IAAI,YAAY,EAAE,CAAC,EAAE,GAAG,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC;gBACpE,OAAM;YACR,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,EAAE,CAAA;YACT,MAAM,GAAG,CAAA;QACX,CAAC;QACD,IAAI,SAAS;YAAE,OAAM;QACrB,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;IAClC,CAAC,CAAA;IAED,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,KAAK,GAAG,GAAG,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAA;IACzC,CAAC;IAED,OAAO;QACL,IAAI;QACJ,UAAU;QACV,aAAa;QACb,WAAW;QACX,cAAc;QACd,aAAa,EAAE,eAAe;QAC9B,QAAQ,EAAE,UAAU;QACpB,KAAK;QACL,MAAM;QACN,KAAK;QACL,QAAQ,EAAE,cAAc;QACxB,OAAO,EAAE,aAAa;QACtB,OAAO;KACR,CAAA;AACH,CAAC"}
|
package/dist/stacked-host.d.ts
CHANGED
|
@@ -1,34 +1,74 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
|
-
import { type BrowserCanvasClientHandle
|
|
3
|
-
import type { ThreeFrameContext, ThreeRuntimeContext } from './split-host.js';
|
|
2
|
+
import { type BrowserCanvasClientHandle } from '@geometra/renderer-canvas';
|
|
3
|
+
import type { GeometraHostBrowserCanvasClientOptions, ThreeFrameContext, ThreeRuntimeContext } from './split-host.js';
|
|
4
4
|
import { type GeometraThreeSceneBasicsOptions } from './three-scene-basics.js';
|
|
5
|
-
|
|
6
|
-
export type GeometraHudPlacement
|
|
7
|
-
|
|
5
|
+
import { type GeometraHudPlacement } from './host-css-coerce.js';
|
|
6
|
+
export type { GeometraHudPlacement } from './host-css-coerce.js';
|
|
7
|
+
/**
|
|
8
|
+
* Default HUD width, height, corner, and margin for {@link createThreeGeometraStackedHost}; same as
|
|
9
|
+
* those option fallbacks and README.
|
|
10
|
+
*/
|
|
11
|
+
export declare const GEOMETRA_STACKED_HOST_LAYOUT_DEFAULTS: {
|
|
12
|
+
readonly geometraHudWidth: 420;
|
|
13
|
+
readonly geometraHudHeight: 320;
|
|
14
|
+
readonly geometraHudPlacement: "bottom-right";
|
|
15
|
+
readonly geometraHudMargin: 12;
|
|
16
|
+
};
|
|
17
|
+
export interface ThreeGeometraStackedHostOptions extends GeometraHostBrowserCanvasClientOptions, GeometraThreeSceneBasicsOptions {
|
|
8
18
|
/** Host element; a full-size stacking context is appended (existing children are left untouched). */
|
|
9
19
|
container: HTMLElement;
|
|
10
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* HUD width in CSS pixels. Default: {@link GEOMETRA_STACKED_HOST_LAYOUT_DEFAULTS.geometraHudWidth}.
|
|
22
|
+
* Non-finite or negative values fall back to the default so layout does not emit invalid `px` styles.
|
|
23
|
+
*/
|
|
11
24
|
geometraHudWidth?: number;
|
|
12
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* HUD height in CSS pixels. Default: {@link GEOMETRA_STACKED_HOST_LAYOUT_DEFAULTS.geometraHudHeight}.
|
|
27
|
+
* Non-finite or negative values fall back to the default.
|
|
28
|
+
*/
|
|
13
29
|
geometraHudHeight?: number;
|
|
14
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* HUD corner. Default: {@link GEOMETRA_STACKED_HOST_LAYOUT_DEFAULTS.geometraHudPlacement}.
|
|
32
|
+
* Runtime strings (e.g. from JSON or agents) are normalized with {@link coerceGeometraHudPlacement}
|
|
33
|
+
* (trim + case-insensitive match for the four literals; anything else uses the default).
|
|
34
|
+
*/
|
|
15
35
|
geometraHudPlacement?: GeometraHudPlacement;
|
|
16
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* Inset from the chosen corner in CSS pixels. Default: {@link GEOMETRA_STACKED_HOST_LAYOUT_DEFAULTS.geometraHudMargin}.
|
|
38
|
+
* Non-finite or negative values fall back to the default.
|
|
39
|
+
*/
|
|
17
40
|
geometraHudMargin?: number;
|
|
18
41
|
/**
|
|
19
42
|
* CSS `pointer-events` on the HUD wrapper (e.g. `'none'` so input falls through to the WebGL canvas).
|
|
20
|
-
* Default: `'auto'`.
|
|
43
|
+
* Default: `'auto'`. Blank or whitespace-only strings fall back to the default; use
|
|
44
|
+
* {@link coerceGeometraHudPointerEvents} in custom layouts for the same rules.
|
|
21
45
|
*/
|
|
22
46
|
geometraHudPointerEvents?: string;
|
|
47
|
+
/**
|
|
48
|
+
* CSS `z-index` on the HUD wrapper when you stack other siblings in {@link ThreeGeometraStackedHostOptions.container}
|
|
49
|
+
* or need a fixed order above the WebGL layer (Three canvas uses `0`). Default: `1`.
|
|
50
|
+
* Non-finite numbers and blank/whitespace-only strings fall back to the default so the HUD keeps a predictable stack order.
|
|
51
|
+
*/
|
|
52
|
+
geometraHudZIndex?: string | number;
|
|
53
|
+
/**
|
|
54
|
+
* Upper bound for `window.devicePixelRatio` when sizing the WebGL drawing buffer (e.g. `2` on retina
|
|
55
|
+
* to cut memory and fragment cost). When omitted, the full device pixel ratio is used.
|
|
56
|
+
*/
|
|
57
|
+
maxDevicePixelRatio?: number;
|
|
23
58
|
/**
|
|
24
59
|
* Called once after scene, camera, and renderer are created.
|
|
25
60
|
* Call `ctx.destroy()` to tear down immediately; the render loop will not start if the host is already destroyed.
|
|
61
|
+
* If this callback throws, the host is fully torn down and the error is rethrown.
|
|
26
62
|
*/
|
|
27
63
|
onThreeReady?: (ctx: ThreeRuntimeContext) => void;
|
|
28
64
|
/**
|
|
29
65
|
* Called every frame before `renderer.render`.
|
|
66
|
+
* Return **`false`** to skip `render` for this frame only (same idea as
|
|
67
|
+
* {@link tickGeometraThreeWebGLWithSceneBasicsFrame}). If you call {@link ThreeRuntimeContext.destroy} here,
|
|
68
|
+
* teardown runs and this frame’s `render` is skipped.
|
|
69
|
+
* If this callback throws, the host is fully torn down and the error is rethrown (same as {@link onThreeReady}).
|
|
30
70
|
*/
|
|
31
|
-
onThreeFrame?: (ctx: ThreeFrameContext) => void;
|
|
71
|
+
onThreeFrame?: (ctx: ThreeFrameContext) => void | false;
|
|
32
72
|
}
|
|
33
73
|
export interface ThreeGeometraStackedHostHandle {
|
|
34
74
|
root: HTMLDivElement;
|
|
@@ -41,19 +81,29 @@ export interface ThreeGeometraStackedHostHandle {
|
|
|
41
81
|
camera: THREE.PerspectiveCamera;
|
|
42
82
|
clock: THREE.Clock;
|
|
43
83
|
geometra: BrowserCanvasClientHandle;
|
|
84
|
+
/**
|
|
85
|
+
* Stops the render loop, tears down WebGL via {@link disposeGeometraThreeWebGLWithSceneBasics} (clock stop +
|
|
86
|
+
* the same renderer registration headless {@link renderGeometraThreeWebGLWithSceneBasicsFrame} /
|
|
87
|
+
* {@link tickGeometraThreeWebGLWithSceneBasicsFrame} use to skip draws after dispose), disconnects observers,
|
|
88
|
+
* and tears down the Geometra client.
|
|
89
|
+
*/
|
|
44
90
|
destroy(): void;
|
|
45
91
|
}
|
|
46
92
|
/**
|
|
47
93
|
* Stacked host: full-viewport Three.js `WebGLRenderer` with a positioned Geometra canvas **HUD** on top.
|
|
48
94
|
*
|
|
49
95
|
* Pointer routing follows normal hit-testing: events hit the Geometra canvas where it overlaps the WebGL layer
|
|
50
|
-
* (`z-index` above the Three canvas); elsewhere, the Three canvas receives input. Override with
|
|
51
|
-
* {@link ThreeGeometraStackedHostOptions.geometraHudPointerEvents} (e.g. `'none'` for a click-through HUD)
|
|
96
|
+
* (HUD `z-index` above the Three canvas, which uses `0`); elsewhere, the Three canvas receives input. Override with
|
|
97
|
+
* {@link ThreeGeometraStackedHostOptions.geometraHudPointerEvents} (e.g. `'none'` for a click-through HUD) or
|
|
98
|
+
* {@link ThreeGeometraStackedHostOptions.geometraHudZIndex} when you add other positioned siblings.
|
|
52
99
|
*
|
|
53
100
|
* Geometra’s client still uses `resizeTarget: window` by default; when only the HUD box changes size,
|
|
54
101
|
* a coalesced synthetic `resize` is dispatched on `window` (same pattern as {@link createThreeGeometraSplitHost}).
|
|
102
|
+
* `ResizeObserver` callbacks and real `window` `resize` share one rAF-coalesced Three.js buffer pass; the
|
|
103
|
+
* synthetic `resize` is emitted only from observer-driven layout changes, not from real window resizes.
|
|
55
104
|
* The Three.js layer listens to `window` `resize` for `devicePixelRatio` changes and uses the host `root` size
|
|
56
|
-
* for the drawing buffer.
|
|
105
|
+
* for the drawing buffer. Optional {@link ThreeGeometraStackedHostOptions.maxDevicePixelRatio} caps the ratio
|
|
106
|
+
* used for the WebGL buffer.
|
|
57
107
|
*/
|
|
58
108
|
export declare function createThreeGeometraStackedHost(options: ThreeGeometraStackedHostOptions): ThreeGeometraStackedHostHandle;
|
|
59
109
|
//# sourceMappingURL=stacked-host.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stacked-host.d.ts","sourceRoot":"","sources":["../src/stacked-host.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAEL,KAAK,yBAAyB,
|
|
1
|
+
{"version":3,"file":"stacked-host.d.ts","sourceRoot":"","sources":["../src/stacked-host.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAEL,KAAK,yBAAyB,EAC/B,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EACV,sCAAsC,EACtC,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAIL,KAAK,+BAA+B,EACrC,MAAM,yBAAyB,CAAA;AAEhC,OAAO,EAKL,KAAK,oBAAoB,EAC1B,MAAM,sBAAsB,CAAA;AAG7B,YAAY,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAEhE;;;GAGG;AACH,eAAO,MAAM,qCAAqC;;;;;CAUjD,CAAA;AAED,MAAM,WAAW,+BACf,SAAQ,sCAAsC,EA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from 'three';
|
|
2
1
|
import { createBrowserCanvasClient, } from '@geometra/renderer-canvas';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { GEOMETRA_THREE_HOST_SCENE_DEFAULTS, createGeometraThreeWebGLWithSceneBasics, disposeGeometraThreeWebGLWithSceneBasics, } from './three-scene-basics.js';
|
|
3
|
+
import { createGeometraHostLayoutSyncRaf } from './layout-sync.js';
|
|
4
|
+
import { coerceGeometraHudPlacement, coerceGeometraHudPointerEvents, coerceHostNonNegativeCssPx, coerceHostStackingZIndexCss, } from './host-css-coerce.js';
|
|
5
|
+
import { resizeGeometraThreePerspectiveView, resolveHostDevicePixelRatio } from './utils.js';
|
|
6
|
+
/**
|
|
7
|
+
* Default HUD width, height, corner, and margin for {@link createThreeGeometraStackedHost}; same as
|
|
8
|
+
* those option fallbacks and README.
|
|
9
|
+
*/
|
|
10
|
+
export const GEOMETRA_STACKED_HOST_LAYOUT_DEFAULTS = {
|
|
11
|
+
geometraHudWidth: 420,
|
|
12
|
+
geometraHudHeight: 320,
|
|
13
|
+
geometraHudPlacement: 'bottom-right',
|
|
14
|
+
geometraHudMargin: 12,
|
|
15
|
+
};
|
|
5
16
|
function fullSizeCanvas(canvas) {
|
|
6
17
|
canvas.style.display = 'block';
|
|
7
18
|
canvas.style.width = '100%';
|
|
@@ -36,16 +47,25 @@ function applyHudPlacement(wrap, placement, marginPx) {
|
|
|
36
47
|
* Stacked host: full-viewport Three.js `WebGLRenderer` with a positioned Geometra canvas **HUD** on top.
|
|
37
48
|
*
|
|
38
49
|
* Pointer routing follows normal hit-testing: events hit the Geometra canvas where it overlaps the WebGL layer
|
|
39
|
-
* (`z-index` above the Three canvas); elsewhere, the Three canvas receives input. Override with
|
|
40
|
-
* {@link ThreeGeometraStackedHostOptions.geometraHudPointerEvents} (e.g. `'none'` for a click-through HUD)
|
|
50
|
+
* (HUD `z-index` above the Three canvas, which uses `0`); elsewhere, the Three canvas receives input. Override with
|
|
51
|
+
* {@link ThreeGeometraStackedHostOptions.geometraHudPointerEvents} (e.g. `'none'` for a click-through HUD) or
|
|
52
|
+
* {@link ThreeGeometraStackedHostOptions.geometraHudZIndex} when you add other positioned siblings.
|
|
41
53
|
*
|
|
42
54
|
* Geometra’s client still uses `resizeTarget: window` by default; when only the HUD box changes size,
|
|
43
55
|
* a coalesced synthetic `resize` is dispatched on `window` (same pattern as {@link createThreeGeometraSplitHost}).
|
|
56
|
+
* `ResizeObserver` callbacks and real `window` `resize` share one rAF-coalesced Three.js buffer pass; the
|
|
57
|
+
* synthetic `resize` is emitted only from observer-driven layout changes, not from real window resizes.
|
|
44
58
|
* The Three.js layer listens to `window` `resize` for `devicePixelRatio` changes and uses the host `root` size
|
|
45
|
-
* for the drawing buffer.
|
|
59
|
+
* for the drawing buffer. Optional {@link ThreeGeometraStackedHostOptions.maxDevicePixelRatio} caps the ratio
|
|
60
|
+
* used for the WebGL buffer.
|
|
46
61
|
*/
|
|
47
62
|
export function createThreeGeometraStackedHost(options) {
|
|
48
|
-
const { container, geometraHudWidth =
|
|
63
|
+
const { container, geometraHudWidth: geometraHudWidthOpt = GEOMETRA_STACKED_HOST_LAYOUT_DEFAULTS.geometraHudWidth, geometraHudHeight: geometraHudHeightOpt = GEOMETRA_STACKED_HOST_LAYOUT_DEFAULTS.geometraHudHeight, geometraHudPlacement: geometraHudPlacementOpt = GEOMETRA_STACKED_HOST_LAYOUT_DEFAULTS.geometraHudPlacement, geometraHudMargin: geometraHudMarginOpt = GEOMETRA_STACKED_HOST_LAYOUT_DEFAULTS.geometraHudMargin, geometraHudPointerEvents: geometraHudPointerEventsOpt = 'auto', geometraHudZIndex = 1, maxDevicePixelRatio, threeBackground = GEOMETRA_THREE_HOST_SCENE_DEFAULTS.threeBackground, cameraFov = GEOMETRA_THREE_HOST_SCENE_DEFAULTS.cameraFov, cameraNear = GEOMETRA_THREE_HOST_SCENE_DEFAULTS.cameraNear, cameraFar = GEOMETRA_THREE_HOST_SCENE_DEFAULTS.cameraFar, cameraPosition = GEOMETRA_THREE_HOST_SCENE_DEFAULTS.cameraPosition, onThreeReady, onThreeFrame, window: providedWindow, ...browserOptions } = options;
|
|
64
|
+
const geometraHudWidth = coerceHostNonNegativeCssPx(geometraHudWidthOpt, GEOMETRA_STACKED_HOST_LAYOUT_DEFAULTS.geometraHudWidth);
|
|
65
|
+
const geometraHudHeight = coerceHostNonNegativeCssPx(geometraHudHeightOpt, GEOMETRA_STACKED_HOST_LAYOUT_DEFAULTS.geometraHudHeight);
|
|
66
|
+
const geometraHudMargin = coerceHostNonNegativeCssPx(geometraHudMarginOpt, GEOMETRA_STACKED_HOST_LAYOUT_DEFAULTS.geometraHudMargin);
|
|
67
|
+
const geometraHudPlacement = coerceGeometraHudPlacement(geometraHudPlacementOpt, GEOMETRA_STACKED_HOST_LAYOUT_DEFAULTS.geometraHudPlacement);
|
|
68
|
+
const geometraHudPointerEvents = coerceGeometraHudPointerEvents(geometraHudPointerEventsOpt, 'auto');
|
|
49
69
|
const doc = container.ownerDocument;
|
|
50
70
|
const win = providedWindow ?? doc.defaultView;
|
|
51
71
|
if (!win) {
|
|
@@ -70,7 +90,7 @@ export function createThreeGeometraStackedHost(options) {
|
|
|
70
90
|
root.appendChild(threeCanvas);
|
|
71
91
|
const geometraHud = doc.createElement('div');
|
|
72
92
|
geometraHud.style.position = 'absolute';
|
|
73
|
-
geometraHud.style.zIndex =
|
|
93
|
+
geometraHud.style.zIndex = coerceHostStackingZIndexCss(geometraHudZIndex, 1);
|
|
74
94
|
geometraHud.style.width = `${geometraHudWidth}px`;
|
|
75
95
|
geometraHud.style.height = `${geometraHudHeight}px`;
|
|
76
96
|
geometraHud.style.minWidth = '0';
|
|
@@ -82,12 +102,7 @@ export function createThreeGeometraStackedHost(options) {
|
|
|
82
102
|
const geometraCanvas = doc.createElement('canvas');
|
|
83
103
|
fullSizeCanvas(geometraCanvas);
|
|
84
104
|
geometraHud.appendChild(geometraCanvas);
|
|
85
|
-
const glRenderer =
|
|
86
|
-
canvas: threeCanvas,
|
|
87
|
-
antialias: true,
|
|
88
|
-
alpha: false,
|
|
89
|
-
});
|
|
90
|
-
const { scene, camera, clock } = createGeometraThreeSceneBasics({
|
|
105
|
+
const { renderer: glRenderer, scene, camera, clock } = createGeometraThreeWebGLWithSceneBasics(threeCanvas, {
|
|
91
106
|
threeBackground,
|
|
92
107
|
cameraFov,
|
|
93
108
|
cameraNear,
|
|
@@ -95,38 +110,46 @@ export function createThreeGeometraStackedHost(options) {
|
|
|
95
110
|
cameraPosition,
|
|
96
111
|
});
|
|
97
112
|
const resizeThree = () => {
|
|
98
|
-
resizeGeometraThreePerspectiveView(glRenderer, camera, root.clientWidth, root.clientHeight, win.devicePixelRatio || 1);
|
|
113
|
+
resizeGeometraThreePerspectiveView(glRenderer, camera, root.clientWidth, root.clientHeight, resolveHostDevicePixelRatio(win.devicePixelRatio || 1, maxDevicePixelRatio));
|
|
99
114
|
};
|
|
115
|
+
let destroyed = false;
|
|
116
|
+
const layoutSync = createGeometraHostLayoutSyncRaf(win, {
|
|
117
|
+
isDestroyed: () => destroyed,
|
|
118
|
+
syncLayout: resizeThree,
|
|
119
|
+
dispatchGeometraResize: () => {
|
|
120
|
+
win.dispatchEvent(new Event('resize'));
|
|
121
|
+
},
|
|
122
|
+
});
|
|
100
123
|
const onWindowResize = () => {
|
|
101
|
-
|
|
124
|
+
layoutSync.schedule(false);
|
|
102
125
|
};
|
|
103
126
|
win.addEventListener('resize', onWindowResize, { passive: true });
|
|
104
127
|
resizeThree();
|
|
105
|
-
const geometraHandle =
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
128
|
+
const geometraHandle = (() => {
|
|
129
|
+
try {
|
|
130
|
+
return createBrowserCanvasClient({
|
|
131
|
+
...browserOptions,
|
|
132
|
+
canvas: geometraCanvas,
|
|
133
|
+
window: win,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
catch (err) {
|
|
137
|
+
layoutSync.cancel();
|
|
138
|
+
win.removeEventListener('resize', onWindowResize);
|
|
139
|
+
disposeGeometraThreeWebGLWithSceneBasics({ renderer: glRenderer, clock });
|
|
140
|
+
root.remove();
|
|
141
|
+
throw err;
|
|
142
|
+
}
|
|
143
|
+
})();
|
|
119
144
|
const roRoot = new ResizeObserver(() => {
|
|
120
|
-
|
|
121
|
-
triggerGeometraResize();
|
|
145
|
+
layoutSync.schedule(true);
|
|
122
146
|
});
|
|
123
147
|
roRoot.observe(root);
|
|
124
148
|
const roHud = new ResizeObserver(() => {
|
|
125
|
-
|
|
149
|
+
layoutSync.schedule(true);
|
|
126
150
|
});
|
|
127
151
|
roHud.observe(geometraHud);
|
|
128
152
|
let rafId;
|
|
129
|
-
let destroyed = false;
|
|
130
153
|
const destroy = () => {
|
|
131
154
|
if (destroyed)
|
|
132
155
|
return;
|
|
@@ -135,15 +158,12 @@ export function createThreeGeometraStackedHost(options) {
|
|
|
135
158
|
win.cancelAnimationFrame(rafId);
|
|
136
159
|
rafId = undefined;
|
|
137
160
|
}
|
|
138
|
-
|
|
139
|
-
win.cancelAnimationFrame(geometraResizeRafId);
|
|
140
|
-
geometraResizeRafId = undefined;
|
|
141
|
-
}
|
|
161
|
+
layoutSync.cancel();
|
|
142
162
|
win.removeEventListener('resize', onWindowResize);
|
|
143
163
|
roRoot.disconnect();
|
|
144
164
|
roHud.disconnect();
|
|
145
165
|
geometraHandle.destroy();
|
|
146
|
-
glRenderer
|
|
166
|
+
disposeGeometraThreeWebGLWithSceneBasics({ renderer: glRenderer, clock });
|
|
147
167
|
root.remove();
|
|
148
168
|
};
|
|
149
169
|
const ctxBase = {
|
|
@@ -153,14 +173,30 @@ export function createThreeGeometraStackedHost(options) {
|
|
|
153
173
|
threeCanvas,
|
|
154
174
|
destroy,
|
|
155
175
|
};
|
|
156
|
-
|
|
176
|
+
try {
|
|
177
|
+
onThreeReady?.(ctxBase);
|
|
178
|
+
}
|
|
179
|
+
catch (err) {
|
|
180
|
+
destroy();
|
|
181
|
+
throw err;
|
|
182
|
+
}
|
|
157
183
|
const loop = () => {
|
|
158
184
|
if (destroyed)
|
|
159
185
|
return;
|
|
160
186
|
rafId = win.requestAnimationFrame(loop);
|
|
161
187
|
const delta = clock.getDelta();
|
|
162
188
|
const elapsed = clock.elapsedTime;
|
|
163
|
-
|
|
189
|
+
try {
|
|
190
|
+
if (onThreeFrame?.({ ...ctxBase, clock, delta, elapsed }) === false) {
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
catch (err) {
|
|
195
|
+
destroy();
|
|
196
|
+
throw err;
|
|
197
|
+
}
|
|
198
|
+
if (destroyed)
|
|
199
|
+
return;
|
|
164
200
|
glRenderer.render(scene, camera);
|
|
165
201
|
};
|
|
166
202
|
if (!destroyed) {
|
package/dist/stacked-host.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stacked-host.js","sourceRoot":"","sources":["../src/stacked-host.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stacked-host.js","sourceRoot":"","sources":["../src/stacked-host.ts"],"names":[],"mappings":"AACA,OAAO,EACL,yBAAyB,GAE1B,MAAM,2BAA2B,CAAA;AAMlC,OAAO,EACL,kCAAkC,EAClC,uCAAuC,EACvC,wCAAwC,GAEzC,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,+BAA+B,EAAE,MAAM,kBAAkB,CAAA;AAClE,OAAO,EACL,0BAA0B,EAC1B,8BAA8B,EAC9B,0BAA0B,EAC1B,2BAA2B,GAE5B,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,kCAAkC,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAA;AAI5F;;;GAGG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAAG;IACnD,gBAAgB,EAAE,GAAG;IACrB,i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