@ifc-lite/renderer 2.0.1 → 2.2.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 +10 -0
- package/dist/appearance-batch-cohorts.d.ts +33 -0
- package/dist/appearance-batch-cohorts.d.ts.map +1 -0
- package/dist/appearance-batch-cohorts.js +126 -0
- package/dist/appearance-batch-cohorts.js.map +1 -0
- package/dist/appearance-companions.d.ts +30 -0
- package/dist/appearance-companions.d.ts.map +1 -0
- package/dist/appearance-companions.js +138 -0
- package/dist/appearance-companions.js.map +1 -0
- package/dist/appearance-preview.d.ts +93 -0
- package/dist/appearance-preview.d.ts.map +1 -0
- package/dist/appearance-preview.js +246 -0
- package/dist/appearance-preview.js.map +1 -0
- package/dist/appearance-uvs.d.ts +10 -0
- package/dist/appearance-uvs.d.ts.map +1 -0
- package/dist/appearance-uvs.js +112 -0
- package/dist/appearance-uvs.js.map +1 -0
- package/dist/bvh.d.ts.map +1 -1
- package/dist/bvh.js +3 -0
- package/dist/bvh.js.map +1 -1
- package/dist/deviation/deviation-computer.js +1 -1
- package/dist/deviation/deviation-computer.js.map +1 -1
- package/dist/index.d.ts +60 -18
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +184 -232
- package/dist/index.js.map +1 -1
- package/dist/merged-mesh-extract.d.ts +18 -0
- package/dist/merged-mesh-extract.d.ts.map +1 -0
- package/dist/merged-mesh-extract.js +73 -0
- package/dist/merged-mesh-extract.js.map +1 -0
- package/dist/model-bounds-tracker.d.ts +1 -1
- package/dist/model-bounds-tracker.d.ts.map +1 -1
- package/dist/model-bounds-tracker.js +3 -2
- package/dist/model-bounds-tracker.js.map +1 -1
- package/dist/model-placement-bounds.d.ts +29 -0
- package/dist/model-placement-bounds.d.ts.map +1 -0
- package/dist/model-placement-bounds.js +55 -0
- package/dist/model-placement-bounds.js.map +1 -0
- package/dist/model-translation.d.ts +57 -0
- package/dist/model-translation.d.ts.map +1 -0
- package/dist/model-translation.js +223 -0
- package/dist/model-translation.js.map +1 -0
- package/dist/partial-batch-cache.d.ts +65 -0
- package/dist/partial-batch-cache.d.ts.map +1 -0
- package/dist/partial-batch-cache.js +88 -0
- package/dist/partial-batch-cache.js.map +1 -0
- package/dist/partial-batch-requests.d.ts +77 -0
- package/dist/partial-batch-requests.d.ts.map +1 -0
- package/dist/partial-batch-requests.js +97 -0
- package/dist/partial-batch-requests.js.map +1 -0
- package/dist/picking-manager.js +2 -2
- package/dist/picking-manager.js.map +1 -1
- package/dist/point-picker.d.ts +2 -2
- package/dist/point-picker.d.ts.map +1 -1
- package/dist/point-picker.js +27 -21
- package/dist/point-picker.js.map +1 -1
- package/dist/pointcloud/point-cloud-node.d.ts +2 -0
- package/dist/pointcloud/point-cloud-node.d.ts.map +1 -1
- package/dist/pointcloud/point-cloud-node.js +12 -0
- package/dist/pointcloud/point-cloud-node.js.map +1 -1
- package/dist/pointcloud/point-cloud-placement.d.ts +20 -0
- package/dist/pointcloud/point-cloud-placement.d.ts.map +1 -0
- package/dist/pointcloud/point-cloud-placement.js +69 -0
- package/dist/pointcloud/point-cloud-placement.js.map +1 -0
- package/dist/pointcloud/point-cloud-renderer.d.ts +14 -14
- package/dist/pointcloud/point-cloud-renderer.d.ts.map +1 -1
- package/dist/pointcloud/point-cloud-renderer.js +47 -63
- package/dist/pointcloud/point-cloud-renderer.js.map +1 -1
- package/dist/raycast-engine.d.ts +9 -11
- package/dist/raycast-engine.d.ts.map +1 -1
- package/dist/raycast-engine.js +6 -11
- package/dist/raycast-engine.js.map +1 -1
- package/dist/raycaster.d.ts.map +1 -1
- package/dist/raycaster.js +3 -0
- package/dist/raycaster.js.map +1 -1
- package/dist/reference-image-hit.d.ts +5 -0
- package/dist/reference-image-hit.d.ts.map +1 -0
- package/dist/reference-image-hit.js +28 -0
- package/dist/reference-image-hit.js.map +1 -0
- package/dist/reference-image-host.d.ts +5 -0
- package/dist/reference-image-host.d.ts.map +1 -0
- package/dist/reference-image-host.js +26 -0
- package/dist/reference-image-host.js.map +1 -0
- package/dist/reference-image-pipeline.d.ts +15 -0
- package/dist/reference-image-pipeline.d.ts.map +1 -0
- package/dist/reference-image-pipeline.js +104 -0
- package/dist/reference-image-pipeline.js.map +1 -0
- package/dist/reference-image-types.d.ts +27 -0
- package/dist/reference-image-types.d.ts.map +1 -0
- package/dist/reference-image-types.js +5 -0
- package/dist/reference-image-types.js.map +1 -0
- package/dist/reference-images.d.ts +27 -0
- package/dist/reference-images.d.ts.map +1 -0
- package/dist/reference-images.js +134 -0
- package/dist/reference-images.js.map +1 -0
- package/dist/renderer-viewport.d.ts +3 -0
- package/dist/renderer-viewport.d.ts.map +1 -0
- package/dist/renderer-viewport.js +20 -0
- package/dist/renderer-viewport.js.map +1 -0
- package/dist/rgba-texture-pool.d.ts +12 -0
- package/dist/rgba-texture-pool.d.ts.map +1 -0
- package/dist/rgba-texture-pool.js +51 -0
- package/dist/rgba-texture-pool.js.map +1 -0
- package/dist/scene-appearance-buckets.d.ts +41 -0
- package/dist/scene-appearance-buckets.d.ts.map +1 -0
- package/dist/scene-appearance-buckets.js +164 -0
- package/dist/scene-appearance-buckets.js.map +1 -0
- package/dist/scene-appearance-instances.d.ts +42 -0
- package/dist/scene-appearance-instances.d.ts.map +1 -0
- package/dist/scene-appearance-instances.js +143 -0
- package/dist/scene-appearance-instances.js.map +1 -0
- package/dist/scene-appearance-preview.d.ts +30 -0
- package/dist/scene-appearance-preview.d.ts.map +1 -0
- package/dist/scene-appearance-preview.js +149 -0
- package/dist/scene-appearance-preview.js.map +1 -0
- package/dist/scene-appearance-resources.d.ts +16 -0
- package/dist/scene-appearance-resources.d.ts.map +1 -0
- package/dist/scene-appearance-resources.js +41 -0
- package/dist/scene-appearance-resources.js.map +1 -0
- package/dist/scene-authored-owner.d.ts +9 -0
- package/dist/scene-authored-owner.d.ts.map +1 -0
- package/dist/scene-authored-owner.js +73 -0
- package/dist/scene-authored-owner.js.map +1 -0
- package/dist/scene-batch-upload.d.ts +12 -0
- package/dist/scene-batch-upload.d.ts.map +1 -0
- package/dist/scene-batch-upload.js +147 -0
- package/dist/scene-batch-upload.js.map +1 -0
- package/dist/scene-contents.d.ts +41 -0
- package/dist/scene-contents.d.ts.map +1 -1
- package/dist/scene-geometry.d.ts +16 -0
- package/dist/scene-geometry.d.ts.map +1 -1
- package/dist/scene-geometry.js +26 -0
- package/dist/scene-geometry.js.map +1 -1
- package/dist/scene-instance-materialization.d.ts +17 -0
- package/dist/scene-instance-materialization.d.ts.map +1 -0
- package/dist/scene-instance-materialization.js +52 -0
- package/dist/scene-instance-materialization.js.map +1 -0
- package/dist/scene-instance-suppression.d.ts +22 -0
- package/dist/scene-instance-suppression.d.ts.map +1 -0
- package/dist/scene-instance-suppression.js +100 -0
- package/dist/scene-instance-suppression.js.map +1 -0
- package/dist/scene-instance-types.d.ts +55 -0
- package/dist/scene-instance-types.d.ts.map +1 -0
- package/dist/scene-instance-types.js +2 -0
- package/dist/scene-instance-types.js.map +1 -0
- package/dist/scene-model-translation.d.ts +49 -0
- package/dist/scene-model-translation.d.ts.map +1 -0
- package/dist/scene-model-translation.js +100 -0
- package/dist/scene-model-translation.js.map +1 -0
- package/dist/scene-stream-split.d.ts +4 -0
- package/dist/scene-stream-split.d.ts.map +1 -0
- package/dist/scene-stream-split.js +54 -0
- package/dist/scene-stream-split.js.map +1 -0
- package/dist/scene.d.ts +105 -85
- package/dist/scene.d.ts.map +1 -1
- package/dist/scene.js +445 -581
- package/dist/scene.js.map +1 -1
- package/dist/shadow-occluders.d.ts.map +1 -1
- package/dist/shadow-occluders.js +13 -9
- package/dist/shadow-occluders.js.map +1 -1
- package/dist/snap-detector.d.ts.map +1 -1
- package/dist/snap-detector.js +3 -0
- package/dist/snap-detector.js.map +1 -1
- package/dist/textured-vertices.d.ts +9 -0
- package/dist/textured-vertices.d.ts.map +1 -0
- package/dist/textured-vertices.js +40 -0
- package/dist/textured-vertices.js.map +1 -0
- package/dist/types.d.ts +11 -9
- package/dist/types.d.ts.map +1 -1
- package/dist/xray-alpha.d.ts +131 -0
- package/dist/xray-alpha.d.ts.map +1 -0
- package/dist/xray-alpha.js +266 -0
- package/dist/xray-alpha.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
|
+
import { DEFAULT_GHOST_ALPHA } from './overlay-routing.js';
|
|
5
|
+
/**
|
|
6
|
+
* Cap on the number of distinct alphas one batch is split into. Each group
|
|
7
|
+
* costs a cached GPU sub-batch (its own vertex + index buffers), so a caller
|
|
8
|
+
* that hands out many distinct alphas across one colour batch would multiply
|
|
9
|
+
* that batch's VRAM. Past the cap the batch falls back to the whole-batch
|
|
10
|
+
* minimum alpha — wider than asked for, but bounded.
|
|
11
|
+
*
|
|
12
|
+
* Two is the shape every real X-Ray state produces (the faded ids, and the
|
|
13
|
+
* rest), so the cap is generous headroom rather than a routine limit.
|
|
14
|
+
*/
|
|
15
|
+
export const MAX_ALPHA_GROUPS_PER_BATCH = 8;
|
|
16
|
+
/** Alphas within 1/1000 of each other share a group (the batch colour key uses
|
|
17
|
+
* the same quantization, so this is the finest distinction a batch can carry). */
|
|
18
|
+
const ALPHA_KEY_SCALE = 1000;
|
|
19
|
+
/**
|
|
20
|
+
* Cache-key suffix marking a partial sub-batch slot owned by the alpha split.
|
|
21
|
+
*
|
|
22
|
+
* Single-sourced because two sides have to agree on it and they live in
|
|
23
|
+
* different files: the render loop MINTS these keys, and `Scene` matches them
|
|
24
|
+
* to retire the slots an X-Ray edit orphaned. A literal in each place would let
|
|
25
|
+
* the retire sweep silently stop recognising the slots it exists to free.
|
|
26
|
+
*/
|
|
27
|
+
export function alphaSlotSuffix(groupIndex) {
|
|
28
|
+
return `:x${groupIndex}`;
|
|
29
|
+
}
|
|
30
|
+
/** Matches a `sourceBatchKey` that carries an {@link alphaSlotSuffix}. The
|
|
31
|
+
* suffix is not always final — the promotion split appends `:promoted` /
|
|
32
|
+
* `:remaining` after it — so this looks for the segment, not the tail. */
|
|
33
|
+
export const ALPHA_SLOT_KEY = /:x\d+(?::|$)/;
|
|
34
|
+
/**
|
|
35
|
+
* Per-frame X-Ray state: a snapshot of the caller's `transparencyOverrides` /
|
|
36
|
+
* `ghostExceptIds` plus the resolution rules that read them.
|
|
37
|
+
*
|
|
38
|
+
* Snapshotting matters: the renderer classifies a batch (opaque vs transparent
|
|
39
|
+
* pipeline) and writes its uniform at two different points in the frame, and a
|
|
40
|
+
* caller mutating its map in between would desync the two.
|
|
41
|
+
*/
|
|
42
|
+
export class XRayAlpha {
|
|
43
|
+
/** False when no override and no ghost set is active — every resolver is then
|
|
44
|
+
* an identity on the fallback and the caller can skip the machinery. */
|
|
45
|
+
active;
|
|
46
|
+
overrides;
|
|
47
|
+
ghostExcept;
|
|
48
|
+
ghostAlpha;
|
|
49
|
+
selected;
|
|
50
|
+
// Resolved-per-batch results for THIS frame. Classification and the uniform
|
|
51
|
+
// write both need them, and recomputing would walk every id twice per batch.
|
|
52
|
+
batchCache = new WeakMap();
|
|
53
|
+
constructor(options, selectedExpressIds) {
|
|
54
|
+
const src = options.transparencyOverrides;
|
|
55
|
+
this.overrides = src != null && src.size > 0 ? new Map(src) : null;
|
|
56
|
+
this.ghostExcept = options.ghostExceptIds ?? null;
|
|
57
|
+
this.ghostAlpha = options.ghostAlpha ?? DEFAULT_GHOST_ALPHA;
|
|
58
|
+
this.selected = selectedExpressIds;
|
|
59
|
+
this.active = this.overrides != null || this.ghostExcept != null;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Resolved alpha for one entity. Selected entities are exempt at every site:
|
|
63
|
+
* the highlight pass repaints them last, and exempting here keeps
|
|
64
|
+
* classification and the uniform write from disagreeing about them.
|
|
65
|
+
*/
|
|
66
|
+
forEntity(expressId, fallback) {
|
|
67
|
+
if (!this.active)
|
|
68
|
+
return fallback;
|
|
69
|
+
if (this.selected.has(expressId))
|
|
70
|
+
return fallback;
|
|
71
|
+
const a = this.overrides?.get(expressId);
|
|
72
|
+
if (a !== undefined)
|
|
73
|
+
return a;
|
|
74
|
+
if (this.ghostExcept != null && !this.ghostExcept.has(expressId))
|
|
75
|
+
return this.ghostAlpha;
|
|
76
|
+
return fallback;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Alpha for a batch drawn WHOLE: the minimum override alpha across its
|
|
80
|
+
* non-selected ids, or `fallback` when no id in it carries one. Correct on
|
|
81
|
+
* its own for a homogeneous (sub-)batch, and the documented fallback for a
|
|
82
|
+
* mixed batch that cannot be partitioned.
|
|
83
|
+
*/
|
|
84
|
+
forBatch(batch, fallback) {
|
|
85
|
+
if (!this.active)
|
|
86
|
+
return fallback;
|
|
87
|
+
return this.resolve(batch, fallback).alpha;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* The per-alpha partition of a batch, or `null` when it needs none — every
|
|
91
|
+
* id resolves to the same alpha, or the distinct count exceeded
|
|
92
|
+
* {@link MAX_ALPHA_GROUPS_PER_BATCH}. Groups come back in a deterministic
|
|
93
|
+
* order (ascending alpha) so a group keeps the same sub-batch cache slot
|
|
94
|
+
* across frames while its content is unchanged.
|
|
95
|
+
*/
|
|
96
|
+
groupsForBatch(batch, fallback) {
|
|
97
|
+
if (!this.active)
|
|
98
|
+
return null;
|
|
99
|
+
return this.resolve(batch, fallback).groups;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Same partition over an arbitrary id subset — the visible subset of a
|
|
103
|
+
* partially hidden batch, which is not the batch's own id list.
|
|
104
|
+
*/
|
|
105
|
+
groupsForIds(ids, fallback) {
|
|
106
|
+
if (!this.active)
|
|
107
|
+
return null;
|
|
108
|
+
return partitionByAlpha(ids, (id) => this.forEntity(id, fallback));
|
|
109
|
+
}
|
|
110
|
+
resolve(batch, fallback) {
|
|
111
|
+
const cached = this.batchCache.get(batch);
|
|
112
|
+
if (cached !== undefined)
|
|
113
|
+
return cached;
|
|
114
|
+
// ONE walk for both answers, and no allocation at all for the common case
|
|
115
|
+
// (a batch that resolves to a single alpha — e.g. every fully-ghosted batch
|
|
116
|
+
// on the model, every frame X-Ray is on). The group Sets are built by a
|
|
117
|
+
// second walk below, paid only by the batches that are genuinely mixed.
|
|
118
|
+
//
|
|
119
|
+
// The minimum is taken over ids that actually carry an override: an id with
|
|
120
|
+
// no entry contributes nothing, so a batch of untouched entities keeps its
|
|
121
|
+
// native (possibly translucent) colour alpha rather than being clamped.
|
|
122
|
+
// That is `forEntity`'s rule with the "was it overridden" bit kept, which is
|
|
123
|
+
// why the resolution is spelled out again here instead of calling it.
|
|
124
|
+
let min = Infinity;
|
|
125
|
+
let firstKey = 0;
|
|
126
|
+
let haveFirstKey = false;
|
|
127
|
+
let extraKeys = null;
|
|
128
|
+
for (const eid of batch.expressIds) {
|
|
129
|
+
let alpha = fallback;
|
|
130
|
+
if (!this.selected.has(eid)) {
|
|
131
|
+
const o = this.overrides?.get(eid);
|
|
132
|
+
if (o !== undefined) {
|
|
133
|
+
alpha = o;
|
|
134
|
+
if (o < min)
|
|
135
|
+
min = o;
|
|
136
|
+
}
|
|
137
|
+
else if (this.ghostExcept != null && !this.ghostExcept.has(eid)) {
|
|
138
|
+
alpha = this.ghostAlpha;
|
|
139
|
+
if (this.ghostAlpha < min)
|
|
140
|
+
min = this.ghostAlpha;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
const key = Math.round(alpha * ALPHA_KEY_SCALE);
|
|
144
|
+
if (!haveFirstKey) {
|
|
145
|
+
firstKey = key;
|
|
146
|
+
haveFirstKey = true;
|
|
147
|
+
}
|
|
148
|
+
else if (key !== firstKey) {
|
|
149
|
+
// Stop collecting past the cap: we already know the batch is over it,
|
|
150
|
+
// and an unbounded array here would make the linear scan quadratic.
|
|
151
|
+
if (extraKeys === null)
|
|
152
|
+
extraKeys = [key];
|
|
153
|
+
else if (extraKeys.length < MAX_ALPHA_GROUPS_PER_BATCH && !extraKeys.includes(key))
|
|
154
|
+
extraKeys.push(key);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
const mixed = extraKeys !== null && extraKeys.length < MAX_ALPHA_GROUPS_PER_BATCH;
|
|
158
|
+
const resolved = {
|
|
159
|
+
alpha: min === Infinity ? fallback : min,
|
|
160
|
+
groups: mixed ? partitionByAlpha(batch.expressIds, (id) => this.forEntity(id, fallback)) : null,
|
|
161
|
+
};
|
|
162
|
+
this.batchCache.set(batch, resolved);
|
|
163
|
+
return resolved;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Group ids by resolved alpha. Returns `null` when there is nothing to gain —
|
|
168
|
+
* fewer than two distinct alphas — or when the distinct count would exceed
|
|
169
|
+
* {@link MAX_ALPHA_GROUPS_PER_BATCH}.
|
|
170
|
+
*/
|
|
171
|
+
function partitionByAlpha(ids, alphaOf) {
|
|
172
|
+
const byKey = new Map();
|
|
173
|
+
for (const id of ids) {
|
|
174
|
+
const alpha = alphaOf(id);
|
|
175
|
+
const key = Math.round(alpha * ALPHA_KEY_SCALE);
|
|
176
|
+
const group = byKey.get(key);
|
|
177
|
+
if (group) {
|
|
178
|
+
group.ids.add(id);
|
|
179
|
+
// Quantization can put two alphas a hair apart in one group; draw the
|
|
180
|
+
// more transparent of them so an X-Ray request is never under-applied.
|
|
181
|
+
if (alpha < group.alpha)
|
|
182
|
+
group.alpha = alpha;
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
if (byKey.size >= MAX_ALPHA_GROUPS_PER_BATCH)
|
|
186
|
+
return null;
|
|
187
|
+
byKey.set(key, { alpha, ids: new Set([id]) });
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
if (byKey.size < 2)
|
|
191
|
+
return null;
|
|
192
|
+
return [...byKey.values()].sort((a, b) => a.alpha - b.alpha);
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Content-based change tracking for the X-Ray sets, mirroring
|
|
196
|
+
* `VisibilityEpochTracker`: the partial sub-batch cache keys on an epoch, so
|
|
197
|
+
* the epoch has to bump EXACTLY when the effective X-Ray state changes.
|
|
198
|
+
* Callers pass a fresh `Map`/`Set` every frame (zustand rebuilds them) or
|
|
199
|
+
* mutate one in place, so only a content comparison gets both right.
|
|
200
|
+
*/
|
|
201
|
+
export class XRayEpochTracker {
|
|
202
|
+
version = 0;
|
|
203
|
+
overrides = null;
|
|
204
|
+
ghostExcept = null;
|
|
205
|
+
ghostAlpha = DEFAULT_GHOST_ALPHA;
|
|
206
|
+
selected = new Set();
|
|
207
|
+
/**
|
|
208
|
+
* @param selectedExpressIds Selection exempts an entity from fading, so it
|
|
209
|
+
* decides group MEMBERSHIP and belongs in this epoch. It only counts while
|
|
210
|
+
* X-Ray is active: outside that it changes no subset, and bumping on every
|
|
211
|
+
* click would rebuild the hide/isolate sub-batches for nothing. The snapshot
|
|
212
|
+
* is still refreshed, so activating X-Ray later compares against the truth.
|
|
213
|
+
*/
|
|
214
|
+
update(options, selectedExpressIds = EMPTY_SELECTION) {
|
|
215
|
+
const src = options.transparencyOverrides;
|
|
216
|
+
const live = src != null && src.size > 0 ? src : null;
|
|
217
|
+
const ghost = options.ghostExceptIds ?? null;
|
|
218
|
+
const alpha = options.ghostAlpha ?? DEFAULT_GHOST_ALPHA;
|
|
219
|
+
const active = live != null || ghost != null;
|
|
220
|
+
const selectionChanged = !setContentEquals(selectedExpressIds, this.selected);
|
|
221
|
+
const changed = !alphaMapEquals(live, this.overrides) ||
|
|
222
|
+
!setContentEquals(ghost, this.ghostExcept) ||
|
|
223
|
+
alpha !== this.ghostAlpha ||
|
|
224
|
+
(active && selectionChanged);
|
|
225
|
+
if (selectionChanged)
|
|
226
|
+
this.selected = new Set(selectedExpressIds);
|
|
227
|
+
if (changed) {
|
|
228
|
+
this.version++;
|
|
229
|
+
this.overrides = live ? new Map(live) : null;
|
|
230
|
+
this.ghostExcept = ghost ? new Set(ghost) : null;
|
|
231
|
+
this.ghostAlpha = alpha;
|
|
232
|
+
}
|
|
233
|
+
return this.version;
|
|
234
|
+
}
|
|
235
|
+
getVersion() {
|
|
236
|
+
return this.version;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
const EMPTY_SELECTION = new Set();
|
|
240
|
+
function alphaMapEquals(live, snapshot) {
|
|
241
|
+
if (live === snapshot)
|
|
242
|
+
return true; // covers null === null
|
|
243
|
+
if (live === null || snapshot === null)
|
|
244
|
+
return false;
|
|
245
|
+
if (live.size !== snapshot.size)
|
|
246
|
+
return false;
|
|
247
|
+
for (const [id, alpha] of live) {
|
|
248
|
+
if (snapshot.get(id) !== alpha)
|
|
249
|
+
return false;
|
|
250
|
+
}
|
|
251
|
+
return true;
|
|
252
|
+
}
|
|
253
|
+
function setContentEquals(live, snapshot) {
|
|
254
|
+
if (live === snapshot)
|
|
255
|
+
return true;
|
|
256
|
+
if (live === null || snapshot === null)
|
|
257
|
+
return false;
|
|
258
|
+
if (live.size !== snapshot.size)
|
|
259
|
+
return false;
|
|
260
|
+
for (const id of live) {
|
|
261
|
+
if (!snapshot.has(id))
|
|
262
|
+
return false;
|
|
263
|
+
}
|
|
264
|
+
return true;
|
|
265
|
+
}
|
|
266
|
+
//# sourceMappingURL=xray-alpha.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xray-alpha.js","sourceRoot":"","sources":["../src/xray-alpha.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AA8B/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAc3D;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC;AAE5C;mFACmF;AACnF,MAAM,eAAe,GAAG,IAAI,CAAC;AAE7B;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAAC,UAAkB;IAChD,OAAO,KAAK,UAAU,EAAE,CAAC;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E,OAAO,IAAI,CAAC;IACnC,IAAI,IAAI,KAAK,IAAI,IAAI,QAAQ,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IACrD,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC,IAAI;QAAE,OAAO,KAAK,CAAC;IAC9C,KAAK,MAAM,EAAE,IAAI,IAAI,EAAE,CAAC;QACtB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAAE,OAAO,KAAK,CAAC;IACtC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ifc-lite/renderer",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "WebGPU renderer for IFC-Lite",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@ifc-lite/geometry": "^
|
|
17
|
-
"@ifc-lite/spatial": "^1.14.
|
|
16
|
+
"@ifc-lite/geometry": "^5.0.0",
|
|
17
|
+
"@ifc-lite/spatial": "^1.14.17"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@webgpu/types": "^0.1.72",
|