@ifc-lite/renderer 1.49.1 → 2.0.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/README.md +4 -0
- package/dist/camera-animation.d.ts.map +1 -1
- package/dist/camera-animation.js +37 -27
- package/dist/camera-animation.js.map +1 -1
- package/dist/camera-controls.d.ts +26 -15
- package/dist/camera-controls.d.ts.map +1 -1
- package/dist/camera-controls.js +32 -18
- package/dist/camera-controls.js.map +1 -1
- package/dist/camera-framing.d.ts +60 -21
- package/dist/camera-framing.d.ts.map +1 -1
- package/dist/camera-framing.js +168 -131
- package/dist/camera-framing.js.map +1 -1
- package/dist/camera-preset-view.d.ts +2 -2
- package/dist/camera-preset-view.d.ts.map +1 -1
- package/dist/camera-preset-view.js +52 -42
- package/dist/camera-preset-view.js.map +1 -1
- package/dist/camera.d.ts +50 -6
- package/dist/camera.d.ts.map +1 -1
- package/dist/camera.js +113 -13
- package/dist/camera.js.map +1 -1
- package/dist/device.d.ts +11 -0
- package/dist/device.d.ts.map +1 -1
- package/dist/device.js +71 -5
- package/dist/device.js.map +1 -1
- package/dist/federation-registry.d.ts.map +1 -1
- package/dist/federation-registry.js +19 -2
- package/dist/federation-registry.js.map +1 -1
- package/dist/frame-timing-cpu.d.ts +31 -0
- package/dist/frame-timing-cpu.d.ts.map +1 -0
- package/dist/frame-timing-cpu.js +25 -0
- package/dist/frame-timing-cpu.js.map +1 -0
- package/dist/frame-timing-gpu.d.ts +144 -0
- package/dist/frame-timing-gpu.d.ts.map +1 -0
- package/dist/frame-timing-gpu.js +176 -0
- package/dist/frame-timing-gpu.js.map +1 -0
- package/dist/frame-timing-stats.d.ts +100 -0
- package/dist/frame-timing-stats.d.ts.map +1 -0
- package/dist/frame-timing-stats.js +116 -0
- package/dist/frame-timing-stats.js.map +1 -0
- package/dist/frame-timing.d.ts +102 -0
- package/dist/frame-timing.d.ts.map +1 -0
- package/dist/frame-timing.js +112 -0
- package/dist/frame-timing.js.map +1 -0
- package/dist/index.d.ts +77 -59
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +272 -73
- package/dist/index.js.map +1 -1
- package/dist/instanced-override-color.d.ts +17 -0
- package/dist/instanced-override-color.d.ts.map +1 -0
- package/dist/instanced-override-color.js +22 -0
- package/dist/instanced-override-color.js.map +1 -0
- package/dist/instanced-render.d.ts +10 -0
- package/dist/instanced-render.d.ts.map +1 -1
- package/dist/instanced-render.js +13 -3
- package/dist/instanced-render.js.map +1 -1
- package/dist/lod-simplify.d.ts +0 -9
- package/dist/lod-simplify.d.ts.map +1 -1
- package/dist/lod-simplify.js +45 -7
- package/dist/lod-simplify.js.map +1 -1
- package/dist/pick-resolve.d.ts +125 -0
- package/dist/pick-resolve.d.ts.map +1 -0
- package/dist/pick-resolve.js +127 -0
- package/dist/pick-resolve.js.map +1 -0
- package/dist/picker.d.ts.map +1 -1
- package/dist/picker.js +20 -46
- package/dist/picker.js.map +1 -1
- package/dist/picking-manager.d.ts.map +1 -1
- package/dist/picking-manager.js +13 -1
- package/dist/picking-manager.js.map +1 -1
- package/dist/pipeline.d.ts +16 -0
- package/dist/pipeline.d.ts.map +1 -1
- package/dist/pipeline.js +89 -3
- package/dist/pipeline.js.map +1 -1
- package/dist/pointcloud/point-cloud-spatial-index.d.ts +81 -9
- package/dist/pointcloud/point-cloud-spatial-index.d.ts.map +1 -1
- package/dist/pointcloud/point-cloud-spatial-index.js +140 -29
- package/dist/pointcloud/point-cloud-spatial-index.js.map +1 -1
- package/dist/raycast-engine.d.ts +4 -4
- package/dist/raycast-engine.d.ts.map +1 -1
- package/dist/raycast-engine.js +10 -3
- package/dist/raycast-engine.js.map +1 -1
- package/dist/renderer-overlays.d.ts +3 -21
- package/dist/renderer-overlays.d.ts.map +1 -1
- package/dist/renderer-overlays.js +57 -85
- package/dist/renderer-overlays.js.map +1 -1
- package/dist/renderer-symbolic-overlays.d.ts +29 -2
- package/dist/renderer-symbolic-overlays.d.ts.map +1 -1
- package/dist/renderer-symbolic-overlays.js +61 -16
- package/dist/renderer-symbolic-overlays.js.map +1 -1
- package/dist/scene-contents.d.ts +132 -0
- package/dist/scene-contents.d.ts.map +1 -0
- package/dist/scene-contents.js +5 -0
- package/dist/scene-contents.js.map +1 -0
- package/dist/scene-raycaster.d.ts +14 -8
- package/dist/scene-raycaster.d.ts.map +1 -1
- package/dist/scene-raycaster.js +6 -2
- package/dist/scene-raycaster.js.map +1 -1
- package/dist/scene.d.ts.map +1 -1
- package/dist/scene.js +63 -12
- package/dist/scene.js.map +1 -1
- package/dist/section-2d-overlay.d.ts +52 -63
- package/dist/section-2d-overlay.d.ts.map +1 -1
- package/dist/section-2d-overlay.js +75 -133
- package/dist/section-2d-overlay.js.map +1 -1
- package/dist/section-plane.d.ts +11 -0
- package/dist/section-plane.d.ts.map +1 -1
- package/dist/section-plane.js.map +1 -1
- package/dist/shaders/main.wgsl.d.ts +1 -1
- package/dist/shaders/main.wgsl.d.ts.map +1 -1
- package/dist/shaders/main.wgsl.js +87 -4
- package/dist/shaders/main.wgsl.js.map +1 -1
- package/dist/shaders/section-2d-overlay.wgsl.d.ts +2 -2
- package/dist/shaders/section-2d-overlay.wgsl.d.ts.map +1 -1
- package/dist/shaders/section-2d-overlay.wgsl.js +2 -2
- package/dist/shaders/section-2d-overlay.wgsl.js.map +1 -1
- package/dist/shaders/shadow.wgsl.d.ts +31 -0
- package/dist/shaders/shadow.wgsl.d.ts.map +1 -0
- package/dist/shaders/shadow.wgsl.js +141 -0
- package/dist/shaders/shadow.wgsl.js.map +1 -0
- package/dist/shadow-light-matrix.d.ts +106 -0
- package/dist/shadow-light-matrix.d.ts.map +1 -0
- package/dist/shadow-light-matrix.js +185 -0
- package/dist/shadow-light-matrix.js.map +1 -0
- package/dist/shadow-occluders.d.ts +106 -0
- package/dist/shadow-occluders.d.ts.map +1 -0
- package/dist/shadow-occluders.js +156 -0
- package/dist/shadow-occluders.js.map +1 -0
- package/dist/shadow-pass.d.ts +132 -0
- package/dist/shadow-pass.d.ts.map +1 -0
- package/dist/shadow-pass.js +342 -0
- package/dist/shadow-pass.js.map +1 -0
- package/dist/snap-detector.d.ts +10 -0
- package/dist/snap-detector.d.ts.map +1 -1
- package/dist/snap-detector.js.map +1 -1
- package/dist/symbolic-overlay-pipelines.d.ts +34 -0
- package/dist/symbolic-overlay-pipelines.d.ts.map +1 -1
- package/dist/symbolic-overlay-pipelines.js +31 -20
- package/dist/symbolic-overlay-pipelines.js.map +1 -1
- package/dist/types.d.ts +45 -19
- package/dist/types.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -2,12 +2,40 @@
|
|
|
2
2
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
3
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
4
|
import { SectionPlaneRenderer } from './section-plane.js';
|
|
5
|
-
import { Section2DOverlayRenderer } from './section-2d-overlay.js';
|
|
5
|
+
import { Section2DOverlayRenderer, LINE_OVERLAY_CHANNELS, } from './section-2d-overlay.js';
|
|
6
6
|
import { SymbolicOverlays } from './renderer-symbolic-overlays.js';
|
|
7
7
|
import { ClashSolidPipeline } from './clash-solid-pipeline.js';
|
|
8
8
|
import { aabbEdgeLineList } from './aabb-edges.js';
|
|
9
9
|
import { projectedBoundsRange } from './render-section-plane.js';
|
|
10
10
|
import { drawSectionOverlays } from './render-section-draw.js';
|
|
11
|
+
/**
|
|
12
|
+
* Whether setting a channel grows the scene AABB.
|
|
13
|
+
*
|
|
14
|
+
* The one behavioural difference between the four channels, and the reason
|
|
15
|
+
* `setLineOverlay` is a table lookup rather than a plain forward. The
|
|
16
|
+
* per-channel rationale is on `Renderer.setLineOverlay`, which is what
|
|
17
|
+
* consumers read in the emitted `.d.ts`; it is not repeated here.
|
|
18
|
+
*
|
|
19
|
+
* The rule is "does this content DEFINE the model's extent, so that a file
|
|
20
|
+
* containing only it must still be framable". It is NOT "is it behind a
|
|
21
|
+
* visibility toggle" — annotations sit behind `ifcAnnotationsVisible` too and
|
|
22
|
+
* they DO expand. Anyone adding a fifth channel should answer the first
|
|
23
|
+
* question, not the second.
|
|
24
|
+
*
|
|
25
|
+
* Known gap, pre-dating this table: `useSymbolicAnnotations` lifts IfcGrid
|
|
26
|
+
* geometry into the SAME buffer as the IfcAnnotation curves, so an
|
|
27
|
+
* annotations-off / grid-on session reaches `annotation` carrying only grid
|
|
28
|
+
* lines, which then expand the bounds that `grid: false` exists to protect.
|
|
29
|
+
* The table is keyed by channel; the policy really wants to be keyed by
|
|
30
|
+
* content. Routing that lift into the `grid` channel is the fix and is a
|
|
31
|
+
* change of its own, tracked as #3359.
|
|
32
|
+
*/
|
|
33
|
+
const CHANNEL_EXPANDS_MODEL_BOUNDS = {
|
|
34
|
+
annotation: true,
|
|
35
|
+
alignment: true,
|
|
36
|
+
grid: false,
|
|
37
|
+
dxf: false,
|
|
38
|
+
};
|
|
11
39
|
export class RendererOverlays {
|
|
12
40
|
host;
|
|
13
41
|
sectionPlaneRenderer = null;
|
|
@@ -65,20 +93,19 @@ export class RendererOverlays {
|
|
|
65
93
|
// Order: fills (background) → lines (outlines on top) →
|
|
66
94
|
// texts (labels above everything).
|
|
67
95
|
this.symbolic.drawFills(pass, viewProj);
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
this.section2DOverlayRenderer.drawClashBoxLines3D(pass, viewProj);
|
|
96
|
+
// `LINE_OVERLAY_CHANNELS` is in draw order: annotation, alignment,
|
|
97
|
+
// grid, DXF. All four share the overlay colour and the line pipeline,
|
|
98
|
+
// so the order only decides who wins a depth tie.
|
|
99
|
+
const overlay = this.section2DOverlayRenderer;
|
|
100
|
+
if (overlay) {
|
|
101
|
+
for (const channel of LINE_OVERLAY_CHANNELS) {
|
|
102
|
+
if (overlay.hasLineOverlay(channel)) {
|
|
103
|
+
overlay.drawLineOverlay(pass, viewProj, channel);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
if (overlay.hasClashBoxLines3D()) {
|
|
107
|
+
overlay.drawClashBoxLines3D(pass, viewProj);
|
|
108
|
+
}
|
|
82
109
|
}
|
|
83
110
|
// Drawn after the box/contact lines and — crucially — after every
|
|
84
111
|
// ghosted (depth-non-writing) element in the main pass, so the true
|
|
@@ -97,7 +124,7 @@ export class RendererOverlays {
|
|
|
97
124
|
// overlay geometry has to request a frame or the new drawing only
|
|
98
125
|
// appears when something unrelated next dirties the viewport (#2442).
|
|
99
126
|
// The two early returns below leave the geometry untouched, so they
|
|
100
|
-
// correctly ask for nothing — matching `
|
|
127
|
+
// correctly ask for nothing — matching `setLineOverlay` before init.
|
|
101
128
|
if (!this.section2DOverlayRenderer)
|
|
102
129
|
return;
|
|
103
130
|
if (customPlane) {
|
|
@@ -150,80 +177,25 @@ export class RendererOverlays {
|
|
|
150
177
|
this.section2DOverlayRenderer?.setOverlayLineColor(color);
|
|
151
178
|
this.host.requestRender();
|
|
152
179
|
}
|
|
153
|
-
/** See `Renderer.
|
|
154
|
-
|
|
180
|
+
/** See `Renderer.setLineOverlay` for the published contract. */
|
|
181
|
+
setLineOverlay(channel, vertices) {
|
|
155
182
|
if (!this.section2DOverlayRenderer)
|
|
156
183
|
return;
|
|
157
|
-
this.section2DOverlayRenderer.
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
// does the same thing.
|
|
166
|
-
this.host.expandModelBoundsWithFlatVertices(vertices, 3);
|
|
167
|
-
this.host.syncCameraSceneBounds();
|
|
168
|
-
this.host.requestRender();
|
|
169
|
-
}
|
|
170
|
-
/** See `Renderer.clearAnnotationLines3D` for the published contract. */
|
|
171
|
-
clearAnnotationLines3D() {
|
|
172
|
-
if (this.section2DOverlayRenderer) {
|
|
173
|
-
this.section2DOverlayRenderer.clearAnnotationLines3D();
|
|
174
|
-
this.host.requestRender();
|
|
184
|
+
this.section2DOverlayRenderer.setLineOverlay(channel, vertices);
|
|
185
|
+
if (vertices !== null && CHANNEL_EXPANDS_MODEL_BOUNDS[channel]) {
|
|
186
|
+
// Mirrors the point-cloud upload path (`addPointClouds`,
|
|
187
|
+
// `setPointClouds`): without `syncCameraSceneBounds` the frustum
|
|
188
|
+
// excludes the cluster and it is clipped away even when the camera
|
|
189
|
+
// points straight at it. See CHANNEL_EXPANDS_MODEL_BOUNDS.
|
|
190
|
+
this.host.expandModelBoundsWithFlatVertices(vertices, 3);
|
|
191
|
+
this.host.syncCameraSceneBounds();
|
|
175
192
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
return;
|
|
181
|
-
this.section2DOverlayRenderer.uploadAlignmentLines3D(vertices);
|
|
182
|
-
// Frame alignment-only files the same way annotation overlays are
|
|
183
|
-
// framed (see uploadAnnotationLines3D).
|
|
184
|
-
this.host.expandModelBoundsWithFlatVertices(vertices, 3);
|
|
185
|
-
this.host.syncCameraSceneBounds();
|
|
193
|
+
// Rendering is dirty-flag gated (#2442): a channel that changed has to
|
|
194
|
+
// ask for a frame or the change waits for something unrelated to
|
|
195
|
+
// dirty the viewport. Clearing counts as a change; a pre-init call
|
|
196
|
+
// returns above without asking, because it changed nothing.
|
|
186
197
|
this.host.requestRender();
|
|
187
198
|
}
|
|
188
|
-
/** See `Renderer.clearAlignmentLines3D` for the published contract. */
|
|
189
|
-
clearAlignmentLines3D() {
|
|
190
|
-
if (this.section2DOverlayRenderer) {
|
|
191
|
-
this.section2DOverlayRenderer.clearAlignmentLines3D();
|
|
192
|
-
this.host.requestRender();
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* See `Renderer.uploadGridLines3D` for the published contract. Unlike
|
|
197
|
-
* alignment, grids do NOT expand model bounds: they're behind a visibility
|
|
198
|
-
* toggle, so toggling them on must not reframe the camera.
|
|
199
|
-
*/
|
|
200
|
-
uploadGridLines3D(vertices) {
|
|
201
|
-
if (!this.section2DOverlayRenderer)
|
|
202
|
-
return;
|
|
203
|
-
this.section2DOverlayRenderer.uploadGridLines3D(vertices);
|
|
204
|
-
this.host.requestRender();
|
|
205
|
-
}
|
|
206
|
-
/** See `Renderer.clearGridLines3D` for the published contract. */
|
|
207
|
-
clearGridLines3D() {
|
|
208
|
-
if (this.section2DOverlayRenderer) {
|
|
209
|
-
this.section2DOverlayRenderer.clearGridLines3D();
|
|
210
|
-
this.host.requestRender();
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
/** See `Renderer.uploadDxfLines3D` for the published contract. */
|
|
214
|
-
uploadDxfLines3D(vertices) {
|
|
215
|
-
if (!this.section2DOverlayRenderer)
|
|
216
|
-
return;
|
|
217
|
-
this.section2DOverlayRenderer.uploadDxfLines3D(vertices);
|
|
218
|
-
this.host.requestRender();
|
|
219
|
-
}
|
|
220
|
-
/** See `Renderer.clearDxfLines3D` for the published contract. */
|
|
221
|
-
clearDxfLines3D() {
|
|
222
|
-
if (this.section2DOverlayRenderer) {
|
|
223
|
-
this.section2DOverlayRenderer.clearDxfLines3D();
|
|
224
|
-
this.host.requestRender();
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
199
|
/** See `Renderer.setClashOverlapBox` for the published contract. */
|
|
228
200
|
setClashOverlapBox(box) {
|
|
229
201
|
if (!this.section2DOverlayRenderer)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderer-overlays.js","sourceRoot":"","sources":["../src/renderer-overlays.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AA0C/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,
|
|
1
|
+
{"version":3,"file":"renderer-overlays.js","sourceRoot":"","sources":["../src/renderer-overlays.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AA0C/D,OAAO,EAAE,oBAAoB,EAAE,MA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uB,CAAC,KAAmC;QACvD,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;IAED,qEAAqE;IACrE,mBAAmB;QACf,OAAO,IAAI,CAAC,wBAAwB,EAAE,WAAW,EAAE,IAAI,KAAK,CAAC;IACjE,CAAC;CACJ"}
|
|
@@ -44,9 +44,36 @@ export declare class SymbolicOverlays {
|
|
|
44
44
|
drawFills(pass: GPURenderPassEncoder, viewProj: Float32Array): void;
|
|
45
45
|
/** Label layer: painted after everything else. */
|
|
46
46
|
drawTexts(pass: GPURenderPassEncoder, viewProj: Float32Array, canvasWidth: number, canvasHeight: number, camera: Camera): void;
|
|
47
|
-
/**
|
|
47
|
+
/**
|
|
48
|
+
* See `Renderer.uploadAnnotationFills3D` for the published contract.
|
|
49
|
+
*
|
|
50
|
+
* `definesExtent: false` draws the fill without letting it grow the scene
|
|
51
|
+
* AABB (#3359). This is the fill half of the policy `setLineOverlay` keys
|
|
52
|
+
* by channel: `grid` lines are excluded from the bounds because a grid is a
|
|
53
|
+
* reference layer that routinely reaches past the model envelope, and
|
|
54
|
+
* framing the camera on it is what #967 removed. Grid BUBBLES are fills and
|
|
55
|
+
* texts, not lines, so they never passed through that table at all — with
|
|
56
|
+
* annotations off and the grid on, a perfect line routing still reframed
|
|
57
|
+
* the camera on the bubbles, which sit a fixed offset beyond each axis
|
|
58
|
+
* endpoint (BUBBLE_OFFSET_M in rust/processing/src/symbolic/grid.rs) and
|
|
59
|
+
* are therefore the outermost grid content there is.
|
|
60
|
+
*
|
|
61
|
+
* Per ITEM rather than per call because `upload` REPLACES the whole array
|
|
62
|
+
* TODAY: these two pipelines each own one buffer, so one annotation call
|
|
63
|
+
* plus one grid call is not something a caller can currently do and the
|
|
64
|
+
* declaration has to travel with the item. That is a property of the
|
|
65
|
+
* present pipeline, not of the problem. The shape that removes this flag
|
|
66
|
+
* is a channel-keyed upload matching `setLineOverlay(channel, ...)`, which
|
|
67
|
+
* would answer from `CHANNEL_EXPANDS_MODEL_BOUNDS` alone; it needs
|
|
68
|
+
* per-channel buffers and a draw per channel, so it is deliberately not
|
|
69
|
+
* this change. Default true, so every caller that says nothing keeps the
|
|
70
|
+
* old behaviour exactly.
|
|
71
|
+
*/
|
|
48
72
|
uploadFills(fills: readonly SymbolicFillInput[]): void;
|
|
49
|
-
/**
|
|
73
|
+
/**
|
|
74
|
+
* See `Renderer.uploadAnnotationTexts3D` for the published contract, and
|
|
75
|
+
* `uploadFills` above for what `definesExtent: false` is for (#3359).
|
|
76
|
+
*/
|
|
50
77
|
uploadTexts(texts: readonly SymbolicTextInput[]): void;
|
|
51
78
|
}
|
|
52
79
|
//# sourceMappingURL=renderer-symbolic-overlays.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderer-symbolic-overlays.d.ts","sourceRoot":"","sources":["../src/renderer-symbolic-overlays.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAGH,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACzB,MAAM,iCAAiC,CAAC;AAEzC;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAChC,iCAAiC,CAAC,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACjF,qBAAqB,IAAI,IAAI,CAAC;IAC9B,aAAa,IAAI,IAAI,CAAC;CACzB;AAED,qBAAa,gBAAgB;IAIb,OAAO,CAAC,QAAQ,CAAC,IAAI;IAHjC,OAAO,CAAC,YAAY,CAAqC;IACzD,OAAO,CAAC,YAAY,CAAqC;gBAE5B,IAAI,EAAE,mBAAmB;IAEtD;;;;;OAKG;IACH,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI;IAK5E;;;;OAIG;IACH,OAAO,IAAI,IAAI;I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M,EACpB,MAAM,EAAE,MAAM,GACf,IAAI;IAqCP;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,WAAW,CAAC,KAAK,EAAE,SAAS,iBAAiB,EAAE,GAAG,IAAI;IA0BtD;;;OAGG;IACH,WAAW,CAAC,KAAK,EAAE,SAAS,iBAAiB,EAAE,GAAG,IAAI;CA0BzD"}
|
|
@@ -68,15 +68,39 @@ export class SymbolicOverlays {
|
|
|
68
68
|
const basis = viewBasis(camera.getPosition(), camera.getTarget(), camera.getUp());
|
|
69
69
|
this.textPipeline.render(pass, viewProj, canvasWidth, canvasHeight, [basis.right.x, basis.right.y, basis.right.z], [basis.up.x, basis.up.y, basis.up.z]);
|
|
70
70
|
}
|
|
71
|
-
/**
|
|
71
|
+
/**
|
|
72
|
+
* See `Renderer.uploadAnnotationFills3D` for the published contract.
|
|
73
|
+
*
|
|
74
|
+
* `definesExtent: false` draws the fill without letting it grow the scene
|
|
75
|
+
* AABB (#3359). This is the fill half of the policy `setLineOverlay` keys
|
|
76
|
+
* by channel: `grid` lines are excluded from the bounds because a grid is a
|
|
77
|
+
* reference layer that routinely reaches past the model envelope, and
|
|
78
|
+
* framing the camera on it is what #967 removed. Grid BUBBLES are fills and
|
|
79
|
+
* texts, not lines, so they never passed through that table at all — with
|
|
80
|
+
* annotations off and the grid on, a perfect line routing still reframed
|
|
81
|
+
* the camera on the bubbles, which sit a fixed offset beyond each axis
|
|
82
|
+
* endpoint (BUBBLE_OFFSET_M in rust/processing/src/symbolic/grid.rs) and
|
|
83
|
+
* are therefore the outermost grid content there is.
|
|
84
|
+
*
|
|
85
|
+
* Per ITEM rather than per call because `upload` REPLACES the whole array
|
|
86
|
+
* TODAY: these two pipelines each own one buffer, so one annotation call
|
|
87
|
+
* plus one grid call is not something a caller can currently do and the
|
|
88
|
+
* declaration has to travel with the item. That is a property of the
|
|
89
|
+
* present pipeline, not of the problem. The shape that removes this flag
|
|
90
|
+
* is a channel-keyed upload matching `setLineOverlay(channel, ...)`, which
|
|
91
|
+
* would answer from `CHANNEL_EXPANDS_MODEL_BOUNDS` alone; it needs
|
|
92
|
+
* per-channel buffers and a draw per channel, so it is deliberately not
|
|
93
|
+
* this change. Default true, so every caller that says nothing keeps the
|
|
94
|
+
* old behaviour exactly.
|
|
95
|
+
*/
|
|
72
96
|
uploadFills(fills) {
|
|
73
97
|
if (!this.fillPipeline)
|
|
74
98
|
return;
|
|
75
99
|
this.fillPipeline.upload(fills);
|
|
76
|
-
|
|
100
|
+
let expanded = false;
|
|
77
101
|
for (const fill of fills) {
|
|
78
102
|
const pts = fill.points;
|
|
79
|
-
if (pts.length === 0)
|
|
103
|
+
if (pts.length === 0 || fill.definesExtent === false)
|
|
80
104
|
continue;
|
|
81
105
|
// points are flat [x,z,x,z,...]; lift to (x, fill.worldY, z) per
|
|
82
106
|
// vertex so we expand bounds in the same world space the renderer draws in.
|
|
@@ -87,26 +111,47 @@ export class SymbolicOverlays {
|
|
|
87
111
|
lifted[j + 2] = pts[i + 1];
|
|
88
112
|
}
|
|
89
113
|
this.host.expandModelBoundsWithFlatVertices(lifted, 3);
|
|
114
|
+
expanded = true;
|
|
90
115
|
}
|
|
91
|
-
|
|
116
|
+
// Only re-fit the camera when something actually moved the bounds. The
|
|
117
|
+
// old code synced on every call including a clear, which pushed an
|
|
118
|
+
// unchanged AABB back at the camera; `setLineOverlay` has always been
|
|
119
|
+
// conditional this way.
|
|
120
|
+
if (expanded)
|
|
121
|
+
this.host.syncCameraSceneBounds();
|
|
92
122
|
this.host.requestRender();
|
|
93
123
|
}
|
|
94
|
-
/**
|
|
124
|
+
/**
|
|
125
|
+
* See `Renderer.uploadAnnotationTexts3D` for the published contract, and
|
|
126
|
+
* `uploadFills` above for what `definesExtent: false` is for (#3359).
|
|
127
|
+
*/
|
|
95
128
|
uploadTexts(texts) {
|
|
96
129
|
if (!this.textPipeline)
|
|
97
130
|
return;
|
|
98
131
|
this.textPipeline.upload(texts);
|
|
99
|
-
//
|
|
100
|
-
//
|
|
101
|
-
//
|
|
102
|
-
if (texts.length
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
132
|
+
// A clear allocates nothing. Main guarded this behind `texts.length > 0`
|
|
133
|
+
// and the rewrite lost it, which matters here: "every text waived" is
|
|
134
|
+
// this change's own scenario (annotations off, grid on).
|
|
135
|
+
if (texts.length === 0) {
|
|
136
|
+
this.host.requestRender();
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
// Text origins are single points. Written straight into a worst-case
|
|
140
|
+
// buffer and passed on as a subarray: filtering first would allocate a
|
|
141
|
+
// second array holding every framing text just to read its length, and
|
|
142
|
+
// annotation-heavy models push thousands.
|
|
143
|
+
const buf = new Float32Array(texts.length * 3);
|
|
144
|
+
let n = 0;
|
|
145
|
+
for (const t of texts) {
|
|
146
|
+
if (t.definesExtent === false)
|
|
147
|
+
continue;
|
|
148
|
+
buf[n * 3 + 0] = t.worldPos[0];
|
|
149
|
+
buf[n * 3 + 1] = t.worldPos[1];
|
|
150
|
+
buf[n * 3 + 2] = t.worldPos[2];
|
|
151
|
+
n++;
|
|
152
|
+
}
|
|
153
|
+
if (n > 0) {
|
|
154
|
+
this.host.expandModelBoundsWithFlatVertices(buf.subarray(0, n * 3), 3);
|
|
110
155
|
this.host.syncCameraSceneBounds();
|
|
111
156
|
}
|
|
112
157
|
this.host.requestRender();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderer-symbolic-overlays.js","sourceRoot":"","sources":["../src/renderer-symbolic-overlays.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAgB/D,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EACH,oBAAoB,EACpB,oBAAoB,GAGvB,MAAM,iCAAiC,CAAC;AAazC,MAAM,OAAO,gBAAgB;IAII;IAHrB,YAAY,GAAgC,IAAI,CAAC;IACjD,YAAY,GAAgC,IAAI,C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,CAAC,EAAE,CAAC,CAAC,CAAC;YACvE,IAAI,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC;QACtC,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;IAC9B,CAAC;CACJ"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `SceneContents` — the scene surface `Renderer.getScene()` hands across the
|
|
3
|
+
* package boundary.
|
|
4
|
+
*
|
|
5
|
+
* WHY THIS EXISTS: `getScene()` used to return the `Scene` class itself. `Scene`
|
|
6
|
+
* is 4400+ lines, so a consumer of `@ifc-lite/renderer` had to learn `Renderer`
|
|
7
|
+
* PLUS the whole of `Scene` — and every method added to `Scene` silently became
|
|
8
|
+
* published API. This interface freezes that leak at its measured width.
|
|
9
|
+
*
|
|
10
|
+
* HOW THE MEMBER LIST WAS CHOSEN: it is not a design sketch, it is a
|
|
11
|
+
* measurement. Every `renderer.getScene()` call site in `apps/viewer` and
|
|
12
|
+
* `apps/viewer-embed` was resolved with the TypeScript checker and the returned
|
|
13
|
+
* value followed through locals, class fields, object-literal properties,
|
|
14
|
+
* parameters and function returns until it was dereferenced; the members below
|
|
15
|
+
* are exactly the ones something outside `packages/renderer/src` reaches for.
|
|
16
|
+
*
|
|
17
|
+
* ADDING A MEMBER IS A DECISION, NOT A DETAIL. A new entry here is a new
|
|
18
|
+
* published API for `@ifc-lite/renderer` and cannot be taken back without a
|
|
19
|
+
* major bump. Add one when a caller genuinely needs it — not because `Scene`
|
|
20
|
+
* already has it.
|
|
21
|
+
*
|
|
22
|
+
* `Scene` is NOT declared `implements SceneContents`: an `implements` clause
|
|
23
|
+
* would let the class's own surface drift wider without the interface noticing,
|
|
24
|
+
* which is the thing this file exists to stop. The check that the class still
|
|
25
|
+
* satisfies this shape is the `return this.scene` in `Renderer.getScene()`.
|
|
26
|
+
*
|
|
27
|
+
* Be precise about what that catches, because it is less than it looks: a
|
|
28
|
+
* REMOVED member or an incompatible RETURN type. It does not catch a parameter
|
|
29
|
+
* turning required, because assignability checks arity rather than optionality,
|
|
30
|
+
* and method parameters stay bivariant even under `strict`. Five members here
|
|
31
|
+
* declare optional parameters (`getMeshDataPieces`, `appendToBatches`,
|
|
32
|
+
* `finalizeStreamingAsync`, `processResidencyRestores`, `addInstancedShard`)
|
|
33
|
+
* and are unguarded in that direction.
|
|
34
|
+
*
|
|
35
|
+
* `GPUDevice` and `RenderPipeline` stay concrete in these signatures on
|
|
36
|
+
* purpose. Callers never reach into either one; they take the handles from
|
|
37
|
+
* `getGPUDevice()` / `getPipeline()` and hand them straight back to the upload
|
|
38
|
+
* methods here. Replacing them with narrower stand-ins would only be honest if
|
|
39
|
+
* `Scene`'s own signatures were narrowed too, which is a different change.
|
|
40
|
+
*/
|
|
41
|
+
import type { Mesh, BatchedMesh } from './types.js';
|
|
42
|
+
import type { MeshData, DecodedInstancedShard } from '@ifc-lite/geometry';
|
|
43
|
+
import type { RenderPipeline } from './pipeline.js';
|
|
44
|
+
import type { BoundingBox } from './scene-raycaster.js';
|
|
45
|
+
import type { ResidentGpuBytes } from './render-stats.js';
|
|
46
|
+
import type { ColdGeometryProvider } from './residency.js';
|
|
47
|
+
import type { SpatialChunkingConfig } from './chunk-grid.js';
|
|
48
|
+
/** The measured external scene surface. See the module doc before widening. */
|
|
49
|
+
export interface SceneContents {
|
|
50
|
+
queueMeshes(meshes: MeshData[]): void;
|
|
51
|
+
hasQueuedMeshes(): boolean;
|
|
52
|
+
flushPending(device: GPUDevice, pipeline: RenderPipeline): boolean;
|
|
53
|
+
appendToBatches(meshDataArray: MeshData[], device: GPUDevice, pipeline: RenderPipeline, isStreaming?: boolean): void;
|
|
54
|
+
hasPendingBatches(): boolean;
|
|
55
|
+
rebuildPendingBatches(device: GPUDevice, pipeline: RenderPipeline): void;
|
|
56
|
+
hasStreamingFragments(): boolean;
|
|
57
|
+
finalizeStreaming(device: GPUDevice, pipeline: RenderPipeline): void;
|
|
58
|
+
finalizeStreamingAsync(device: GPUDevice, pipeline: RenderPipeline, budgetMs?: number): Promise<void>;
|
|
59
|
+
isFinalizeInProgress(): boolean;
|
|
60
|
+
setEphemeralStreamingMode(enabled: boolean): void;
|
|
61
|
+
isEphemeralStreaming(): boolean;
|
|
62
|
+
finishEphemeralStreaming(): void;
|
|
63
|
+
getMeshes(): Mesh[];
|
|
64
|
+
getBatchedMeshes(): BatchedMesh[];
|
|
65
|
+
getMeshDataPieces(expressId: number, modelIndex?: number): MeshData[] | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* O(1) "is this id in the flat mesh map" — the presence question, without
|
|
68
|
+
* `getMeshDataPieces`' per-entity extraction out of a colour-merged batch.
|
|
69
|
+
* Pair it with `isInstancedEntity` to ask the same thing of both geometry
|
|
70
|
+
* paths (`useColorOverlaySync` does, per settled geometry batch).
|
|
71
|
+
*/
|
|
72
|
+
hasMeshData(expressId: number, modelIndex?: number): boolean;
|
|
73
|
+
getAllMeshDataExpressIds(): number[];
|
|
74
|
+
getBounds(): {
|
|
75
|
+
min: {
|
|
76
|
+
x: number;
|
|
77
|
+
y: number;
|
|
78
|
+
z: number;
|
|
79
|
+
};
|
|
80
|
+
max: {
|
|
81
|
+
x: number;
|
|
82
|
+
y: number;
|
|
83
|
+
z: number;
|
|
84
|
+
};
|
|
85
|
+
} | null;
|
|
86
|
+
getEntityBoundingBox(expressId: number): BoundingBox | null;
|
|
87
|
+
addInstancedShard(device: GPUDevice, shard: DecodedInstancedShard, modelIndex?: number): void;
|
|
88
|
+
getAllInstancedMeshData(): MeshData[];
|
|
89
|
+
getInstancedMeshDataPieces(expressId: number): MeshData[] | undefined;
|
|
90
|
+
/**
|
|
91
|
+
* O(1) instanced-membership test. `getInstancedMeshDataPieces` MATERIALIZES
|
|
92
|
+
* world-space triangles per occurrence, so it is never the right way to ask
|
|
93
|
+
* whether an id exists.
|
|
94
|
+
*/
|
|
95
|
+
isInstancedEntity(expressId: number): boolean;
|
|
96
|
+
getInstancedEntityBounds(expressId: number): BoundingBox | null;
|
|
97
|
+
getInstancedEntityCount(): number;
|
|
98
|
+
getInstancedEntityIds(): IterableIterator<number>;
|
|
99
|
+
getInstancedModelIndices(): number[];
|
|
100
|
+
removeInstancedTemplatesForModel(modelIndex: number): number;
|
|
101
|
+
setInstancedVisible(visible: boolean): void;
|
|
102
|
+
removeMeshesForEntities(expressIds: Iterable<number>): number;
|
|
103
|
+
translateMeshesForEntities(updates: Map<number, [number, number, number]>): number;
|
|
104
|
+
rotateMeshesForEntities(updates: Map<number, {
|
|
105
|
+
angle: number;
|
|
106
|
+
pivot: [number, number, number];
|
|
107
|
+
}>): number;
|
|
108
|
+
setColorOverrides(overrides: Map<number, [number, number, number, number]>, device: GPUDevice, pipeline: RenderPipeline): void;
|
|
109
|
+
/**
|
|
110
|
+
* The overrides currently installed, or null when nothing is painted. The
|
|
111
|
+
* store's `pendingColorUpdates` is a one-shot signal that is nulled after it
|
|
112
|
+
* flushes, so this retained map is the only readable record of what is
|
|
113
|
+
* painted — `useColorOverlaySync` re-hands it back to `setColorOverrides` so
|
|
114
|
+
* meshes that streamed in after the flush get their colour (#3890).
|
|
115
|
+
*/
|
|
116
|
+
getColorOverrides(): ReadonlyMap<number, readonly [number, number, number, number]> | null;
|
|
117
|
+
clearColorOverrides(): void;
|
|
118
|
+
updateMeshColors(updates: Map<number, [number, number, number, number]>, device: GPUDevice, pipeline: RenderPipeline): void;
|
|
119
|
+
setSpatialChunking(config: SpatialChunkingConfig | null): void;
|
|
120
|
+
setLodBuildsEnabled(enabled: boolean): void;
|
|
121
|
+
setHostResidencyBudget(bytes: number | null): void;
|
|
122
|
+
setGpuResidencyBudget(bytes: number | null): void;
|
|
123
|
+
setColdGeometryProvider(provider: ColdGeometryProvider | null): void;
|
|
124
|
+
hasResidencyRestoreWork(): boolean;
|
|
125
|
+
processResidencyRestores(device: GPUDevice, pipeline: RenderPipeline, budgetMs?: number): number;
|
|
126
|
+
drainColdTier(): Promise<void>;
|
|
127
|
+
getResidentCpuBytes(): number;
|
|
128
|
+
getResidentGpuBytes(): ResidentGpuBytes;
|
|
129
|
+
clearFlatGeometry(): void;
|
|
130
|
+
clear(): void;
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=scene-contents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scene-contents.d.ts","sourceRoot":"","sources":["../src/scene-contents.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAE7D,+EAA+E;AAC/E,MAAM,WAAW,aAAa;IAE5B,WAAW,CAAC,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;IACtC,eAAe,IAAI,OAAO,CAAC;IAC3B,YAAY,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,cAAc,GAAG,OAAO,CAAC;IACnE,eAAe,CACb,aAAa,EAAE,QAAQ,EAAE,EACzB,MAAM,EAAE,SAAS,EACjB,QAAQ,EAAE,cAAc,EACxB,WAAW,CAAC,EAAE,OAAO,GACpB,IAAI,CAAC;IACR,iBAAiB,IAAI,OAAO,CAAC;IAC7B,qBAAqB,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAC;IACzE,qBAAqB,IAAI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C,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,EACtD,MAAM,EAAE,SAAS,EACjB,QAAQ,EAAE,cAAc,GACvB,IAAI,CAAC;IAGR,kBAAkB,CAAC,MAAM,EAAE,qBAAqB,GAAG,IAAI,GAAG,IAAI,CAAC;IAC/D,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IAC5C,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IACnD,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IAClD,uBAAuB,CAAC,QAAQ,EAAE,oBAAoB,GAAG,IAAI,GAAG,IAAI,CAAC;IACrE,uBAAuB,IAAI,OAAO,CAAC;IACnC,wBAAwB,CACtB,MAAM,EAAE,SAAS,EACjB,QAAQ,EAAE,cAAc,EACxB,QAAQ,CAAC,EAAE,MAAM,GAChB,MAAM,CAAC;IACV,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/B,mBAAmB,IAAI,MAAM,CAAC;IAC9B,mBAAmB,IAAI,gBAAgB,CAAC;IAGxC,iBAAiB,IAAI,IAAI,CAAC;IAC1B,KAAK,IAAI,IAAI,CAAC;CACf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scene-contents.js","sourceRoot":"","sources":["../src/scene-contents.ts"],"names":[],"mappings":"AAAA;;+DAE+D"}
|
|
@@ -4,11 +4,16 @@
|
|
|
4
4
|
* Pure math — takes positions/indices/rays and returns intersection results.
|
|
5
5
|
* No dependency on Scene internal state.
|
|
6
6
|
*/
|
|
7
|
+
import type { MeshData } from '@ifc-lite/geometry';
|
|
7
8
|
import type { Vec3, PickClipState } from './types.js';
|
|
8
9
|
export interface BoundingBox {
|
|
9
10
|
min: Vec3;
|
|
10
11
|
max: Vec3;
|
|
11
12
|
}
|
|
13
|
+
/** The `MeshData` fields the triangle raycast reads. Taken from the real type,
|
|
14
|
+
* never re-spelled inline: an ad-hoc structural copy is why `geometryItemId`
|
|
15
|
+
* was invisible here in the first place (#2985), after two hand-widenings. */
|
|
16
|
+
export type RaycastPiece = Pick<MeshData, 'positions' | 'indices' | 'entityIds' | 'modelIndex' | 'origin' | 'geometryItemId'>;
|
|
12
17
|
/** True when `clip` actually clips anything (a section plane or an enabled box). */
|
|
13
18
|
export declare function clipIsActive(clip?: PickClipState | null): boolean;
|
|
14
19
|
/**
|
|
@@ -56,6 +61,13 @@ export interface RaycastHit {
|
|
|
56
61
|
expressId: number;
|
|
57
62
|
distance: number;
|
|
58
63
|
modelIndex?: number;
|
|
64
|
+
/** Source `MeshData.geometryItemId` of the piece hit, so the CPU pick fallback
|
|
65
|
+
* reports the same representation item the GPU path does rather than
|
|
66
|
+
* collapsing to the product on any model over the pick-mesh budget (#2985).
|
|
67
|
+
* `undefined` where there is nothing to report: this is an internal hit, so
|
|
68
|
+
* `PickingManager` is what turns that into a missing KEY on the PickResult.
|
|
69
|
+
* Which absences, and why: {@link PickResult.geometryItemId}. */
|
|
70
|
+
geometryItemId?: number;
|
|
59
71
|
}
|
|
60
72
|
/**
|
|
61
73
|
* Precompute inverse direction and sign arrays for a ray direction.
|
|
@@ -75,16 +87,10 @@ export declare function raycastBoundingBoxes(rayOrigin: Vec3, rayDir: Vec3, rayD
|
|
|
75
87
|
*
|
|
76
88
|
* @param rayOrigin - Ray origin in world space
|
|
77
89
|
* @param rayDir - Normalised ray direction
|
|
78
|
-
* @param meshDataMap - Map expressId ->
|
|
90
|
+
* @param meshDataMap - Map expressId -> the {@link RaycastPiece} slice of each MeshData
|
|
79
91
|
* @param getEntityBoundingBox - Function to obtain/cache a bounding box per entity
|
|
80
92
|
* @param hiddenIds - Optional set of hidden expressIds to skip
|
|
81
93
|
* @param isolatedIds - Optional set; when non-null only these expressIds are tested
|
|
82
94
|
*/
|
|
83
|
-
export declare function raycastTriangles(rayOrigin: Vec3, rayDir: Vec3, rayDirInv: Vec3, rayDirSign: [number, number, number], meshDataMap: Map<number,
|
|
84
|
-
positions: Float32Array;
|
|
85
|
-
indices: Uint32Array;
|
|
86
|
-
entityIds?: Uint32Array;
|
|
87
|
-
modelIndex?: number;
|
|
88
|
-
origin?: [number, number, number];
|
|
89
|
-
}[]>, getEntityBoundingBox: (expressId: number) => BoundingBox | null, hiddenIds?: Set<number>, isolatedIds?: Set<number> | null, clip?: PickClipState | null): RaycastHit | null;
|
|
95
|
+
export declare function raycastTriangles(rayOrigin: Vec3, rayDir: Vec3, rayDirInv: Vec3, rayDirSign: [number, number, number], meshDataMap: Map<number, RaycastPiece[]>, getEntityBoundingBox: (expressId: number) => BoundingBox | null, hiddenIds?: Set<number>, isolatedIds?: Set<number> | null, clip?: PickClipState | null): RaycastHit | null;
|
|
90
96
|
//# sourceMappingURL=scene-raycaster.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scene-raycaster.d.ts","sourceRoot":"","sources":["../src/scene-raycaster.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"scene-raycaster.d.ts","sourceRoot":"","sources":["../src/scene-raycaster.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAItD,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,IAAI,CAAC;IACV,GAAG,EAAE,IAAI,CAAC;CACX;AAED;;+EAE+E;AAC/E,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,EAAE,WAAW,GAAG,SAAS,GAAG,WAAW,GAAG,YAAY,GAAG,QAAQ,GAAG,gBAAgB,CAAC,CAAC;AAE9H,oFAAoF;AACpF,wBAAgB,YAAY,C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