vim-web 0.6.0-dev.9 → 1.0.0-alpha.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/vim-web.js CHANGED
@@ -47528,25 +47528,6 @@ const _CameraMovementSnap = class _CameraMovementSnap extends CameraMovement$1 {
47528
47528
  };
47529
47529
  __publicField(_CameraMovementSnap, "_ZERO", new Vector3());
47530
47530
  let CameraMovementSnap = _CameraMovementSnap;
47531
- function createOpaque() {
47532
- return new StandardMaterial(createBasicOpaque());
47533
- }
47534
- function createTransparent() {
47535
- return new StandardMaterial(createBasicTransparent());
47536
- }
47537
- function createBasicOpaque() {
47538
- return new MeshLambertMaterial({
47539
- color: 13421772,
47540
- flatShading: true,
47541
- side: DoubleSide
47542
- });
47543
- }
47544
- function createBasicTransparent() {
47545
- const mat = createBasicOpaque();
47546
- mat.transparent = true;
47547
- mat.opacity = 0.25;
47548
- return mat;
47549
- }
47550
47531
  class StandardMaterial {
47551
47532
  constructor(material) {
47552
47533
  __publicField(this, "three");
@@ -53761,7 +53742,7 @@ let SectionBox$1 = class SectionBox {
53761
53742
  }
53762
53743
  };
53763
53744
  class Gizmos {
53764
- constructor(renderer, viewport, viewer, camera2) {
53745
+ constructor(renderer, viewport, viewer, camera2, settings2) {
53765
53746
  __publicField(this, "_viewport");
53766
53747
  __publicField(this, "_measure");
53767
53748
  /**
@@ -53788,9 +53769,9 @@ class Gizmos {
53788
53769
  renderer,
53789
53770
  camera2,
53790
53771
  viewer.inputs,
53791
- viewer.settings
53772
+ settings2
53792
53773
  );
53793
- this.axes = new GizmoAxes(camera2, viewport, viewer.settings.axes);
53774
+ this.axes = new GizmoAxes(camera2, viewport, settings2.axes);
53794
53775
  this.markers = new GizmoMarkers(renderer, viewer.selection);
53795
53776
  (_a3 = viewport.canvas.parentElement) == null ? void 0 : _a3.prepend(this.axes.canvas);
53796
53777
  }
@@ -54193,33 +54174,13 @@ function createGhostShader() {
54193
54174
  });
54194
54175
  }
54195
54176
  class OutlineMaterial {
54196
- constructor(options, onUpdate) {
54177
+ constructor(onUpdate) {
54197
54178
  __publicField(this, "three");
54198
- __publicField(this, "_camera");
54199
54179
  __publicField(this, "_resolution");
54200
- __publicField(this, "_precision", 1);
54201
54180
  __publicField(this, "_onUpdate");
54202
54181
  this.three = createOutlineMaterial();
54203
54182
  this._onUpdate = onUpdate;
54204
- this._precision = (options == null ? void 0 : options.precision) ?? 1;
54205
- this._resolution = (options == null ? void 0 : options.resolution) ?? new Vector2(1, 1);
54206
- this.resolution = this._resolution;
54207
- if (options == null ? void 0 : options.sceneBuffer) {
54208
- this.sceneBuffer = options.sceneBuffer;
54209
- }
54210
- this.camera = options == null ? void 0 : options.camera;
54211
- }
54212
- /**
54213
- * Precision of the outline. This is used to scale the resolution of the outline.
54214
- */
54215
- get precision() {
54216
- return this._precision;
54217
- }
54218
- set precision(value) {
54219
- var _a3;
54220
- this._precision = value;
54221
- this.resolution = this._resolution;
54222
- (_a3 = this._onUpdate) == null ? void 0 : _a3.call(this);
54183
+ this._resolution = new Vector2(1, 1);
54223
54184
  }
54224
54185
  /**
54225
54186
  * Resolution of the outline. This should match the resolution of screen.
@@ -54230,50 +54191,24 @@ class OutlineMaterial {
54230
54191
  set resolution(value) {
54231
54192
  var _a3;
54232
54193
  this.three.uniforms.screenSize.value.set(
54233
- value.x * this._precision,
54234
- value.y * this._precision,
54235
- 1 / (value.x * this._precision),
54236
- 1 / (value.y * this._precision)
54194
+ value.x,
54195
+ value.y,
54196
+ 1 / value.x,
54197
+ 1 / value.y
54237
54198
  );
54238
54199
  this._resolution = value;
54239
54200
  this.three.uniformsNeedUpdate = true;
54240
54201
  (_a3 = this._onUpdate) == null ? void 0 : _a3.call(this);
54241
54202
  }
54242
54203
  /**
54243
- * Camera used to render the outline.
54244
- */
54245
- get camera() {
54246
- return this._camera;
54247
- }
54248
- set camera(value) {
54249
- var _a3;
54250
- this._camera = value;
54251
- this.three.uniforms.cameraNear.value = (value == null ? void 0 : value.near) ?? 1;
54252
- this.three.uniforms.cameraFar.value = (value == null ? void 0 : value.far) ?? 1e3;
54253
- this.three.uniformsNeedUpdate = true;
54254
- (_a3 = this._onUpdate) == null ? void 0 : _a3.call(this);
54255
- }
54256
- /**
54257
- * Intensity of the outline. Controls the strength of the edge detection.
54204
+ * Thickness of the outline in pixels (of the outline render target).
54258
54205
  */
54259
- get intensity() {
54260
- return this.three.uniforms.intensity.value;
54206
+ get thickness() {
54207
+ return this.three.uniforms.thickness.value;
54261
54208
  }
54262
- set intensity(value) {
54209
+ set thickness(value) {
54263
54210
  var _a3;
54264
- this.three.uniforms.intensity.value = value;
54265
- this.three.uniformsNeedUpdate = true;
54266
- (_a3 = this._onUpdate) == null ? void 0 : _a3.call(this);
54267
- }
54268
- /**
54269
- * Color of the outline.
54270
- */
54271
- get color() {
54272
- return this.three.uniforms.outlineColor.value;
54273
- }
54274
- set color(value) {
54275
- var _a3;
54276
- this.three.uniforms.outlineColor.value.set(value);
54211
+ this.three.uniforms.thickness.value = Math.max(1, Math.round(value));
54277
54212
  this.three.uniformsNeedUpdate = true;
54278
54213
  (_a3 = this._onUpdate) == null ? void 0 : _a3.call(this);
54279
54214
  }
@@ -54289,18 +54224,6 @@ class OutlineMaterial {
54289
54224
  this.three.uniformsNeedUpdate = true;
54290
54225
  (_a3 = this._onUpdate) == null ? void 0 : _a3.call(this);
54291
54226
  }
54292
- /**
54293
- * Depth buffer used to render the outline.
54294
- */
54295
- get depthBuffer() {
54296
- return this.three.uniforms.depthBuffer.value;
54297
- }
54298
- set depthBuffer(value) {
54299
- var _a3;
54300
- this.three.uniforms.depthBuffer.value = value;
54301
- this.three.uniformsNeedUpdate = true;
54302
- (_a3 = this._onUpdate) == null ? void 0 : _a3.call(this);
54303
- }
54304
54227
  /**
54305
54228
  * Dispose of the outline material.
54306
54229
  */
@@ -54314,18 +54237,9 @@ function createOutlineMaterial() {
54314
54237
  glslVersion: GLSL3,
54315
54238
  depthWrite: false,
54316
54239
  uniforms: {
54317
- // Input buffers
54318
54240
  sceneBuffer: { value: null },
54319
- depthBuffer: { value: null },
54320
- // Input parameters
54321
- cameraNear: { value: 1 },
54322
- cameraFar: { value: 1e3 },
54323
- screenSize: {
54324
- value: new Vector4(1, 1, 1, 1)
54325
- },
54326
- // Options
54327
- outlineColor: { value: new Color(16777215) },
54328
- intensity: { value: 2 }
54241
+ screenSize: { value: new Vector4(1, 1, 1, 1) },
54242
+ thickness: { value: 2 }
54329
54243
  },
54330
54244
  vertexShader: `
54331
54245
  out vec2 vUv;
@@ -54337,20 +54251,35 @@ function createOutlineMaterial() {
54337
54251
  fragmentShader: `
54338
54252
  uniform sampler2D sceneBuffer;
54339
54253
  uniform vec4 screenSize;
54340
- uniform float intensity;
54254
+ uniform float thickness;
54341
54255
 
54342
54256
  in vec2 vUv;
54343
54257
  out vec4 fragColor;
54344
54258
 
54345
- // Read binary selection mask: 1.0 = selected, 0.0 = background.
54346
- // Clamp to texture bounds so edge pixels don't read out-of-bounds
54347
- // (which returns 0 and creates false outlines at the screen border).
54259
+ // Read binary selection mask (1.0 = selected, 0.0 = background).
54260
+ // Clamped to texture bounds to avoid false outlines at screen edges.
54348
54261
  float getMask(int x, int y) {
54349
54262
  ivec2 pixelCoord = ivec2(vUv * screenSize.xy) + ivec2(x, y);
54350
54263
  pixelCoord = clamp(pixelCoord, ivec2(0), ivec2(screenSize.xy) - 1);
54351
54264
  return texelFetch(sceneBuffer, pixelCoord, 0).x;
54352
54265
  }
54353
54266
 
54267
+ // Check the full grid ring at Chebyshev distance d.
54268
+ // Called with literal constants so the compiler inlines and unrolls.
54269
+ bool checkRing(int d) {
54270
+ // Top and bottom rows (full width)
54271
+ for (int x = -d; x <= d; x++) {
54272
+ if (getMask(x, -d) < 0.5) return true;
54273
+ if (getMask(x, d) < 0.5) return true;
54274
+ }
54275
+ // Left and right columns (excluding corners)
54276
+ for (int y = -d + 1; y < d; y++) {
54277
+ if (getMask(-d, y) < 0.5) return true;
54278
+ if (getMask( d, y) < 0.5) return true;
54279
+ }
54280
+ return false;
54281
+ }
54282
+
54354
54283
  void main() {
54355
54284
  // Skip non-selected pixels
54356
54285
  if (getMask(0, 0) < 0.5) {
@@ -54358,16 +54287,17 @@ function createOutlineMaterial() {
54358
54287
  return;
54359
54288
  }
54360
54289
 
54361
- // Silhouette edge detection: outline where selected borders non-selected.
54362
- // Thickness is controlled by outlineScale (render target resolution).
54363
- float outline = 0.0;
54364
- outline += step(0.5, 1.0 - getMask( 0, -1));
54365
- outline += step(0.5, 1.0 - getMask( 0, 1));
54366
- outline += step(0.5, 1.0 - getMask(-1, 0));
54367
- outline += step(0.5, 1.0 - getMask( 1, 0));
54368
- outline = clamp(outline * 0.25 * intensity, 0.0, 1.0);
54290
+ // Full grid search ring by ring (3x3, 5x5, 7x7 ... up to 11x11).
54291
+ // Each ring checks all pixels at that Chebyshev distance.
54292
+ // Early-exit between rings once an edge is found.
54293
+ bool edge = checkRing(1);
54294
+
54295
+ if (!edge && thickness >= 2.0) edge = checkRing(2);
54296
+ if (!edge && thickness >= 3.0) edge = checkRing(3);
54297
+ if (!edge && thickness >= 4.0) edge = checkRing(4);
54298
+ if (!edge && thickness >= 5.0) edge = checkRing(5);
54369
54299
 
54370
- fragColor = vec4(outline, 0.0, 0.0, 0.0);
54300
+ fragColor = vec4(edge ? 1.0 : 0.0, 0.0, 0.0, 0.0);
54371
54301
  }
54372
54302
  `
54373
54303
  });
@@ -54388,6 +54318,15 @@ class MergeMaterial {
54388
54318
  this.three.uniformsNeedUpdate = true;
54389
54319
  (_a3 = this._onUpdate) == null ? void 0 : _a3.call(this);
54390
54320
  }
54321
+ get opacity() {
54322
+ return this.three.uniforms.opacity.value;
54323
+ }
54324
+ set opacity(value) {
54325
+ var _a3;
54326
+ this.three.uniforms.opacity.value = Math.max(0, Math.min(1, value));
54327
+ this.three.uniformsNeedUpdate = true;
54328
+ (_a3 = this._onUpdate) == null ? void 0 : _a3.call(this);
54329
+ }
54391
54330
  get sourceA() {
54392
54331
  return this.three.uniforms.sourceA.value;
54393
54332
  }
@@ -54413,7 +54352,8 @@ function createMergeMaterial() {
54413
54352
  uniforms: {
54414
54353
  sourceA: { value: null },
54415
54354
  sourceB: { value: null },
54416
- color: { value: new Color(16777215) }
54355
+ color: { value: new Color(16777215) },
54356
+ opacity: { value: 1 }
54417
54357
  },
54418
54358
  vertexShader: (
54419
54359
  /* glsl */
@@ -54429,25 +54369,26 @@ function createMergeMaterial() {
54429
54369
  /* glsl */
54430
54370
  `
54431
54371
  uniform vec3 color;
54372
+ uniform float opacity;
54432
54373
  uniform sampler2D sourceA;
54433
54374
  uniform sampler2D sourceB;
54434
54375
  in vec2 vUv;
54435
54376
  out vec4 fragColor;
54436
54377
 
54437
54378
  void main() {
54438
- // Fetch outline intensity first (cheaper to check)
54379
+ // Fetch outline mask first (cheaper to check)
54439
54380
  // Use texture() for proper handling of different resolutions
54440
- vec4 B = texture(sourceB, vUv);
54381
+ float edge = texture(sourceB, vUv).x;
54441
54382
 
54442
54383
  // Early-out: if no outline, just copy scene directly
54443
- if (B.x < 0.01) {
54384
+ if (edge < 0.01) {
54444
54385
  fragColor = texture(sourceA, vUv);
54445
54386
  return;
54446
54387
  }
54447
54388
 
54448
- // Fetch scene and blend with outline color
54389
+ // Fetch scene and blend with outline color using opacity
54449
54390
  vec4 A = texture(sourceA, vUv);
54450
- fragColor = vec4(mix(A.xyz, color, B.x), 1.0);
54391
+ fragColor = vec4(mix(A.xyz, color, edge * opacity), 1.0);
54451
54392
  }
54452
54393
  `
54453
54394
  )
@@ -54595,9 +54536,7 @@ function applyMaterial(mesh, value) {
54595
54536
  mesh.visible = true;
54596
54537
  }
54597
54538
  const _Materials = class _Materials {
54598
- constructor(opaque, transparent, modelOpaque, modelTransparent, ghost2, mask, outline, merge) {
54599
- __publicField(this, "_opaque");
54600
- __publicField(this, "_transparent");
54539
+ constructor(modelOpaque, modelTransparent, ghost2, mask, outline, merge) {
54601
54540
  __publicField(this, "_modelOpaque");
54602
54541
  __publicField(this, "_modelTransparent");
54603
54542
  __publicField(this, "_ghost");
@@ -54606,20 +54545,15 @@ const _Materials = class _Materials {
54606
54545
  __publicField(this, "_outline");
54607
54546
  __publicField(this, "_merge");
54608
54547
  __publicField(this, "_clippingPlanes");
54609
- __publicField(this, "_sectionStrokeWidth", 0.01);
54610
- __publicField(this, "_sectionStrokeFalloff", 0.75);
54611
- __publicField(this, "_sectionStrokeColor", new Color(16185078));
54612
54548
  __publicField(this, "_onUpdate", new distExports$2.SignalDispatcher());
54613
54549
  // Shared color palette texture for all scene materials
54614
54550
  __publicField(this, "_colorPaletteTexture");
54615
- this._opaque = opaque ?? createOpaque();
54616
- this._transparent = transparent ?? createTransparent();
54617
54551
  const onUpdate = () => this._onUpdate.dispatch();
54618
54552
  this._modelOpaque = modelOpaque ?? createModelOpaque(onUpdate);
54619
54553
  this._modelTransparent = modelTransparent ?? createModelTransparent(onUpdate);
54620
54554
  this._ghost = ghost2 ?? new GhostMaterial(void 0, onUpdate);
54621
54555
  this._mask = mask ?? createMaskMaterial();
54622
- this._outline = outline ?? new OutlineMaterial(void 0, onUpdate);
54556
+ this._outline = outline ?? new OutlineMaterial(onUpdate);
54623
54557
  this._merge = merge ?? new MergeMaterial(onUpdate);
54624
54558
  }
54625
54559
  static createInstance(instance) {
@@ -54665,34 +54599,29 @@ const _Materials = class _Materials {
54665
54599
  * Updates material settings based on the provided configuration.
54666
54600
  */
54667
54601
  applySettings(settings2) {
54668
- this.modelColor = settings2.standard.color;
54669
54602
  this._ghost.opacity = settings2.ghost.opacity;
54670
54603
  this._ghost.color = settings2.ghost.color;
54671
- this.sectionStrokeWidth = settings2.section.strokeWidth;
54672
- this.sectionStrokeFalloff = settings2.section.strokeFalloff;
54673
- this.sectionStrokeColor = settings2.section.strokeColor;
54674
- this.outlineIntensity = settings2.outline.intensity;
54604
+ this.outlineOpacity = settings2.outline.opacity;
54675
54605
  this.outlineColor = settings2.outline.color;
54606
+ this.outlineThickness = settings2.outline.thickness;
54676
54607
  }
54677
54608
  /** @internal Signal dispatched whenever a material is modified. */
54678
54609
  get onUpdate() {
54679
54610
  return this._onUpdate.asEvent();
54680
54611
  }
54681
- /** Base color tint applied to opaque and transparent model materials. */
54682
- get modelColor() {
54683
- return this._opaque.color;
54612
+ /** Opacity of the selection outline (0 = invisible, 1 = fully opaque). */
54613
+ get outlineOpacity() {
54614
+ return this._merge.opacity;
54684
54615
  }
54685
- set modelColor(color) {
54686
- this._opaque.color = color;
54687
- this._transparent.color = color;
54688
- this._onUpdate.dispatch();
54616
+ set outlineOpacity(value) {
54617
+ this._merge.opacity = value;
54689
54618
  }
54690
- /** Intensity of the selection outline post-process effect. */
54691
- get outlineIntensity() {
54692
- return this._outline.intensity;
54619
+ /** Thickness of the selection outline in pixels (of the outline render target). */
54620
+ get outlineThickness() {
54621
+ return this._outline.thickness;
54693
54622
  }
54694
- set outlineIntensity(value) {
54695
- this._outline.intensity = value;
54623
+ set outlineThickness(value) {
54624
+ this._outline.thickness = value;
54696
54625
  }
54697
54626
  /** Color of the selection outline post-process effect. */
54698
54627
  get outlineColor() {
@@ -54709,45 +54638,10 @@ const _Materials = class _Materials {
54709
54638
  this._clippingPlanes = value;
54710
54639
  this._modelOpaque.clippingPlanes = value ?? null;
54711
54640
  this._modelTransparent.clippingPlanes = value ?? null;
54712
- this._opaque.clippingPlanes = value ?? null;
54713
- this._transparent.clippingPlanes = value ?? null;
54714
54641
  this._ghost.clippingPlanes = value ?? null;
54715
54642
  this._mask.clippingPlanes = value ?? null;
54716
54643
  this._onUpdate.dispatch();
54717
54644
  }
54718
- /** Width of the stroke rendered where the section box intersects the model. */
54719
- get sectionStrokeWidth() {
54720
- return this._sectionStrokeWidth;
54721
- }
54722
- set sectionStrokeWidth(value) {
54723
- if (this._sectionStrokeWidth === value) return;
54724
- this._sectionStrokeWidth = value;
54725
- this._opaque.sectionStrokeWidth = value;
54726
- this._transparent.sectionStrokeWidth = value;
54727
- this._onUpdate.dispatch();
54728
- }
54729
- /** Gradient falloff of the section box intersection stroke. */
54730
- get sectionStrokeFalloff() {
54731
- return this._sectionStrokeFalloff;
54732
- }
54733
- set sectionStrokeFalloff(value) {
54734
- if (this._sectionStrokeFalloff === value) return;
54735
- this._sectionStrokeFalloff = value;
54736
- this._opaque.sectionStrokeFalloff = value;
54737
- this._transparent.sectionStrokeFalloff = value;
54738
- this._onUpdate.dispatch();
54739
- }
54740
- /** Color of the section box intersection stroke. */
54741
- get sectionStrokeColor() {
54742
- return this._sectionStrokeColor;
54743
- }
54744
- set sectionStrokeColor(value) {
54745
- if (this._sectionStrokeColor === value) return;
54746
- this._sectionStrokeColor = value;
54747
- this._opaque.sectionStrokeColor = value;
54748
- this._transparent.sectionStrokeColor = value;
54749
- this._onUpdate.dispatch();
54750
- }
54751
54645
  /**
54752
54646
  * Creates the fixed quantized color palette texture if it doesn't exist.
54753
54647
  * The palette is deterministic (25³ = 15,625 quantized colors in 128×128 texture)
@@ -54757,6 +54651,8 @@ const _Materials = class _Materials {
54757
54651
  if (this._colorPaletteTexture) return;
54758
54652
  const textureData = buildPaletteTexture();
54759
54653
  this._colorPaletteTexture = new DataTexture(
54654
+ // Cast: TS 5.7 narrows Uint8Array.buffer to ArrayBufferLike (includes SharedArrayBuffer),
54655
+ // but Three.js expects BufferSource (ArrayBuffer only). Safe — Uint8Array always backs ArrayBuffer.
54760
54656
  textureData,
54761
54657
  128,
54762
54658
  128,
@@ -54766,8 +54662,6 @@ const _Materials = class _Materials {
54766
54662
  this._colorPaletteTexture.needsUpdate = true;
54767
54663
  this._colorPaletteTexture.minFilter = NearestFilter;
54768
54664
  this._colorPaletteTexture.magFilter = NearestFilter;
54769
- this._opaque.setColorPaletteTexture(this._colorPaletteTexture);
54770
- this._transparent.setColorPaletteTexture(this._colorPaletteTexture);
54771
54665
  this._modelOpaque.setColorPaletteTexture(this._colorPaletteTexture);
54772
54666
  this._modelTransparent.setColorPaletteTexture(this._colorPaletteTexture);
54773
54667
  this._onUpdate.dispatch();
@@ -54778,8 +54672,6 @@ const _Materials = class _Materials {
54778
54672
  this._colorPaletteTexture.dispose();
54779
54673
  this._colorPaletteTexture = void 0;
54780
54674
  }
54781
- this._opaque.dispose();
54782
- this._transparent.dispose();
54783
54675
  this._modelOpaque.dispose();
54784
54676
  this._modelTransparent.dispose();
54785
54677
  this._ghost.dispose();
@@ -55512,51 +55404,16 @@ function getDefaultViewerSettings() {
55512
55404
  }
55513
55405
  },
55514
55406
  background: { color: new Color(16777215) },
55515
- skybox: {
55516
- enable: true,
55517
- skyColor: new Color(16777215),
55518
- // white
55519
- groundColor: new Color(16185078),
55520
- // less white
55521
- sharpness: 2
55522
- },
55523
- skylight: {
55524
- skyColor: new Color(16777215),
55525
- groundColor: new Color(16777215),
55526
- intensity: 0.8
55527
- },
55528
- sunlights: [
55529
- {
55530
- followCamera: true,
55531
- position: new Vector3(1e3, 1e3, 1e3),
55532
- color: new Color(16777215),
55533
- intensity: 0.8
55534
- },
55535
- {
55536
- followCamera: true,
55537
- position: new Vector3(-1e3, -1e3, -1e3),
55538
- color: new Color(16777215),
55539
- intensity: 0.2
55540
- }
55541
- ],
55542
55407
  materials: {
55543
- useFastMaterials: false,
55544
- standard: {
55545
- color: new Color(13421772)
55546
- },
55547
55408
  ghost: {
55548
55409
  color: new Color(921102),
55549
55410
  opacity: 7 / 255
55550
55411
  },
55551
- section: {
55552
- strokeWidth: 0.01,
55553
- strokeFalloff: 0.75,
55554
- strokeColor: new Color(16185078)
55555
- },
55556
55412
  outline: {
55557
- intensity: 3,
55413
+ opacity: 0.85,
55558
55414
  color: new Color(65535),
55559
- scale: 0.75
55415
+ scale: 0.75,
55416
+ thickness: 2
55560
55417
  }
55561
55418
  },
55562
55419
  axes: getDefaultAxesSettings(),
@@ -55727,11 +55584,11 @@ let Viewport$1 = class Viewport {
55727
55584
  this._unregisterResize = () => window.removeEventListener("resize", onResize);
55728
55585
  }
55729
55586
  };
55730
- function createInputHandler(viewer) {
55587
+ function createInputHandler(viewer, controls) {
55731
55588
  return new InputHandler(
55732
55589
  viewer.viewport.canvas,
55733
55590
  createAdapter$2(viewer),
55734
- viewer.settings.camera.controls
55591
+ controls
55735
55592
  );
55736
55593
  }
55737
55594
  function createAdapter$2(viewer) {
@@ -56243,24 +56100,17 @@ class RenderPass extends Pass {
56243
56100
  }
56244
56101
  }
56245
56102
  class OutlinePass extends Pass {
56246
- constructor(camera2, material) {
56103
+ constructor(material) {
56247
56104
  super();
56248
56105
  __publicField(this, "_fsQuad");
56249
56106
  __publicField(this, "material");
56250
- this.material = material ?? new OutlineMaterial();
56251
- this.material.camera = camera2;
56107
+ this.material = material;
56252
56108
  this._fsQuad = new FullScreenQuad(this.material.three);
56253
56109
  this.needsSwap = true;
56254
56110
  }
56255
56111
  setSize(width, height) {
56256
56112
  this.material.resolution = new Vector2(width, height);
56257
56113
  }
56258
- get camera() {
56259
- return this.material.camera;
56260
- }
56261
- set camera(value) {
56262
- this.material.camera = value;
56263
- }
56264
56114
  dispose() {
56265
56115
  this._fsQuad.dispose();
56266
56116
  this.material.dispose();
@@ -56268,7 +56118,6 @@ class OutlinePass extends Pass {
56268
56118
  render(renderer, writeBuffer, readBuffer) {
56269
56119
  const depthBufferValue = writeBuffer.depthBuffer;
56270
56120
  writeBuffer.depthBuffer = false;
56271
- this.material.depthBuffer = readBuffer.depthTexture;
56272
56121
  this.material.sceneBuffer = readBuffer.texture;
56273
56122
  if (this.renderToScreen) {
56274
56123
  renderer.setRenderTarget(null);
@@ -56445,8 +56294,7 @@ class RenderingComposer {
56445
56294
  outlineHeight,
56446
56295
  {
56447
56296
  format: RedFormat,
56448
- type: UnsignedByteType,
56449
- depthTexture: new DepthTexture(outlineWidth, outlineHeight)
56297
+ type: UnsignedByteType
56450
56298
  }
56451
56299
  );
56452
56300
  this._outlineTarget.texture.name = "selectionTarget";
@@ -56460,7 +56308,6 @@ class RenderingComposer {
56460
56308
  this._selectionRenderPass.clearAlpha = 0;
56461
56309
  this._composer.addPass(this._selectionRenderPass);
56462
56310
  this._outlinePass = new OutlinePass(
56463
- this._camera,
56464
56311
  this._materials.system.outline
56465
56312
  );
56466
56313
  this._composer.addPass(this._outlinePass);
@@ -56513,7 +56360,6 @@ class RenderingComposer {
56513
56360
  set camera(value) {
56514
56361
  this._renderPass.camera = value;
56515
56362
  this._selectionRenderPass.camera = value;
56516
- this._outlinePass.material.camera = value;
56517
56363
  this._camera = value;
56518
56364
  }
56519
56365
  /**
@@ -57557,16 +57403,12 @@ let LoadRequest$2 = class LoadRequest2 extends LoadRequest$3 {
57557
57403
  }
57558
57404
  };
57559
57405
  class WebglViewer {
57560
- constructor(settings2) {
57406
+ constructor(options) {
57561
57407
  /**
57562
57408
  * The type of the viewer, indicating it is a WebGL viewer.
57563
57409
  * Useful for distinguishing between different viewer types in a multi-viewer application.
57564
57410
  */
57565
57411
  __publicField(this, "type", "webgl");
57566
- /**
57567
- * The settings configuration used by the viewer.
57568
- */
57569
- __publicField(this, "settings");
57570
57412
  __publicField(this, "_renderer");
57571
57413
  __publicField(this, "_viewport");
57572
57414
  /**
@@ -57586,22 +57428,22 @@ class WebglViewer {
57586
57428
  __publicField(this, "vimCollection", new VimCollection());
57587
57429
  __publicField(this, "_onVimLoaded", new distExports$2.SignalDispatcher());
57588
57430
  __publicField(this, "_updateId");
57589
- this.settings = createViewerSettings(settings2);
57431
+ const settings2 = createViewerSettings(options);
57590
57432
  this._materials = Materials.getInstance();
57591
57433
  const scene = new RenderScene();
57592
- this._viewport = new Viewport$1(this.settings);
57593
- this._camera = new Camera$1(scene, this._viewport, this.settings);
57434
+ this._viewport = new Viewport$1(settings2);
57435
+ this._camera = new Camera$1(scene, this._viewport, settings2);
57594
57436
  this._renderer = new Renderer$1(
57595
57437
  scene,
57596
57438
  this._viewport,
57597
57439
  this._materials,
57598
57440
  this._camera,
57599
- this.settings
57441
+ settings2
57600
57442
  );
57601
57443
  this.selection = createSelection$1();
57602
- this._inputs = createInputHandler(this);
57603
- this._gizmos = new Gizmos(this._renderer, this._viewport, this, this._camera);
57604
- this.materials.applySettings(this.settings.materials);
57444
+ this._inputs = createInputHandler(this, settings2.camera.controls);
57445
+ this._gizmos = new Gizmos(this._renderer, this._viewport, this, this._camera, settings2);
57446
+ this.materials.applySettings(settings2.materials);
57605
57447
  const size = this._renderer.three.getSize(new Vector2());
57606
57448
  const gpuPicker = new GpuPicker(
57607
57449
  this._renderer.three,