vim-web 0.6.0-dev.10 → 0.6.0-dev.12
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.d.ts +0 -98
- package/dist/vim-web.iife.js +27 -221
- package/dist/vim-web.iife.js.map +1 -1
- package/dist/vim-web.js +27 -221
- package/dist/vim-web.js.map +1 -1
- package/package.json +1 -1
package/dist/vim-web.d.ts
CHANGED
|
@@ -90,20 +90,6 @@ type RecursivePartial<T> = {
|
|
|
90
90
|
*/
|
|
91
91
|
|
|
92
92
|
type MaterialSettings = {
|
|
93
|
-
/**
|
|
94
|
-
* Use fast simple materials instead of standard Lambert materials
|
|
95
|
-
* - Enables: Significantly faster rendering (no Lambert lighting calculations)
|
|
96
|
-
* - Trade-off: Simpler pseudo-lighting using screen-space derivatives
|
|
97
|
-
* - Useful for: Performance-critical scenarios, large models, lower-end hardware
|
|
98
|
-
* Default: false
|
|
99
|
-
*/
|
|
100
|
-
useFastMaterials: boolean;
|
|
101
|
-
/**
|
|
102
|
-
* Default color of standard material
|
|
103
|
-
*/
|
|
104
|
-
standard: {
|
|
105
|
-
color: THREE.Color;
|
|
106
|
-
};
|
|
107
93
|
/**
|
|
108
94
|
* Ghost material options
|
|
109
95
|
*/
|
|
@@ -120,26 +106,6 @@ type MaterialSettings = {
|
|
|
120
106
|
opacity: number;
|
|
121
107
|
};
|
|
122
108
|
/**
|
|
123
|
-
* Section box intersection highlight options
|
|
124
|
-
*/
|
|
125
|
-
section: {
|
|
126
|
-
/**
|
|
127
|
-
* Intersection highlight stroke width.
|
|
128
|
-
* Default: 0.01
|
|
129
|
-
*/
|
|
130
|
-
strokeWidth: number;
|
|
131
|
-
/**
|
|
132
|
-
* Intersection highlight stroke falloff.
|
|
133
|
-
* Default: 0.75
|
|
134
|
-
*/
|
|
135
|
-
strokeFalloff: number;
|
|
136
|
-
/**
|
|
137
|
-
* Intersection highlight stroke color.
|
|
138
|
-
* Default: rgb(246, 246, 246)
|
|
139
|
-
*/
|
|
140
|
-
strokeColor: THREE.Color;
|
|
141
|
-
};
|
|
142
|
-
/**
|
|
143
109
|
* Selection outline options
|
|
144
110
|
*/
|
|
145
111
|
outline: {
|
|
@@ -175,7 +141,6 @@ type MaterialSettings = {
|
|
|
175
141
|
* @example
|
|
176
142
|
* const viewer = Core.Webgl.createViewer({
|
|
177
143
|
* camera: { orthographic: true, fov: 50 },
|
|
178
|
-
* materials: { useFastMaterials: true }
|
|
179
144
|
* })
|
|
180
145
|
*/
|
|
181
146
|
type ViewerSettings = {
|
|
@@ -316,27 +281,6 @@ type ViewerSettings = {
|
|
|
316
281
|
*/
|
|
317
282
|
color: THREE.Color;
|
|
318
283
|
};
|
|
319
|
-
/**
|
|
320
|
-
* Skybox options
|
|
321
|
-
*/
|
|
322
|
-
skybox: {
|
|
323
|
-
/**
|
|
324
|
-
* Enables/Disables skybox.
|
|
325
|
-
*/
|
|
326
|
-
enable: boolean;
|
|
327
|
-
/**
|
|
328
|
-
* Color for the lower part of the skybox.
|
|
329
|
-
*/
|
|
330
|
-
groundColor: THREE.Color;
|
|
331
|
-
/**
|
|
332
|
-
* Color for the upper part of the skybox.
|
|
333
|
-
*/
|
|
334
|
-
skyColor: THREE.Color;
|
|
335
|
-
/**
|
|
336
|
-
* Controls the gradient transition between the sky and the ground.
|
|
337
|
-
*/
|
|
338
|
-
sharpness: number;
|
|
339
|
-
};
|
|
340
284
|
/**
|
|
341
285
|
* Material options
|
|
342
286
|
*/
|
|
@@ -345,39 +289,6 @@ type ViewerSettings = {
|
|
|
345
289
|
* Axes gizmo options
|
|
346
290
|
*/
|
|
347
291
|
axes: Partial<AxesSettings>;
|
|
348
|
-
/**
|
|
349
|
-
* Skylight (hemisphere light) options
|
|
350
|
-
*/
|
|
351
|
-
skylight: {
|
|
352
|
-
/**
|
|
353
|
-
* Skylight sky Color.
|
|
354
|
-
* Default: THREE.Color(153, 204, 255)
|
|
355
|
-
*/
|
|
356
|
-
skyColor: THREE.Color;
|
|
357
|
-
/**
|
|
358
|
-
* Skylight ground color.
|
|
359
|
-
* Default: THREE.Color(242, 213, 181)
|
|
360
|
-
*/
|
|
361
|
-
groundColor: THREE.Color;
|
|
362
|
-
/**
|
|
363
|
-
* Skylight intensity.
|
|
364
|
-
* Default: 0.8
|
|
365
|
-
*/
|
|
366
|
-
intensity: number;
|
|
367
|
-
};
|
|
368
|
-
/**
|
|
369
|
-
* Sunlight (directional light) options
|
|
370
|
-
* Two Blue-Green lights at odd angles. See defaultViewerSettings.
|
|
371
|
-
*/
|
|
372
|
-
sunlights: {
|
|
373
|
-
followCamera: boolean;
|
|
374
|
-
/** Light position. */
|
|
375
|
-
position: THREE.Vector3;
|
|
376
|
-
/** Light color. */
|
|
377
|
-
color: THREE.Color;
|
|
378
|
-
/** Light intensity. */
|
|
379
|
-
intensity: number;
|
|
380
|
-
}[];
|
|
381
292
|
rendering: {
|
|
382
293
|
/**
|
|
383
294
|
* When true, only renders when changes are detected. When false, renders every frame.
|
|
@@ -452,8 +363,6 @@ interface IMaterials {
|
|
|
452
363
|
readonly modelTransparentMaterial: THREE.Material;
|
|
453
364
|
/** The ghost material used to render hidden/ghosted elements. */
|
|
454
365
|
readonly ghostMaterial: THREE.Material;
|
|
455
|
-
/** Base color tint applied to opaque and transparent model materials. */
|
|
456
|
-
modelColor: THREE.Color;
|
|
457
366
|
/** Opacity of the ghost material (0 = invisible, 1 = fully opaque). */
|
|
458
367
|
ghostOpacity: number;
|
|
459
368
|
/** Color of the ghost material. */
|
|
@@ -464,12 +373,6 @@ interface IMaterials {
|
|
|
464
373
|
outlineThickness: number;
|
|
465
374
|
/** Color of the selection outline post-process effect. */
|
|
466
375
|
outlineColor: THREE.Color;
|
|
467
|
-
/** Width of the stroke rendered where the section box intersects the model. */
|
|
468
|
-
sectionStrokeWidth: number;
|
|
469
|
-
/** Gradient falloff of the section box intersection stroke. */
|
|
470
|
-
sectionStrokeFalloff: number;
|
|
471
|
-
/** Color of the section box intersection stroke. */
|
|
472
|
-
sectionStrokeColor: THREE.Color;
|
|
473
376
|
/** Clipping planes applied to all materials. Set to undefined to disable clipping. */
|
|
474
377
|
clippingPlanes: THREE.Plane[] | undefined;
|
|
475
378
|
/** Applies a full set of material settings from the viewer configuration. */
|
|
@@ -1659,7 +1562,6 @@ interface IWebglRenderer {
|
|
|
1659
1562
|
*/
|
|
1660
1563
|
interface IWebglViewer {
|
|
1661
1564
|
readonly type: 'webgl';
|
|
1662
|
-
readonly settings: ViewerSettings;
|
|
1663
1565
|
readonly renderer: IWebglRenderer;
|
|
1664
1566
|
readonly viewport: IWebglViewport;
|
|
1665
1567
|
readonly selection: IWebglSelection;
|
package/dist/vim-web.iife.js
CHANGED
|
@@ -47544,25 +47544,6 @@ void main() {
|
|
|
47544
47544
|
};
|
|
47545
47545
|
__publicField(_CameraMovementSnap, "_ZERO", new Vector3());
|
|
47546
47546
|
let CameraMovementSnap = _CameraMovementSnap;
|
|
47547
|
-
function createOpaque() {
|
|
47548
|
-
return new StandardMaterial(createBasicOpaque());
|
|
47549
|
-
}
|
|
47550
|
-
function createTransparent() {
|
|
47551
|
-
return new StandardMaterial(createBasicTransparent());
|
|
47552
|
-
}
|
|
47553
|
-
function createBasicOpaque() {
|
|
47554
|
-
return new MeshLambertMaterial({
|
|
47555
|
-
color: 13421772,
|
|
47556
|
-
flatShading: true,
|
|
47557
|
-
side: DoubleSide
|
|
47558
|
-
});
|
|
47559
|
-
}
|
|
47560
|
-
function createBasicTransparent() {
|
|
47561
|
-
const mat = createBasicOpaque();
|
|
47562
|
-
mat.transparent = true;
|
|
47563
|
-
mat.opacity = 0.25;
|
|
47564
|
-
return mat;
|
|
47565
|
-
}
|
|
47566
47547
|
class StandardMaterial {
|
|
47567
47548
|
constructor(material) {
|
|
47568
47549
|
__publicField(this, "three");
|
|
@@ -53777,7 +53758,7 @@ void main() {
|
|
|
53777
53758
|
}
|
|
53778
53759
|
};
|
|
53779
53760
|
class Gizmos {
|
|
53780
|
-
constructor(renderer, viewport, viewer, camera2) {
|
|
53761
|
+
constructor(renderer, viewport, viewer, camera2, settings2) {
|
|
53781
53762
|
__publicField(this, "_viewport");
|
|
53782
53763
|
__publicField(this, "_measure");
|
|
53783
53764
|
/**
|
|
@@ -53804,9 +53785,9 @@ void main() {
|
|
|
53804
53785
|
renderer,
|
|
53805
53786
|
camera2,
|
|
53806
53787
|
viewer.inputs,
|
|
53807
|
-
|
|
53788
|
+
settings2
|
|
53808
53789
|
);
|
|
53809
|
-
this.axes = new GizmoAxes(camera2, viewport,
|
|
53790
|
+
this.axes = new GizmoAxes(camera2, viewport, settings2.axes);
|
|
53810
53791
|
this.markers = new GizmoMarkers(renderer, viewer.selection);
|
|
53811
53792
|
(_a3 = viewport.canvas.parentElement) == null ? void 0 : _a3.prepend(this.axes.canvas);
|
|
53812
53793
|
}
|
|
@@ -54209,33 +54190,13 @@ void main() {
|
|
|
54209
54190
|
});
|
|
54210
54191
|
}
|
|
54211
54192
|
class OutlineMaterial {
|
|
54212
|
-
constructor(
|
|
54193
|
+
constructor(onUpdate) {
|
|
54213
54194
|
__publicField(this, "three");
|
|
54214
|
-
__publicField(this, "_camera");
|
|
54215
54195
|
__publicField(this, "_resolution");
|
|
54216
|
-
__publicField(this, "_precision", 1);
|
|
54217
54196
|
__publicField(this, "_onUpdate");
|
|
54218
54197
|
this.three = createOutlineMaterial();
|
|
54219
54198
|
this._onUpdate = onUpdate;
|
|
54220
|
-
this.
|
|
54221
|
-
this._resolution = (options == null ? void 0 : options.resolution) ?? new Vector2(1, 1);
|
|
54222
|
-
this.resolution = this._resolution;
|
|
54223
|
-
if (options == null ? void 0 : options.sceneBuffer) {
|
|
54224
|
-
this.sceneBuffer = options.sceneBuffer;
|
|
54225
|
-
}
|
|
54226
|
-
this.camera = options == null ? void 0 : options.camera;
|
|
54227
|
-
}
|
|
54228
|
-
/**
|
|
54229
|
-
* Precision of the outline. This is used to scale the resolution of the outline.
|
|
54230
|
-
*/
|
|
54231
|
-
get precision() {
|
|
54232
|
-
return this._precision;
|
|
54233
|
-
}
|
|
54234
|
-
set precision(value) {
|
|
54235
|
-
var _a3;
|
|
54236
|
-
this._precision = value;
|
|
54237
|
-
this.resolution = this._resolution;
|
|
54238
|
-
(_a3 = this._onUpdate) == null ? void 0 : _a3.call(this);
|
|
54199
|
+
this._resolution = new Vector2(1, 1);
|
|
54239
54200
|
}
|
|
54240
54201
|
/**
|
|
54241
54202
|
* Resolution of the outline. This should match the resolution of screen.
|
|
@@ -54246,29 +54207,15 @@ void main() {
|
|
|
54246
54207
|
set resolution(value) {
|
|
54247
54208
|
var _a3;
|
|
54248
54209
|
this.three.uniforms.screenSize.value.set(
|
|
54249
|
-
value.x
|
|
54250
|
-
value.y
|
|
54251
|
-
1 /
|
|
54252
|
-
1 /
|
|
54210
|
+
value.x,
|
|
54211
|
+
value.y,
|
|
54212
|
+
1 / value.x,
|
|
54213
|
+
1 / value.y
|
|
54253
54214
|
);
|
|
54254
54215
|
this._resolution = value;
|
|
54255
54216
|
this.three.uniformsNeedUpdate = true;
|
|
54256
54217
|
(_a3 = this._onUpdate) == null ? void 0 : _a3.call(this);
|
|
54257
54218
|
}
|
|
54258
|
-
/**
|
|
54259
|
-
* Camera used to render the outline.
|
|
54260
|
-
*/
|
|
54261
|
-
get camera() {
|
|
54262
|
-
return this._camera;
|
|
54263
|
-
}
|
|
54264
|
-
set camera(value) {
|
|
54265
|
-
var _a3;
|
|
54266
|
-
this._camera = value;
|
|
54267
|
-
this.three.uniforms.cameraNear.value = (value == null ? void 0 : value.near) ?? 1;
|
|
54268
|
-
this.three.uniforms.cameraFar.value = (value == null ? void 0 : value.far) ?? 1e3;
|
|
54269
|
-
this.three.uniformsNeedUpdate = true;
|
|
54270
|
-
(_a3 = this._onUpdate) == null ? void 0 : _a3.call(this);
|
|
54271
|
-
}
|
|
54272
54219
|
/**
|
|
54273
54220
|
* Thickness of the outline in pixels (of the outline render target).
|
|
54274
54221
|
*/
|
|
@@ -54281,18 +54228,6 @@ void main() {
|
|
|
54281
54228
|
this.three.uniformsNeedUpdate = true;
|
|
54282
54229
|
(_a3 = this._onUpdate) == null ? void 0 : _a3.call(this);
|
|
54283
54230
|
}
|
|
54284
|
-
/**
|
|
54285
|
-
* Color of the outline.
|
|
54286
|
-
*/
|
|
54287
|
-
get color() {
|
|
54288
|
-
return this.three.uniforms.outlineColor.value;
|
|
54289
|
-
}
|
|
54290
|
-
set color(value) {
|
|
54291
|
-
var _a3;
|
|
54292
|
-
this.three.uniforms.outlineColor.value.set(value);
|
|
54293
|
-
this.three.uniformsNeedUpdate = true;
|
|
54294
|
-
(_a3 = this._onUpdate) == null ? void 0 : _a3.call(this);
|
|
54295
|
-
}
|
|
54296
54231
|
/**
|
|
54297
54232
|
* Scene buffer used to render the outline.
|
|
54298
54233
|
*/
|
|
@@ -54305,18 +54240,6 @@ void main() {
|
|
|
54305
54240
|
this.three.uniformsNeedUpdate = true;
|
|
54306
54241
|
(_a3 = this._onUpdate) == null ? void 0 : _a3.call(this);
|
|
54307
54242
|
}
|
|
54308
|
-
/**
|
|
54309
|
-
* Depth buffer used to render the outline.
|
|
54310
|
-
*/
|
|
54311
|
-
get depthBuffer() {
|
|
54312
|
-
return this.three.uniforms.depthBuffer.value;
|
|
54313
|
-
}
|
|
54314
|
-
set depthBuffer(value) {
|
|
54315
|
-
var _a3;
|
|
54316
|
-
this.three.uniforms.depthBuffer.value = value;
|
|
54317
|
-
this.three.uniformsNeedUpdate = true;
|
|
54318
|
-
(_a3 = this._onUpdate) == null ? void 0 : _a3.call(this);
|
|
54319
|
-
}
|
|
54320
54243
|
/**
|
|
54321
54244
|
* Dispose of the outline material.
|
|
54322
54245
|
*/
|
|
@@ -54330,17 +54253,8 @@ void main() {
|
|
|
54330
54253
|
glslVersion: GLSL3,
|
|
54331
54254
|
depthWrite: false,
|
|
54332
54255
|
uniforms: {
|
|
54333
|
-
// Input buffers
|
|
54334
54256
|
sceneBuffer: { value: null },
|
|
54335
|
-
|
|
54336
|
-
// Input parameters
|
|
54337
|
-
cameraNear: { value: 1 },
|
|
54338
|
-
cameraFar: { value: 1e3 },
|
|
54339
|
-
screenSize: {
|
|
54340
|
-
value: new Vector4(1, 1, 1, 1)
|
|
54341
|
-
},
|
|
54342
|
-
// Options
|
|
54343
|
-
outlineColor: { value: new Color(16777215) },
|
|
54257
|
+
screenSize: { value: new Vector4(1, 1, 1, 1) },
|
|
54344
54258
|
thickness: { value: 2 }
|
|
54345
54259
|
},
|
|
54346
54260
|
vertexShader: `
|
|
@@ -54638,9 +54552,7 @@ void main() {
|
|
|
54638
54552
|
mesh.visible = true;
|
|
54639
54553
|
}
|
|
54640
54554
|
const _Materials = class _Materials {
|
|
54641
|
-
constructor(
|
|
54642
|
-
__publicField(this, "_opaque");
|
|
54643
|
-
__publicField(this, "_transparent");
|
|
54555
|
+
constructor(modelOpaque, modelTransparent, ghost2, mask, outline, merge) {
|
|
54644
54556
|
__publicField(this, "_modelOpaque");
|
|
54645
54557
|
__publicField(this, "_modelTransparent");
|
|
54646
54558
|
__publicField(this, "_ghost");
|
|
@@ -54649,20 +54561,15 @@ void main() {
|
|
|
54649
54561
|
__publicField(this, "_outline");
|
|
54650
54562
|
__publicField(this, "_merge");
|
|
54651
54563
|
__publicField(this, "_clippingPlanes");
|
|
54652
|
-
__publicField(this, "_sectionStrokeWidth", 0.01);
|
|
54653
|
-
__publicField(this, "_sectionStrokeFalloff", 0.75);
|
|
54654
|
-
__publicField(this, "_sectionStrokeColor", new Color(16185078));
|
|
54655
54564
|
__publicField(this, "_onUpdate", new distExports$2.SignalDispatcher());
|
|
54656
54565
|
// Shared color palette texture for all scene materials
|
|
54657
54566
|
__publicField(this, "_colorPaletteTexture");
|
|
54658
|
-
this._opaque = opaque ?? createOpaque();
|
|
54659
|
-
this._transparent = transparent ?? createTransparent();
|
|
54660
54567
|
const onUpdate = () => this._onUpdate.dispatch();
|
|
54661
54568
|
this._modelOpaque = modelOpaque ?? createModelOpaque(onUpdate);
|
|
54662
54569
|
this._modelTransparent = modelTransparent ?? createModelTransparent(onUpdate);
|
|
54663
54570
|
this._ghost = ghost2 ?? new GhostMaterial(void 0, onUpdate);
|
|
54664
54571
|
this._mask = mask ?? createMaskMaterial();
|
|
54665
|
-
this._outline = outline ?? new OutlineMaterial(
|
|
54572
|
+
this._outline = outline ?? new OutlineMaterial(onUpdate);
|
|
54666
54573
|
this._merge = merge ?? new MergeMaterial(onUpdate);
|
|
54667
54574
|
}
|
|
54668
54575
|
static createInstance(instance) {
|
|
@@ -54708,12 +54615,8 @@ void main() {
|
|
|
54708
54615
|
* Updates material settings based on the provided configuration.
|
|
54709
54616
|
*/
|
|
54710
54617
|
applySettings(settings2) {
|
|
54711
|
-
this.modelColor = settings2.standard.color;
|
|
54712
54618
|
this._ghost.opacity = settings2.ghost.opacity;
|
|
54713
54619
|
this._ghost.color = settings2.ghost.color;
|
|
54714
|
-
this.sectionStrokeWidth = settings2.section.strokeWidth;
|
|
54715
|
-
this.sectionStrokeFalloff = settings2.section.strokeFalloff;
|
|
54716
|
-
this.sectionStrokeColor = settings2.section.strokeColor;
|
|
54717
54620
|
this.outlineOpacity = settings2.outline.opacity;
|
|
54718
54621
|
this.outlineColor = settings2.outline.color;
|
|
54719
54622
|
this.outlineThickness = settings2.outline.thickness;
|
|
@@ -54722,15 +54625,6 @@ void main() {
|
|
|
54722
54625
|
get onUpdate() {
|
|
54723
54626
|
return this._onUpdate.asEvent();
|
|
54724
54627
|
}
|
|
54725
|
-
/** Base color tint applied to opaque and transparent model materials. */
|
|
54726
|
-
get modelColor() {
|
|
54727
|
-
return this._opaque.color;
|
|
54728
|
-
}
|
|
54729
|
-
set modelColor(color) {
|
|
54730
|
-
this._opaque.color = color;
|
|
54731
|
-
this._transparent.color = color;
|
|
54732
|
-
this._onUpdate.dispatch();
|
|
54733
|
-
}
|
|
54734
54628
|
/** Opacity of the selection outline (0 = invisible, 1 = fully opaque). */
|
|
54735
54629
|
get outlineOpacity() {
|
|
54736
54630
|
return this._merge.opacity;
|
|
@@ -54760,45 +54654,10 @@ void main() {
|
|
|
54760
54654
|
this._clippingPlanes = value;
|
|
54761
54655
|
this._modelOpaque.clippingPlanes = value ?? null;
|
|
54762
54656
|
this._modelTransparent.clippingPlanes = value ?? null;
|
|
54763
|
-
this._opaque.clippingPlanes = value ?? null;
|
|
54764
|
-
this._transparent.clippingPlanes = value ?? null;
|
|
54765
54657
|
this._ghost.clippingPlanes = value ?? null;
|
|
54766
54658
|
this._mask.clippingPlanes = value ?? null;
|
|
54767
54659
|
this._onUpdate.dispatch();
|
|
54768
54660
|
}
|
|
54769
|
-
/** Width of the stroke rendered where the section box intersects the model. */
|
|
54770
|
-
get sectionStrokeWidth() {
|
|
54771
|
-
return this._sectionStrokeWidth;
|
|
54772
|
-
}
|
|
54773
|
-
set sectionStrokeWidth(value) {
|
|
54774
|
-
if (this._sectionStrokeWidth === value) return;
|
|
54775
|
-
this._sectionStrokeWidth = value;
|
|
54776
|
-
this._opaque.sectionStrokeWidth = value;
|
|
54777
|
-
this._transparent.sectionStrokeWidth = value;
|
|
54778
|
-
this._onUpdate.dispatch();
|
|
54779
|
-
}
|
|
54780
|
-
/** Gradient falloff of the section box intersection stroke. */
|
|
54781
|
-
get sectionStrokeFalloff() {
|
|
54782
|
-
return this._sectionStrokeFalloff;
|
|
54783
|
-
}
|
|
54784
|
-
set sectionStrokeFalloff(value) {
|
|
54785
|
-
if (this._sectionStrokeFalloff === value) return;
|
|
54786
|
-
this._sectionStrokeFalloff = value;
|
|
54787
|
-
this._opaque.sectionStrokeFalloff = value;
|
|
54788
|
-
this._transparent.sectionStrokeFalloff = value;
|
|
54789
|
-
this._onUpdate.dispatch();
|
|
54790
|
-
}
|
|
54791
|
-
/** Color of the section box intersection stroke. */
|
|
54792
|
-
get sectionStrokeColor() {
|
|
54793
|
-
return this._sectionStrokeColor;
|
|
54794
|
-
}
|
|
54795
|
-
set sectionStrokeColor(value) {
|
|
54796
|
-
if (this._sectionStrokeColor === value) return;
|
|
54797
|
-
this._sectionStrokeColor = value;
|
|
54798
|
-
this._opaque.sectionStrokeColor = value;
|
|
54799
|
-
this._transparent.sectionStrokeColor = value;
|
|
54800
|
-
this._onUpdate.dispatch();
|
|
54801
|
-
}
|
|
54802
54661
|
/**
|
|
54803
54662
|
* Creates the fixed quantized color palette texture if it doesn't exist.
|
|
54804
54663
|
* The palette is deterministic (25³ = 15,625 quantized colors in 128×128 texture)
|
|
@@ -54808,6 +54667,8 @@ void main() {
|
|
|
54808
54667
|
if (this._colorPaletteTexture) return;
|
|
54809
54668
|
const textureData = buildPaletteTexture();
|
|
54810
54669
|
this._colorPaletteTexture = new DataTexture(
|
|
54670
|
+
// Cast: TS 5.7 narrows Uint8Array.buffer to ArrayBufferLike (includes SharedArrayBuffer),
|
|
54671
|
+
// but Three.js expects BufferSource (ArrayBuffer only). Safe — Uint8Array always backs ArrayBuffer.
|
|
54811
54672
|
textureData,
|
|
54812
54673
|
128,
|
|
54813
54674
|
128,
|
|
@@ -54817,8 +54678,6 @@ void main() {
|
|
|
54817
54678
|
this._colorPaletteTexture.needsUpdate = true;
|
|
54818
54679
|
this._colorPaletteTexture.minFilter = NearestFilter;
|
|
54819
54680
|
this._colorPaletteTexture.magFilter = NearestFilter;
|
|
54820
|
-
this._opaque.setColorPaletteTexture(this._colorPaletteTexture);
|
|
54821
|
-
this._transparent.setColorPaletteTexture(this._colorPaletteTexture);
|
|
54822
54681
|
this._modelOpaque.setColorPaletteTexture(this._colorPaletteTexture);
|
|
54823
54682
|
this._modelTransparent.setColorPaletteTexture(this._colorPaletteTexture);
|
|
54824
54683
|
this._onUpdate.dispatch();
|
|
@@ -54829,8 +54688,6 @@ void main() {
|
|
|
54829
54688
|
this._colorPaletteTexture.dispose();
|
|
54830
54689
|
this._colorPaletteTexture = void 0;
|
|
54831
54690
|
}
|
|
54832
|
-
this._opaque.dispose();
|
|
54833
|
-
this._transparent.dispose();
|
|
54834
54691
|
this._modelOpaque.dispose();
|
|
54835
54692
|
this._modelTransparent.dispose();
|
|
54836
54693
|
this._ghost.dispose();
|
|
@@ -55563,47 +55420,11 @@ void main() {
|
|
|
55563
55420
|
}
|
|
55564
55421
|
},
|
|
55565
55422
|
background: { color: new Color(16777215) },
|
|
55566
|
-
skybox: {
|
|
55567
|
-
enable: true,
|
|
55568
|
-
skyColor: new Color(16777215),
|
|
55569
|
-
// white
|
|
55570
|
-
groundColor: new Color(16185078),
|
|
55571
|
-
// less white
|
|
55572
|
-
sharpness: 2
|
|
55573
|
-
},
|
|
55574
|
-
skylight: {
|
|
55575
|
-
skyColor: new Color(16777215),
|
|
55576
|
-
groundColor: new Color(16777215),
|
|
55577
|
-
intensity: 0.8
|
|
55578
|
-
},
|
|
55579
|
-
sunlights: [
|
|
55580
|
-
{
|
|
55581
|
-
followCamera: true,
|
|
55582
|
-
position: new Vector3(1e3, 1e3, 1e3),
|
|
55583
|
-
color: new Color(16777215),
|
|
55584
|
-
intensity: 0.8
|
|
55585
|
-
},
|
|
55586
|
-
{
|
|
55587
|
-
followCamera: true,
|
|
55588
|
-
position: new Vector3(-1e3, -1e3, -1e3),
|
|
55589
|
-
color: new Color(16777215),
|
|
55590
|
-
intensity: 0.2
|
|
55591
|
-
}
|
|
55592
|
-
],
|
|
55593
55423
|
materials: {
|
|
55594
|
-
useFastMaterials: false,
|
|
55595
|
-
standard: {
|
|
55596
|
-
color: new Color(13421772)
|
|
55597
|
-
},
|
|
55598
55424
|
ghost: {
|
|
55599
55425
|
color: new Color(921102),
|
|
55600
55426
|
opacity: 7 / 255
|
|
55601
55427
|
},
|
|
55602
|
-
section: {
|
|
55603
|
-
strokeWidth: 0.01,
|
|
55604
|
-
strokeFalloff: 0.75,
|
|
55605
|
-
strokeColor: new Color(16185078)
|
|
55606
|
-
},
|
|
55607
55428
|
outline: {
|
|
55608
55429
|
opacity: 0.85,
|
|
55609
55430
|
color: new Color(65535),
|
|
@@ -55779,11 +55600,11 @@ void main() {
|
|
|
55779
55600
|
this._unregisterResize = () => window.removeEventListener("resize", onResize);
|
|
55780
55601
|
}
|
|
55781
55602
|
};
|
|
55782
|
-
function createInputHandler(viewer) {
|
|
55603
|
+
function createInputHandler(viewer, controls) {
|
|
55783
55604
|
return new InputHandler(
|
|
55784
55605
|
viewer.viewport.canvas,
|
|
55785
55606
|
createAdapter$2(viewer),
|
|
55786
|
-
|
|
55607
|
+
controls
|
|
55787
55608
|
);
|
|
55788
55609
|
}
|
|
55789
55610
|
function createAdapter$2(viewer) {
|
|
@@ -56295,24 +56116,17 @@ void main() {
|
|
|
56295
56116
|
}
|
|
56296
56117
|
}
|
|
56297
56118
|
class OutlinePass extends Pass {
|
|
56298
|
-
constructor(
|
|
56119
|
+
constructor(material) {
|
|
56299
56120
|
super();
|
|
56300
56121
|
__publicField(this, "_fsQuad");
|
|
56301
56122
|
__publicField(this, "material");
|
|
56302
|
-
this.material = material
|
|
56303
|
-
this.material.camera = camera2;
|
|
56123
|
+
this.material = material;
|
|
56304
56124
|
this._fsQuad = new FullScreenQuad(this.material.three);
|
|
56305
56125
|
this.needsSwap = true;
|
|
56306
56126
|
}
|
|
56307
56127
|
setSize(width, height) {
|
|
56308
56128
|
this.material.resolution = new Vector2(width, height);
|
|
56309
56129
|
}
|
|
56310
|
-
get camera() {
|
|
56311
|
-
return this.material.camera;
|
|
56312
|
-
}
|
|
56313
|
-
set camera(value) {
|
|
56314
|
-
this.material.camera = value;
|
|
56315
|
-
}
|
|
56316
56130
|
dispose() {
|
|
56317
56131
|
this._fsQuad.dispose();
|
|
56318
56132
|
this.material.dispose();
|
|
@@ -56320,7 +56134,6 @@ void main() {
|
|
|
56320
56134
|
render(renderer, writeBuffer, readBuffer) {
|
|
56321
56135
|
const depthBufferValue = writeBuffer.depthBuffer;
|
|
56322
56136
|
writeBuffer.depthBuffer = false;
|
|
56323
|
-
this.material.depthBuffer = readBuffer.depthTexture;
|
|
56324
56137
|
this.material.sceneBuffer = readBuffer.texture;
|
|
56325
56138
|
if (this.renderToScreen) {
|
|
56326
56139
|
renderer.setRenderTarget(null);
|
|
@@ -56497,8 +56310,7 @@ void main() {
|
|
|
56497
56310
|
outlineHeight,
|
|
56498
56311
|
{
|
|
56499
56312
|
format: RedFormat,
|
|
56500
|
-
type: UnsignedByteType
|
|
56501
|
-
depthTexture: new DepthTexture(outlineWidth, outlineHeight)
|
|
56313
|
+
type: UnsignedByteType
|
|
56502
56314
|
}
|
|
56503
56315
|
);
|
|
56504
56316
|
this._outlineTarget.texture.name = "selectionTarget";
|
|
@@ -56512,7 +56324,6 @@ void main() {
|
|
|
56512
56324
|
this._selectionRenderPass.clearAlpha = 0;
|
|
56513
56325
|
this._composer.addPass(this._selectionRenderPass);
|
|
56514
56326
|
this._outlinePass = new OutlinePass(
|
|
56515
|
-
this._camera,
|
|
56516
56327
|
this._materials.system.outline
|
|
56517
56328
|
);
|
|
56518
56329
|
this._composer.addPass(this._outlinePass);
|
|
@@ -56565,7 +56376,6 @@ void main() {
|
|
|
56565
56376
|
set camera(value) {
|
|
56566
56377
|
this._renderPass.camera = value;
|
|
56567
56378
|
this._selectionRenderPass.camera = value;
|
|
56568
|
-
this._outlinePass.material.camera = value;
|
|
56569
56379
|
this._camera = value;
|
|
56570
56380
|
}
|
|
56571
56381
|
/**
|
|
@@ -57609,16 +57419,12 @@ void main() {
|
|
|
57609
57419
|
}
|
|
57610
57420
|
};
|
|
57611
57421
|
class WebglViewer {
|
|
57612
|
-
constructor(
|
|
57422
|
+
constructor(options) {
|
|
57613
57423
|
/**
|
|
57614
57424
|
* The type of the viewer, indicating it is a WebGL viewer.
|
|
57615
57425
|
* Useful for distinguishing between different viewer types in a multi-viewer application.
|
|
57616
57426
|
*/
|
|
57617
57427
|
__publicField(this, "type", "webgl");
|
|
57618
|
-
/**
|
|
57619
|
-
* The settings configuration used by the viewer.
|
|
57620
|
-
*/
|
|
57621
|
-
__publicField(this, "settings");
|
|
57622
57428
|
__publicField(this, "_renderer");
|
|
57623
57429
|
__publicField(this, "_viewport");
|
|
57624
57430
|
/**
|
|
@@ -57638,22 +57444,22 @@ void main() {
|
|
|
57638
57444
|
__publicField(this, "vimCollection", new VimCollection());
|
|
57639
57445
|
__publicField(this, "_onVimLoaded", new distExports$2.SignalDispatcher());
|
|
57640
57446
|
__publicField(this, "_updateId");
|
|
57641
|
-
|
|
57447
|
+
const settings2 = createViewerSettings(options);
|
|
57642
57448
|
this._materials = Materials.getInstance();
|
|
57643
57449
|
const scene = new RenderScene();
|
|
57644
|
-
this._viewport = new Viewport$1(
|
|
57645
|
-
this._camera = new Camera$1(scene, this._viewport,
|
|
57450
|
+
this._viewport = new Viewport$1(settings2);
|
|
57451
|
+
this._camera = new Camera$1(scene, this._viewport, settings2);
|
|
57646
57452
|
this._renderer = new Renderer$1(
|
|
57647
57453
|
scene,
|
|
57648
57454
|
this._viewport,
|
|
57649
57455
|
this._materials,
|
|
57650
57456
|
this._camera,
|
|
57651
|
-
|
|
57457
|
+
settings2
|
|
57652
57458
|
);
|
|
57653
57459
|
this.selection = createSelection$1();
|
|
57654
|
-
this._inputs = createInputHandler(this);
|
|
57655
|
-
this._gizmos = new Gizmos(this._renderer, this._viewport, this, this._camera);
|
|
57656
|
-
this.materials.applySettings(
|
|
57460
|
+
this._inputs = createInputHandler(this, settings2.camera.controls);
|
|
57461
|
+
this._gizmos = new Gizmos(this._renderer, this._viewport, this, this._camera, settings2);
|
|
57462
|
+
this.materials.applySettings(settings2.materials);
|
|
57657
57463
|
const size = this._renderer.three.getSize(new Vector2());
|
|
57658
57464
|
const gpuPicker = new GpuPicker(
|
|
57659
57465
|
this._renderer.three,
|