vim-web 0.3.44-dev.0 → 0.3.44-dev.10
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/style.css +38 -1
- package/dist/types/core-viewers/ultra/index.d.ts +1 -1
- package/dist/types/core-viewers/ultra/utils/math3d.d.ts +11 -51
- package/dist/types/core-viewers/ultra/viewer/marshal.d.ts +0 -1
- package/dist/types/core-viewers/ultra/viewer/renderer.d.ts +3 -1
- package/dist/types/core-viewers/ultra/viewer/rpcClient.d.ts +1 -0
- package/dist/types/core-viewers/ultra/viewer/rpcSafeClient.d.ts +2 -0
- package/dist/types/core-viewers/ultra/viewer/sectionBox.d.ts +2 -5
- package/dist/types/core-viewers/ultra/viewer/selection.d.ts +2 -0
- package/dist/types/core-viewers/ultra/viewer/viewer.d.ts +2 -0
- package/dist/types/core-viewers/ultra/viewer/vimCollection.d.ts +4 -0
- package/dist/types/core-viewers/webgl/utils/threeUtils.d.ts +3 -0
- package/dist/types/core-viewers/webgl/viewer/gizmos/gizmos.d.ts +1 -1
- package/dist/types/core-viewers/webgl/viewer/gizmos/sectionBox/sectionBox.d.ts +1 -1
- package/dist/types/core-viewers/webgl/viewer/gizmos/sectionBox/sectionBoxGizmo.d.ts +2 -1
- package/dist/types/core-viewers/webgl/viewer/gizmos/sectionBox/sectionBoxHandle.d.ts +3 -0
- package/dist/types/core-viewers/webgl/viewer/gizmos/sectionBox/sectionBoxHandles.d.ts +2 -1
- package/dist/types/react-viewers/controlbar/controlBar.d.ts +6 -44
- package/dist/types/react-viewers/controlbar/controlBarButton.d.ts +3 -1
- package/dist/types/react-viewers/controlbar/controlBarIds.d.ts +27 -0
- package/dist/types/react-viewers/controlbar/controlBarSection.d.ts +2 -1
- package/dist/types/react-viewers/helpers/reactUtils.d.ts +14 -0
- package/dist/types/react-viewers/panels/icons.d.ts +6 -0
- package/dist/types/react-viewers/panels/sectionBoxPanel.d.ts +4 -0
- package/dist/types/react-viewers/state/controlBarState.d.ts +39 -0
- package/dist/types/react-viewers/state/sectionBoxState.d.ts +31 -0
- package/dist/types/react-viewers/ultra/ultraComponent.d.ts +18 -0
- package/dist/types/react-viewers/ultra/ultraControlBarState.d.ts +6 -0
- package/dist/types/react-viewers/ultra/ultraModal.d.ts +4 -0
- package/dist/types/react-viewers/ultra/ultraSectionBoxState.d.ts +3 -0
- package/dist/types/react-viewers/webgl/index.d.ts +0 -1
- package/dist/types/react-viewers/webgl/webglComponentRef.d.ts +5 -0
- package/dist/types/react-viewers/webgl/webglSectionBoxState.d.ts +3 -0
- package/dist/vim-web.iife.js +1292 -1014
- package/dist/vim-web.iife.js.map +1 -1
- package/dist/vim-web.js +1311 -1033
- package/dist/vim-web.js.map +1 -1
- package/package.json +1 -1
- package/dist/types/react-viewers/controlbar/controlBarCommands.d.ts +0 -4
- package/dist/types/react-viewers/controlbar/sectionBoxState.d.ts +0 -15
- /package/dist/types/react-viewers/{controlbar → panels}/restOfScreen.d.ts +0 -0
- /package/dist/types/react-viewers/{controlbar → state}/fullScreenState.d.ts +0 -0
- /package/dist/types/react-viewers/{controlbar → state}/measureState.d.ts +0 -0
- /package/dist/types/react-viewers/{controlbar → state}/pointerState.d.ts +0 -0
package/dist/vim-web.js
CHANGED
|
@@ -2,7 +2,7 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
4
|
import * as React from "react";
|
|
5
|
-
import React__default, { useState, useRef, useEffect, useMemo, useCallback, useImperativeHandle, useContext, Component } from "react";
|
|
5
|
+
import React__default, { useState, useRef, useEffect, useMemo, useCallback, useImperativeHandle, useContext, Component, useLayoutEffect } from "react";
|
|
6
6
|
import ReactDOM, { flushSync as flushSync$1 } from "react-dom";
|
|
7
7
|
function getDefaultExportFromCjs(x) {
|
|
8
8
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
@@ -13850,7 +13850,7 @@ const MathUtils = {
|
|
|
13850
13850
|
normalize: normalize$1,
|
|
13851
13851
|
denormalize
|
|
13852
13852
|
};
|
|
13853
|
-
|
|
13853
|
+
class Vector2 {
|
|
13854
13854
|
constructor(x = 0, y = 0) {
|
|
13855
13855
|
Vector2.prototype.isVector2 = true;
|
|
13856
13856
|
this.x = x;
|
|
@@ -14112,7 +14112,7 @@ let Vector2$1 = class Vector2 {
|
|
|
14112
14112
|
yield this.x;
|
|
14113
14113
|
yield this.y;
|
|
14114
14114
|
}
|
|
14115
|
-
}
|
|
14115
|
+
}
|
|
14116
14116
|
class Matrix3 {
|
|
14117
14117
|
constructor(n11, n12, n13, n21, n22, n23, n31, n32, n33) {
|
|
14118
14118
|
Matrix3.prototype.isMatrix3 = true;
|
|
@@ -14748,9 +14748,9 @@ class Texture extends EventDispatcher {
|
|
|
14748
14748
|
this.format = format;
|
|
14749
14749
|
this.internalFormat = null;
|
|
14750
14750
|
this.type = type;
|
|
14751
|
-
this.offset = new Vector2
|
|
14752
|
-
this.repeat = new Vector2
|
|
14753
|
-
this.center = new Vector2
|
|
14751
|
+
this.offset = new Vector2(0, 0);
|
|
14752
|
+
this.repeat = new Vector2(1, 1);
|
|
14753
|
+
this.center = new Vector2(0, 0);
|
|
14754
14754
|
this.rotation = 0;
|
|
14755
14755
|
this.matrixAutoUpdate = true;
|
|
14756
14756
|
this.matrix = new Matrix3();
|
|
@@ -15835,7 +15835,7 @@ class Quaternion {
|
|
|
15835
15835
|
yield this._w;
|
|
15836
15836
|
}
|
|
15837
15837
|
}
|
|
15838
|
-
|
|
15838
|
+
class Vector3 {
|
|
15839
15839
|
constructor(x = 0, y = 0, z = 0) {
|
|
15840
15840
|
Vector3.prototype.isVector3 = true;
|
|
15841
15841
|
this.x = x;
|
|
@@ -16247,11 +16247,11 @@ let Vector3$1 = class Vector3 {
|
|
|
16247
16247
|
yield this.y;
|
|
16248
16248
|
yield this.z;
|
|
16249
16249
|
}
|
|
16250
|
-
}
|
|
16251
|
-
const _vector$c = /* @__PURE__ */ new Vector3
|
|
16250
|
+
}
|
|
16251
|
+
const _vector$c = /* @__PURE__ */ new Vector3();
|
|
16252
16252
|
const _quaternion$4 = /* @__PURE__ */ new Quaternion();
|
|
16253
|
-
|
|
16254
|
-
constructor(min2 = new Vector3
|
|
16253
|
+
class Box3 {
|
|
16254
|
+
constructor(min2 = new Vector3(Infinity, Infinity, Infinity), max2 = new Vector3(-Infinity, -Infinity, -Infinity)) {
|
|
16255
16255
|
this.isBox3 = true;
|
|
16256
16256
|
this.min = min2;
|
|
16257
16257
|
this.max = max2;
|
|
@@ -16510,29 +16510,29 @@ let Box3$1 = class Box3 {
|
|
|
16510
16510
|
equals(box) {
|
|
16511
16511
|
return box.min.equals(this.min) && box.max.equals(this.max);
|
|
16512
16512
|
}
|
|
16513
|
-
}
|
|
16513
|
+
}
|
|
16514
16514
|
const _points = [
|
|
16515
|
-
/* @__PURE__ */ new Vector3
|
|
16516
|
-
/* @__PURE__ */ new Vector3
|
|
16517
|
-
/* @__PURE__ */ new Vector3
|
|
16518
|
-
/* @__PURE__ */ new Vector3
|
|
16519
|
-
/* @__PURE__ */ new Vector3
|
|
16520
|
-
/* @__PURE__ */ new Vector3
|
|
16521
|
-
/* @__PURE__ */ new Vector3
|
|
16522
|
-
/* @__PURE__ */ new Vector3
|
|
16515
|
+
/* @__PURE__ */ new Vector3(),
|
|
16516
|
+
/* @__PURE__ */ new Vector3(),
|
|
16517
|
+
/* @__PURE__ */ new Vector3(),
|
|
16518
|
+
/* @__PURE__ */ new Vector3(),
|
|
16519
|
+
/* @__PURE__ */ new Vector3(),
|
|
16520
|
+
/* @__PURE__ */ new Vector3(),
|
|
16521
|
+
/* @__PURE__ */ new Vector3(),
|
|
16522
|
+
/* @__PURE__ */ new Vector3()
|
|
16523
16523
|
];
|
|
16524
|
-
const _vector$b = /* @__PURE__ */ new Vector3
|
|
16525
|
-
const _box$4 = /* @__PURE__ */ new Box3
|
|
16526
|
-
const _v0$2 = /* @__PURE__ */ new Vector3
|
|
16527
|
-
const _v1$7 = /* @__PURE__ */ new Vector3
|
|
16528
|
-
const _v2$4 = /* @__PURE__ */ new Vector3
|
|
16529
|
-
const _f0 = /* @__PURE__ */ new Vector3
|
|
16530
|
-
const _f1 = /* @__PURE__ */ new Vector3
|
|
16531
|
-
const _f2 = /* @__PURE__ */ new Vector3
|
|
16532
|
-
const _center = /* @__PURE__ */ new Vector3
|
|
16533
|
-
const _extents = /* @__PURE__ */ new Vector3
|
|
16534
|
-
const _triangleNormal = /* @__PURE__ */ new Vector3
|
|
16535
|
-
const _testAxis = /* @__PURE__ */ new Vector3
|
|
16524
|
+
const _vector$b = /* @__PURE__ */ new Vector3();
|
|
16525
|
+
const _box$4 = /* @__PURE__ */ new Box3();
|
|
16526
|
+
const _v0$2 = /* @__PURE__ */ new Vector3();
|
|
16527
|
+
const _v1$7 = /* @__PURE__ */ new Vector3();
|
|
16528
|
+
const _v2$4 = /* @__PURE__ */ new Vector3();
|
|
16529
|
+
const _f0 = /* @__PURE__ */ new Vector3();
|
|
16530
|
+
const _f1 = /* @__PURE__ */ new Vector3();
|
|
16531
|
+
const _f2 = /* @__PURE__ */ new Vector3();
|
|
16532
|
+
const _center = /* @__PURE__ */ new Vector3();
|
|
16533
|
+
const _extents = /* @__PURE__ */ new Vector3();
|
|
16534
|
+
const _triangleNormal = /* @__PURE__ */ new Vector3();
|
|
16535
|
+
const _testAxis = /* @__PURE__ */ new Vector3();
|
|
16536
16536
|
function satForAxes(axes, v0, v1, v2, extents) {
|
|
16537
16537
|
for (let i = 0, j = axes.length - 3; i <= j; i += 3) {
|
|
16538
16538
|
_testAxis.fromArray(axes, i);
|
|
@@ -16546,11 +16546,11 @@ function satForAxes(axes, v0, v1, v2, extents) {
|
|
|
16546
16546
|
}
|
|
16547
16547
|
return true;
|
|
16548
16548
|
}
|
|
16549
|
-
const _box$3 = /* @__PURE__ */ new Box3
|
|
16550
|
-
const _v1$6 = /* @__PURE__ */ new Vector3
|
|
16551
|
-
const _v2$3 = /* @__PURE__ */ new Vector3
|
|
16549
|
+
const _box$3 = /* @__PURE__ */ new Box3();
|
|
16550
|
+
const _v1$6 = /* @__PURE__ */ new Vector3();
|
|
16551
|
+
const _v2$3 = /* @__PURE__ */ new Vector3();
|
|
16552
16552
|
class Sphere {
|
|
16553
|
-
constructor(center = new Vector3
|
|
16553
|
+
constructor(center = new Vector3(), radius = -1) {
|
|
16554
16554
|
this.isSphere = true;
|
|
16555
16555
|
this.center = center;
|
|
16556
16556
|
this.radius = radius;
|
|
@@ -16670,15 +16670,15 @@ class Sphere {
|
|
|
16670
16670
|
return new this.constructor().copy(this);
|
|
16671
16671
|
}
|
|
16672
16672
|
}
|
|
16673
|
-
const _vector$a = /* @__PURE__ */ new Vector3
|
|
16674
|
-
const _segCenter = /* @__PURE__ */ new Vector3
|
|
16675
|
-
const _segDir = /* @__PURE__ */ new Vector3
|
|
16676
|
-
const _diff = /* @__PURE__ */ new Vector3
|
|
16677
|
-
const _edge1 = /* @__PURE__ */ new Vector3
|
|
16678
|
-
const _edge2 = /* @__PURE__ */ new Vector3
|
|
16679
|
-
const _normal$1 = /* @__PURE__ */ new Vector3
|
|
16673
|
+
const _vector$a = /* @__PURE__ */ new Vector3();
|
|
16674
|
+
const _segCenter = /* @__PURE__ */ new Vector3();
|
|
16675
|
+
const _segDir = /* @__PURE__ */ new Vector3();
|
|
16676
|
+
const _diff = /* @__PURE__ */ new Vector3();
|
|
16677
|
+
const _edge1 = /* @__PURE__ */ new Vector3();
|
|
16678
|
+
const _edge2 = /* @__PURE__ */ new Vector3();
|
|
16679
|
+
const _normal$1 = /* @__PURE__ */ new Vector3();
|
|
16680
16680
|
class Ray {
|
|
16681
|
-
constructor(origin = new Vector3
|
|
16681
|
+
constructor(origin = new Vector3(), direction = new Vector3(0, 0, -1)) {
|
|
16682
16682
|
this.origin = origin;
|
|
16683
16683
|
this.direction = direction;
|
|
16684
16684
|
}
|
|
@@ -17676,13 +17676,13 @@ class Matrix4 {
|
|
|
17676
17676
|
return array;
|
|
17677
17677
|
}
|
|
17678
17678
|
}
|
|
17679
|
-
const _v1$5 = /* @__PURE__ */ new Vector3
|
|
17679
|
+
const _v1$5 = /* @__PURE__ */ new Vector3();
|
|
17680
17680
|
const _m1$2 = /* @__PURE__ */ new Matrix4();
|
|
17681
|
-
const _zero = /* @__PURE__ */ new Vector3
|
|
17682
|
-
const _one = /* @__PURE__ */ new Vector3
|
|
17683
|
-
const _x = /* @__PURE__ */ new Vector3
|
|
17684
|
-
const _y = /* @__PURE__ */ new Vector3
|
|
17685
|
-
const _z = /* @__PURE__ */ new Vector3
|
|
17681
|
+
const _zero = /* @__PURE__ */ new Vector3(0, 0, 0);
|
|
17682
|
+
const _one = /* @__PURE__ */ new Vector3(1, 1, 1);
|
|
17683
|
+
const _x = /* @__PURE__ */ new Vector3();
|
|
17684
|
+
const _y = /* @__PURE__ */ new Vector3();
|
|
17685
|
+
const _z = /* @__PURE__ */ new Vector3();
|
|
17686
17686
|
const _matrix$2 = /* @__PURE__ */ new Matrix4();
|
|
17687
17687
|
const _quaternion$3 = /* @__PURE__ */ new Quaternion();
|
|
17688
17688
|
class Euler {
|
|
@@ -17886,16 +17886,16 @@ class Layers {
|
|
|
17886
17886
|
}
|
|
17887
17887
|
}
|
|
17888
17888
|
let _object3DId = 0;
|
|
17889
|
-
const _v1$4 = /* @__PURE__ */ new Vector3
|
|
17889
|
+
const _v1$4 = /* @__PURE__ */ new Vector3();
|
|
17890
17890
|
const _q1 = /* @__PURE__ */ new Quaternion();
|
|
17891
17891
|
const _m1$1$1 = /* @__PURE__ */ new Matrix4();
|
|
17892
|
-
const _target = /* @__PURE__ */ new Vector3
|
|
17893
|
-
const _position$3 = /* @__PURE__ */ new Vector3
|
|
17894
|
-
const _scale$2 = /* @__PURE__ */ new Vector3
|
|
17892
|
+
const _target = /* @__PURE__ */ new Vector3();
|
|
17893
|
+
const _position$3 = /* @__PURE__ */ new Vector3();
|
|
17894
|
+
const _scale$2 = /* @__PURE__ */ new Vector3();
|
|
17895
17895
|
const _quaternion$2 = /* @__PURE__ */ new Quaternion();
|
|
17896
|
-
const _xAxis = /* @__PURE__ */ new Vector3
|
|
17897
|
-
const _yAxis = /* @__PURE__ */ new Vector3
|
|
17898
|
-
const _zAxis = /* @__PURE__ */ new Vector3
|
|
17896
|
+
const _xAxis = /* @__PURE__ */ new Vector3(1, 0, 0);
|
|
17897
|
+
const _yAxis = /* @__PURE__ */ new Vector3(0, 1, 0);
|
|
17898
|
+
const _zAxis = /* @__PURE__ */ new Vector3(0, 0, 1);
|
|
17899
17899
|
const _addedEvent = { type: "added" };
|
|
17900
17900
|
const _removedEvent = { type: "removed" };
|
|
17901
17901
|
const _childaddedEvent = { type: "childadded", child: null };
|
|
@@ -17911,10 +17911,10 @@ let Object3D$1 = class Object3D extends EventDispatcher {
|
|
|
17911
17911
|
this.parent = null;
|
|
17912
17912
|
this.children = [];
|
|
17913
17913
|
this.up = Object3D.DEFAULT_UP.clone();
|
|
17914
|
-
const position = new Vector3
|
|
17914
|
+
const position = new Vector3();
|
|
17915
17915
|
const rotation = new Euler();
|
|
17916
17916
|
const quaternion = new Quaternion();
|
|
17917
|
-
const scale = new Vector3
|
|
17917
|
+
const scale = new Vector3(1, 1, 1);
|
|
17918
17918
|
function onRotationChange() {
|
|
17919
17919
|
quaternion.setFromEuler(rotation, false);
|
|
17920
17920
|
}
|
|
@@ -18440,24 +18440,24 @@ let Object3D$1 = class Object3D extends EventDispatcher {
|
|
|
18440
18440
|
return this;
|
|
18441
18441
|
}
|
|
18442
18442
|
};
|
|
18443
|
-
Object3D$1.DEFAULT_UP = /* @__PURE__ */ new Vector3
|
|
18443
|
+
Object3D$1.DEFAULT_UP = /* @__PURE__ */ new Vector3(0, 1, 0);
|
|
18444
18444
|
Object3D$1.DEFAULT_MATRIX_AUTO_UPDATE = true;
|
|
18445
18445
|
Object3D$1.DEFAULT_MATRIX_WORLD_AUTO_UPDATE = true;
|
|
18446
|
-
const _v0$1 = /* @__PURE__ */ new Vector3
|
|
18447
|
-
const _v1$3 = /* @__PURE__ */ new Vector3
|
|
18448
|
-
const _v2$2 = /* @__PURE__ */ new Vector3
|
|
18449
|
-
const _v3$2 = /* @__PURE__ */ new Vector3
|
|
18450
|
-
const _vab = /* @__PURE__ */ new Vector3
|
|
18451
|
-
const _vac = /* @__PURE__ */ new Vector3
|
|
18452
|
-
const _vbc = /* @__PURE__ */ new Vector3
|
|
18453
|
-
const _vap = /* @__PURE__ */ new Vector3
|
|
18454
|
-
const _vbp = /* @__PURE__ */ new Vector3
|
|
18455
|
-
const _vcp = /* @__PURE__ */ new Vector3
|
|
18446
|
+
const _v0$1 = /* @__PURE__ */ new Vector3();
|
|
18447
|
+
const _v1$3 = /* @__PURE__ */ new Vector3();
|
|
18448
|
+
const _v2$2 = /* @__PURE__ */ new Vector3();
|
|
18449
|
+
const _v3$2 = /* @__PURE__ */ new Vector3();
|
|
18450
|
+
const _vab = /* @__PURE__ */ new Vector3();
|
|
18451
|
+
const _vac = /* @__PURE__ */ new Vector3();
|
|
18452
|
+
const _vbc = /* @__PURE__ */ new Vector3();
|
|
18453
|
+
const _vap = /* @__PURE__ */ new Vector3();
|
|
18454
|
+
const _vbp = /* @__PURE__ */ new Vector3();
|
|
18455
|
+
const _vcp = /* @__PURE__ */ new Vector3();
|
|
18456
18456
|
const _v40 = /* @__PURE__ */ new Vector4();
|
|
18457
18457
|
const _v41 = /* @__PURE__ */ new Vector4();
|
|
18458
18458
|
const _v42 = /* @__PURE__ */ new Vector4();
|
|
18459
18459
|
class Triangle {
|
|
18460
|
-
constructor(a = new Vector3
|
|
18460
|
+
constructor(a = new Vector3(), b = new Vector3(), c = new Vector3()) {
|
|
18461
18461
|
this.a = a;
|
|
18462
18462
|
this.b = b;
|
|
18463
18463
|
this.c = c;
|
|
@@ -19597,8 +19597,8 @@ const DataUtils = {
|
|
|
19597
19597
|
toHalfFloat,
|
|
19598
19598
|
fromHalfFloat
|
|
19599
19599
|
};
|
|
19600
|
-
const _vector$9 = /* @__PURE__ */ new Vector3
|
|
19601
|
-
const _vector2$1 = /* @__PURE__ */ new Vector2
|
|
19600
|
+
const _vector$9 = /* @__PURE__ */ new Vector3();
|
|
19601
|
+
const _vector2$1 = /* @__PURE__ */ new Vector2();
|
|
19602
19602
|
class BufferAttribute {
|
|
19603
19603
|
constructor(array, itemSize, normalized = false) {
|
|
19604
19604
|
if (Array.isArray(array)) {
|
|
@@ -19926,10 +19926,10 @@ class Float32BufferAttribute extends BufferAttribute {
|
|
|
19926
19926
|
let _id$1 = 0;
|
|
19927
19927
|
const _m1$3 = /* @__PURE__ */ new Matrix4();
|
|
19928
19928
|
const _obj = /* @__PURE__ */ new Object3D$1();
|
|
19929
|
-
const _offset = /* @__PURE__ */ new Vector3
|
|
19930
|
-
const _box$2 = /* @__PURE__ */ new Box3
|
|
19931
|
-
const _boxMorphTargets = /* @__PURE__ */ new Box3
|
|
19932
|
-
const _vector$8 = /* @__PURE__ */ new Vector3
|
|
19929
|
+
const _offset = /* @__PURE__ */ new Vector3();
|
|
19930
|
+
const _box$2 = /* @__PURE__ */ new Box3();
|
|
19931
|
+
const _boxMorphTargets = /* @__PURE__ */ new Box3();
|
|
19932
|
+
const _vector$8 = /* @__PURE__ */ new Vector3();
|
|
19933
19933
|
class BufferGeometry extends EventDispatcher {
|
|
19934
19934
|
constructor() {
|
|
19935
19935
|
super();
|
|
@@ -20086,15 +20086,15 @@ class BufferGeometry extends EventDispatcher {
|
|
|
20086
20086
|
}
|
|
20087
20087
|
computeBoundingBox() {
|
|
20088
20088
|
if (this.boundingBox === null) {
|
|
20089
|
-
this.boundingBox = new Box3
|
|
20089
|
+
this.boundingBox = new Box3();
|
|
20090
20090
|
}
|
|
20091
20091
|
const position = this.attributes.position;
|
|
20092
20092
|
const morphAttributesPosition = this.morphAttributes.position;
|
|
20093
20093
|
if (position && position.isGLBufferAttribute) {
|
|
20094
20094
|
console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.", this);
|
|
20095
20095
|
this.boundingBox.set(
|
|
20096
|
-
new Vector3
|
|
20097
|
-
new Vector3
|
|
20096
|
+
new Vector3(-Infinity, -Infinity, -Infinity),
|
|
20097
|
+
new Vector3(Infinity, Infinity, Infinity)
|
|
20098
20098
|
);
|
|
20099
20099
|
return;
|
|
20100
20100
|
}
|
|
@@ -20130,7 +20130,7 @@ class BufferGeometry extends EventDispatcher {
|
|
|
20130
20130
|
const morphAttributesPosition = this.morphAttributes.position;
|
|
20131
20131
|
if (position && position.isGLBufferAttribute) {
|
|
20132
20132
|
console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.", this);
|
|
20133
|
-
this.boundingSphere.set(new Vector3
|
|
20133
|
+
this.boundingSphere.set(new Vector3(), Infinity);
|
|
20134
20134
|
return;
|
|
20135
20135
|
}
|
|
20136
20136
|
if (position) {
|
|
@@ -20193,10 +20193,10 @@ class BufferGeometry extends EventDispatcher {
|
|
|
20193
20193
|
const tangentAttribute = this.getAttribute("tangent");
|
|
20194
20194
|
const tan1 = [], tan2 = [];
|
|
20195
20195
|
for (let i = 0; i < positionAttribute.count; i++) {
|
|
20196
|
-
tan1[i] = new Vector3
|
|
20197
|
-
tan2[i] = new Vector3
|
|
20196
|
+
tan1[i] = new Vector3();
|
|
20197
|
+
tan2[i] = new Vector3();
|
|
20198
20198
|
}
|
|
20199
|
-
const vA = new Vector3
|
|
20199
|
+
const vA = new Vector3(), vB = new Vector3(), vC = new Vector3(), uvA = new Vector2(), uvB = new Vector2(), uvC = new Vector2(), sdir = new Vector3(), tdir = new Vector3();
|
|
20200
20200
|
function handleTriangle(a, b, c) {
|
|
20201
20201
|
vA.fromBufferAttribute(positionAttribute, a);
|
|
20202
20202
|
vB.fromBufferAttribute(positionAttribute, b);
|
|
@@ -20238,8 +20238,8 @@ class BufferGeometry extends EventDispatcher {
|
|
|
20238
20238
|
);
|
|
20239
20239
|
}
|
|
20240
20240
|
}
|
|
20241
|
-
const tmp2 = new Vector3
|
|
20242
|
-
const n = new Vector3
|
|
20241
|
+
const tmp2 = new Vector3(), tmp22 = new Vector3();
|
|
20242
|
+
const n = new Vector3(), n2 = new Vector3();
|
|
20243
20243
|
function handleVertex(v) {
|
|
20244
20244
|
n.fromBufferAttribute(normalAttribute, v);
|
|
20245
20245
|
n2.copy(n);
|
|
@@ -20275,9 +20275,9 @@ class BufferGeometry extends EventDispatcher {
|
|
|
20275
20275
|
normalAttribute.setXYZ(i, 0, 0, 0);
|
|
20276
20276
|
}
|
|
20277
20277
|
}
|
|
20278
|
-
const pA = new Vector3
|
|
20279
|
-
const nA = new Vector3
|
|
20280
|
-
const cb = new Vector3
|
|
20278
|
+
const pA = new Vector3(), pB = new Vector3(), pC = new Vector3();
|
|
20279
|
+
const nA = new Vector3(), nB = new Vector3(), nC = new Vector3();
|
|
20280
|
+
const cb = new Vector3(), ab = new Vector3();
|
|
20281
20281
|
if (index2) {
|
|
20282
20282
|
for (let i = 0, il = index2.count; i < il; i += 3) {
|
|
20283
20283
|
const vA = index2.getX(i + 0);
|
|
@@ -20493,14 +20493,14 @@ class BufferGeometry extends EventDispatcher {
|
|
|
20493
20493
|
const _inverseMatrix$3 = /* @__PURE__ */ new Matrix4();
|
|
20494
20494
|
const _ray$3 = /* @__PURE__ */ new Ray();
|
|
20495
20495
|
const _sphere$6 = /* @__PURE__ */ new Sphere();
|
|
20496
|
-
const _sphereHitAt = /* @__PURE__ */ new Vector3
|
|
20497
|
-
const _vA$1 = /* @__PURE__ */ new Vector3
|
|
20498
|
-
const _vB$1 = /* @__PURE__ */ new Vector3
|
|
20499
|
-
const _vC$1 = /* @__PURE__ */ new Vector3
|
|
20500
|
-
const _tempA = /* @__PURE__ */ new Vector3
|
|
20501
|
-
const _morphA = /* @__PURE__ */ new Vector3
|
|
20502
|
-
const _intersectionPoint = /* @__PURE__ */ new Vector3
|
|
20503
|
-
const _intersectionPointWorld = /* @__PURE__ */ new Vector3
|
|
20496
|
+
const _sphereHitAt = /* @__PURE__ */ new Vector3();
|
|
20497
|
+
const _vA$1 = /* @__PURE__ */ new Vector3();
|
|
20498
|
+
const _vB$1 = /* @__PURE__ */ new Vector3();
|
|
20499
|
+
const _vC$1 = /* @__PURE__ */ new Vector3();
|
|
20500
|
+
const _tempA = /* @__PURE__ */ new Vector3();
|
|
20501
|
+
const _morphA = /* @__PURE__ */ new Vector3();
|
|
20502
|
+
const _intersectionPoint = /* @__PURE__ */ new Vector3();
|
|
20503
|
+
const _intersectionPointWorld = /* @__PURE__ */ new Vector3();
|
|
20504
20504
|
class Mesh extends Object3D$1 {
|
|
20505
20505
|
constructor(geometry = new BufferGeometry(), material = new MeshBasicMaterial()) {
|
|
20506
20506
|
super();
|
|
@@ -20687,16 +20687,16 @@ function checkGeometryIntersection(object, material, raycaster, ray, uv, uv1, no
|
|
|
20687
20687
|
object.getVertexPosition(c, _vC$1);
|
|
20688
20688
|
const intersection = checkIntersection$1(object, material, raycaster, ray, _vA$1, _vB$1, _vC$1, _intersectionPoint);
|
|
20689
20689
|
if (intersection) {
|
|
20690
|
-
const barycoord = new Vector3
|
|
20690
|
+
const barycoord = new Vector3();
|
|
20691
20691
|
Triangle.getBarycoord(_intersectionPoint, _vA$1, _vB$1, _vC$1, barycoord);
|
|
20692
20692
|
if (uv) {
|
|
20693
|
-
intersection.uv = Triangle.getInterpolatedAttribute(uv, a, b, c, barycoord, new Vector2
|
|
20693
|
+
intersection.uv = Triangle.getInterpolatedAttribute(uv, a, b, c, barycoord, new Vector2());
|
|
20694
20694
|
}
|
|
20695
20695
|
if (uv1) {
|
|
20696
|
-
intersection.uv1 = Triangle.getInterpolatedAttribute(uv1, a, b, c, barycoord, new Vector2
|
|
20696
|
+
intersection.uv1 = Triangle.getInterpolatedAttribute(uv1, a, b, c, barycoord, new Vector2());
|
|
20697
20697
|
}
|
|
20698
20698
|
if (normal) {
|
|
20699
|
-
intersection.normal = Triangle.getInterpolatedAttribute(normal, a, b, c, barycoord, new Vector3
|
|
20699
|
+
intersection.normal = Triangle.getInterpolatedAttribute(normal, a, b, c, barycoord, new Vector3());
|
|
20700
20700
|
if (intersection.normal.dot(ray.direction) > 0) {
|
|
20701
20701
|
intersection.normal.multiplyScalar(-1);
|
|
20702
20702
|
}
|
|
@@ -20705,7 +20705,7 @@ function checkGeometryIntersection(object, material, raycaster, ray, uv, uv1, no
|
|
|
20705
20705
|
a,
|
|
20706
20706
|
b,
|
|
20707
20707
|
c,
|
|
20708
|
-
normal: new Vector3
|
|
20708
|
+
normal: new Vector3(),
|
|
20709
20709
|
materialIndex: 0
|
|
20710
20710
|
};
|
|
20711
20711
|
Triangle.getNormal(_vA$1, _vB$1, _vC$1, face.normal);
|
|
@@ -20756,7 +20756,7 @@ class BoxGeometry extends BufferGeometry {
|
|
|
20756
20756
|
const gridY1 = gridY + 1;
|
|
20757
20757
|
let vertexCounter = 0;
|
|
20758
20758
|
let groupCount = 0;
|
|
20759
|
-
const vector = new Vector3
|
|
20759
|
+
const vector = new Vector3();
|
|
20760
20760
|
for (let iy = 0; iy < gridY1; iy++) {
|
|
20761
20761
|
const y = iy * segmentHeight - heightHalf;
|
|
20762
20762
|
for (let ix = 0; ix < gridX1; ix++) {
|
|
@@ -20996,9 +20996,9 @@ let Camera$2 = class Camera extends Object3D$1 {
|
|
|
20996
20996
|
return new this.constructor().copy(this);
|
|
20997
20997
|
}
|
|
20998
20998
|
};
|
|
20999
|
-
const _v3$1 = /* @__PURE__ */ new Vector3
|
|
21000
|
-
const _minTarget = /* @__PURE__ */ new Vector2
|
|
21001
|
-
const _maxTarget = /* @__PURE__ */ new Vector2
|
|
20999
|
+
const _v3$1 = /* @__PURE__ */ new Vector3();
|
|
21000
|
+
const _minTarget = /* @__PURE__ */ new Vector2();
|
|
21001
|
+
const _maxTarget = /* @__PURE__ */ new Vector2();
|
|
21002
21002
|
class PerspectiveCamera extends Camera$2 {
|
|
21003
21003
|
constructor(fov2 = 50, aspect2 = 1, near = 0.1, far = 2e3) {
|
|
21004
21004
|
super();
|
|
@@ -21547,7 +21547,7 @@ class InterleavedBuffer {
|
|
|
21547
21547
|
};
|
|
21548
21548
|
}
|
|
21549
21549
|
}
|
|
21550
|
-
const _vector$7 = /* @__PURE__ */ new Vector3
|
|
21550
|
+
const _vector$7 = /* @__PURE__ */ new Vector3();
|
|
21551
21551
|
class InterleavedBufferAttribute {
|
|
21552
21552
|
constructor(interleavedBuffer, itemSize, offset, normalized = false) {
|
|
21553
21553
|
this.isInterleavedBufferAttribute = true;
|
|
@@ -21756,18 +21756,18 @@ class SpriteMaterial extends Material {
|
|
|
21756
21756
|
}
|
|
21757
21757
|
}
|
|
21758
21758
|
let _geometry$1;
|
|
21759
|
-
const _intersectPoint = /* @__PURE__ */ new Vector3
|
|
21760
|
-
const _worldScale = /* @__PURE__ */ new Vector3
|
|
21761
|
-
const _mvPosition = /* @__PURE__ */ new Vector3
|
|
21762
|
-
const _alignedPosition = /* @__PURE__ */ new Vector2
|
|
21763
|
-
const _rotatedPosition = /* @__PURE__ */ new Vector2
|
|
21759
|
+
const _intersectPoint = /* @__PURE__ */ new Vector3();
|
|
21760
|
+
const _worldScale = /* @__PURE__ */ new Vector3();
|
|
21761
|
+
const _mvPosition = /* @__PURE__ */ new Vector3();
|
|
21762
|
+
const _alignedPosition = /* @__PURE__ */ new Vector2();
|
|
21763
|
+
const _rotatedPosition = /* @__PURE__ */ new Vector2();
|
|
21764
21764
|
const _viewWorldMatrix = /* @__PURE__ */ new Matrix4();
|
|
21765
|
-
const _vA = /* @__PURE__ */ new Vector3
|
|
21766
|
-
const _vB = /* @__PURE__ */ new Vector3
|
|
21767
|
-
const _vC = /* @__PURE__ */ new Vector3
|
|
21768
|
-
const _uvA = /* @__PURE__ */ new Vector2
|
|
21769
|
-
const _uvB = /* @__PURE__ */ new Vector2
|
|
21770
|
-
const _uvC = /* @__PURE__ */ new Vector2
|
|
21765
|
+
const _vA = /* @__PURE__ */ new Vector3();
|
|
21766
|
+
const _vB = /* @__PURE__ */ new Vector3();
|
|
21767
|
+
const _vC = /* @__PURE__ */ new Vector3();
|
|
21768
|
+
const _uvA = /* @__PURE__ */ new Vector2();
|
|
21769
|
+
const _uvB = /* @__PURE__ */ new Vector2();
|
|
21770
|
+
const _uvC = /* @__PURE__ */ new Vector2();
|
|
21771
21771
|
class Sprite extends Object3D$1 {
|
|
21772
21772
|
constructor(material = new SpriteMaterial()) {
|
|
21773
21773
|
super();
|
|
@@ -21804,7 +21804,7 @@ class Sprite extends Object3D$1 {
|
|
|
21804
21804
|
}
|
|
21805
21805
|
this.geometry = _geometry$1;
|
|
21806
21806
|
this.material = material;
|
|
21807
|
-
this.center = new Vector2
|
|
21807
|
+
this.center = new Vector2(0.5, 0.5);
|
|
21808
21808
|
}
|
|
21809
21809
|
raycast(raycaster, intersects2) {
|
|
21810
21810
|
if (raycaster.camera === null) {
|
|
@@ -21844,7 +21844,7 @@ class Sprite extends Object3D$1 {
|
|
|
21844
21844
|
intersects2.push({
|
|
21845
21845
|
distance,
|
|
21846
21846
|
point: _intersectPoint.clone(),
|
|
21847
|
-
uv: Triangle.getInterpolation(_intersectPoint, _vA, _vB, _vC, _uvA, _uvB, _uvC, new Vector2
|
|
21847
|
+
uv: Triangle.getInterpolation(_intersectPoint, _vA, _vB, _vC, _uvA, _uvB, _uvC, new Vector2()),
|
|
21848
21848
|
face: null,
|
|
21849
21849
|
object: this
|
|
21850
21850
|
});
|
|
@@ -21869,8 +21869,8 @@ function transformVertex(vertexPosition, mvPosition, center, scale, sin, cos) {
|
|
|
21869
21869
|
vertexPosition.y += _rotatedPosition.y;
|
|
21870
21870
|
vertexPosition.applyMatrix4(_viewWorldMatrix);
|
|
21871
21871
|
}
|
|
21872
|
-
const _v1$2 = /* @__PURE__ */ new Vector3
|
|
21873
|
-
const _v2$1 = /* @__PURE__ */ new Vector3
|
|
21872
|
+
const _v1$2 = /* @__PURE__ */ new Vector3();
|
|
21873
|
+
const _v2$1 = /* @__PURE__ */ new Vector3();
|
|
21874
21874
|
class LOD extends Object3D$1 {
|
|
21875
21875
|
constructor() {
|
|
21876
21876
|
super();
|
|
@@ -21991,12 +21991,12 @@ class LOD extends Object3D$1 {
|
|
|
21991
21991
|
return data2;
|
|
21992
21992
|
}
|
|
21993
21993
|
}
|
|
21994
|
-
const _basePosition = /* @__PURE__ */ new Vector3
|
|
21994
|
+
const _basePosition = /* @__PURE__ */ new Vector3();
|
|
21995
21995
|
const _skinIndex = /* @__PURE__ */ new Vector4();
|
|
21996
21996
|
const _skinWeight = /* @__PURE__ */ new Vector4();
|
|
21997
|
-
const _vector3 = /* @__PURE__ */ new Vector3
|
|
21997
|
+
const _vector3 = /* @__PURE__ */ new Vector3();
|
|
21998
21998
|
const _matrix4 = /* @__PURE__ */ new Matrix4();
|
|
21999
|
-
const _vertex = /* @__PURE__ */ new Vector3
|
|
21999
|
+
const _vertex = /* @__PURE__ */ new Vector3();
|
|
22000
22000
|
const _sphere$5 = /* @__PURE__ */ new Sphere();
|
|
22001
22001
|
const _inverseMatrix$2 = /* @__PURE__ */ new Matrix4();
|
|
22002
22002
|
const _ray$2 = /* @__PURE__ */ new Ray();
|
|
@@ -22014,7 +22014,7 @@ class SkinnedMesh extends Mesh {
|
|
|
22014
22014
|
computeBoundingBox() {
|
|
22015
22015
|
const geometry = this.geometry;
|
|
22016
22016
|
if (this.boundingBox === null) {
|
|
22017
|
-
this.boundingBox = new Box3
|
|
22017
|
+
this.boundingBox = new Box3();
|
|
22018
22018
|
}
|
|
22019
22019
|
this.boundingBox.makeEmpty();
|
|
22020
22020
|
const positionAttribute = geometry.getAttribute("position");
|
|
@@ -22296,7 +22296,7 @@ class InstancedBufferAttribute extends BufferAttribute {
|
|
|
22296
22296
|
const _instanceLocalMatrix = /* @__PURE__ */ new Matrix4();
|
|
22297
22297
|
const _instanceWorldMatrix = /* @__PURE__ */ new Matrix4();
|
|
22298
22298
|
const _instanceIntersects = [];
|
|
22299
|
-
const _box3 = /* @__PURE__ */ new Box3
|
|
22299
|
+
const _box3 = /* @__PURE__ */ new Box3();
|
|
22300
22300
|
const _identity = /* @__PURE__ */ new Matrix4();
|
|
22301
22301
|
const _mesh$1 = /* @__PURE__ */ new Mesh();
|
|
22302
22302
|
const _sphere$4 = /* @__PURE__ */ new Sphere();
|
|
@@ -22318,7 +22318,7 @@ let InstancedMesh$1 = class InstancedMesh extends Mesh {
|
|
|
22318
22318
|
const geometry = this.geometry;
|
|
22319
22319
|
const count = this.count;
|
|
22320
22320
|
if (this.boundingBox === null) {
|
|
22321
|
-
this.boundingBox = new Box3
|
|
22321
|
+
this.boundingBox = new Box3();
|
|
22322
22322
|
}
|
|
22323
22323
|
if (geometry.boundingBox === null) {
|
|
22324
22324
|
geometry.computeBoundingBox();
|
|
@@ -22431,11 +22431,11 @@ let InstancedMesh$1 = class InstancedMesh extends Mesh {
|
|
|
22431
22431
|
return this;
|
|
22432
22432
|
}
|
|
22433
22433
|
};
|
|
22434
|
-
const _vector1 = /* @__PURE__ */ new Vector3
|
|
22435
|
-
const _vector2 = /* @__PURE__ */ new Vector3
|
|
22434
|
+
const _vector1 = /* @__PURE__ */ new Vector3();
|
|
22435
|
+
const _vector2 = /* @__PURE__ */ new Vector3();
|
|
22436
22436
|
const _normalMatrix = /* @__PURE__ */ new Matrix3();
|
|
22437
22437
|
class Plane {
|
|
22438
|
-
constructor(normal = new Vector3
|
|
22438
|
+
constructor(normal = new Vector3(1, 0, 0), constant = 0) {
|
|
22439
22439
|
this.isPlane = true;
|
|
22440
22440
|
this.normal = normal;
|
|
22441
22441
|
this.constant = constant;
|
|
@@ -22533,7 +22533,7 @@ class Plane {
|
|
|
22533
22533
|
}
|
|
22534
22534
|
}
|
|
22535
22535
|
const _sphere$3 = /* @__PURE__ */ new Sphere();
|
|
22536
|
-
const _vector$6 = /* @__PURE__ */ new Vector3
|
|
22536
|
+
const _vector$6 = /* @__PURE__ */ new Vector3();
|
|
22537
22537
|
class Frustum {
|
|
22538
22538
|
constructor(p0 = new Plane(), p1 = new Plane(), p2 = new Plane(), p3 = new Plane(), p4 = new Plane(), p5 = new Plane()) {
|
|
22539
22539
|
this.planes = [p0, p1, p2, p3, p4, p5];
|
|
@@ -22673,11 +22673,11 @@ class MultiDrawRenderList {
|
|
|
22673
22673
|
const _matrix$1 = /* @__PURE__ */ new Matrix4();
|
|
22674
22674
|
const _whiteColor = /* @__PURE__ */ new Color(1, 1, 1);
|
|
22675
22675
|
const _frustum = /* @__PURE__ */ new Frustum();
|
|
22676
|
-
const _box$1 = /* @__PURE__ */ new Box3
|
|
22676
|
+
const _box$1 = /* @__PURE__ */ new Box3();
|
|
22677
22677
|
const _sphere$2 = /* @__PURE__ */ new Sphere();
|
|
22678
|
-
const _vector$5 = /* @__PURE__ */ new Vector3
|
|
22679
|
-
const _forward = /* @__PURE__ */ new Vector3
|
|
22680
|
-
const _temp = /* @__PURE__ */ new Vector3
|
|
22678
|
+
const _vector$5 = /* @__PURE__ */ new Vector3();
|
|
22679
|
+
const _forward = /* @__PURE__ */ new Vector3();
|
|
22680
|
+
const _temp = /* @__PURE__ */ new Vector3();
|
|
22681
22681
|
const _renderList = /* @__PURE__ */ new MultiDrawRenderList();
|
|
22682
22682
|
const _mesh = /* @__PURE__ */ new Mesh();
|
|
22683
22683
|
const _batchIntersects = [];
|
|
@@ -22826,7 +22826,7 @@ class BatchedMesh extends Mesh {
|
|
|
22826
22826
|
}
|
|
22827
22827
|
computeBoundingBox() {
|
|
22828
22828
|
if (this.boundingBox === null) {
|
|
22829
|
-
this.boundingBox = new Box3
|
|
22829
|
+
this.boundingBox = new Box3();
|
|
22830
22830
|
}
|
|
22831
22831
|
const boundingBox = this.boundingBox;
|
|
22832
22832
|
const instanceInfo = this._instanceInfo;
|
|
@@ -23064,7 +23064,7 @@ class BatchedMesh extends Mesh {
|
|
|
23064
23064
|
const geometry = this.geometry;
|
|
23065
23065
|
const geometryInfo = this._geometryInfo[geometryId];
|
|
23066
23066
|
if (geometryInfo.boundingBox === null) {
|
|
23067
|
-
const box = new Box3
|
|
23067
|
+
const box = new Box3();
|
|
23068
23068
|
const index2 = geometry.index;
|
|
23069
23069
|
const position = geometry.attributes.position;
|
|
23070
23070
|
for (let i = geometryInfo.start, l = geometryInfo.start + geometryInfo.count; i < l; i++) {
|
|
@@ -23239,7 +23239,7 @@ class BatchedMesh extends Mesh {
|
|
|
23239
23239
|
_mesh.geometry.index = batchGeometry.index;
|
|
23240
23240
|
_mesh.geometry.attributes = batchGeometry.attributes;
|
|
23241
23241
|
if (_mesh.geometry.boundingBox === null) {
|
|
23242
|
-
_mesh.geometry.boundingBox = new Box3
|
|
23242
|
+
_mesh.geometry.boundingBox = new Box3();
|
|
23243
23243
|
}
|
|
23244
23244
|
if (_mesh.geometry.boundingSphere === null) {
|
|
23245
23245
|
_mesh.geometry.boundingSphere = new Sphere();
|
|
@@ -23416,13 +23416,13 @@ class LineBasicMaterial extends Material {
|
|
|
23416
23416
|
return this;
|
|
23417
23417
|
}
|
|
23418
23418
|
}
|
|
23419
|
-
const _vStart = /* @__PURE__ */ new Vector3
|
|
23420
|
-
const _vEnd = /* @__PURE__ */ new Vector3
|
|
23419
|
+
const _vStart = /* @__PURE__ */ new Vector3();
|
|
23420
|
+
const _vEnd = /* @__PURE__ */ new Vector3();
|
|
23421
23421
|
const _inverseMatrix$1 = /* @__PURE__ */ new Matrix4();
|
|
23422
23422
|
const _ray$1 = /* @__PURE__ */ new Ray();
|
|
23423
23423
|
const _sphere$1 = /* @__PURE__ */ new Sphere();
|
|
23424
|
-
const _intersectPointOnRay = /* @__PURE__ */ new Vector3
|
|
23425
|
-
const _intersectPointOnSegment = /* @__PURE__ */ new Vector3
|
|
23424
|
+
const _intersectPointOnRay = /* @__PURE__ */ new Vector3();
|
|
23425
|
+
const _intersectPointOnSegment = /* @__PURE__ */ new Vector3();
|
|
23426
23426
|
class Line extends Object3D$1 {
|
|
23427
23427
|
constructor(geometry = new BufferGeometry(), material = new LineBasicMaterial()) {
|
|
23428
23428
|
super();
|
|
@@ -23548,8 +23548,8 @@ function checkIntersection(object, raycaster, ray, thresholdSq, a, b) {
|
|
|
23548
23548
|
object
|
|
23549
23549
|
};
|
|
23550
23550
|
}
|
|
23551
|
-
const _start = /* @__PURE__ */ new Vector3
|
|
23552
|
-
const _end = /* @__PURE__ */ new Vector3
|
|
23551
|
+
const _start = /* @__PURE__ */ new Vector3();
|
|
23552
|
+
const _end = /* @__PURE__ */ new Vector3();
|
|
23553
23553
|
class LineSegments extends Line {
|
|
23554
23554
|
constructor(geometry, material) {
|
|
23555
23555
|
super(geometry, material);
|
|
@@ -23608,7 +23608,7 @@ class PointsMaterial extends Material {
|
|
|
23608
23608
|
const _inverseMatrix = /* @__PURE__ */ new Matrix4();
|
|
23609
23609
|
const _ray = /* @__PURE__ */ new Ray();
|
|
23610
23610
|
const _sphere = /* @__PURE__ */ new Sphere();
|
|
23611
|
-
const _position$2 = /* @__PURE__ */ new Vector3
|
|
23611
|
+
const _position$2 = /* @__PURE__ */ new Vector3();
|
|
23612
23612
|
class Points extends Object3D$1 {
|
|
23613
23613
|
constructor(geometry = new BufferGeometry(), material = new PointsMaterial()) {
|
|
23614
23614
|
super();
|
|
@@ -23679,7 +23679,7 @@ class Points extends Object3D$1 {
|
|
|
23679
23679
|
function testPoint(point, index2, localThresholdSq, matrixWorld, raycaster, intersects2, object) {
|
|
23680
23680
|
const rayPointDistanceSq = _ray.distanceSqToPoint(point);
|
|
23681
23681
|
if (rayPointDistanceSq < localThresholdSq) {
|
|
23682
|
-
const intersectPoint = new Vector3
|
|
23682
|
+
const intersectPoint = new Vector3();
|
|
23683
23683
|
_ray.closestPointToPoint(point, intersectPoint);
|
|
23684
23684
|
intersectPoint.applyMatrix4(matrixWorld);
|
|
23685
23685
|
const distance = raycaster.ray.origin.distanceTo(intersectPoint);
|
|
@@ -23915,7 +23915,7 @@ class Curve {
|
|
|
23915
23915
|
if (t2 > 1) t2 = 1;
|
|
23916
23916
|
const pt1 = this.getPoint(t1);
|
|
23917
23917
|
const pt2 = this.getPoint(t2);
|
|
23918
|
-
const tangent = optionalTarget || (pt1.isVector2 ? new Vector2
|
|
23918
|
+
const tangent = optionalTarget || (pt1.isVector2 ? new Vector2() : new Vector3());
|
|
23919
23919
|
tangent.copy(pt2).sub(pt1).normalize();
|
|
23920
23920
|
return tangent;
|
|
23921
23921
|
}
|
|
@@ -23924,18 +23924,18 @@ class Curve {
|
|
|
23924
23924
|
return this.getTangent(t, optionalTarget);
|
|
23925
23925
|
}
|
|
23926
23926
|
computeFrenetFrames(segments, closed) {
|
|
23927
|
-
const normal = new Vector3
|
|
23927
|
+
const normal = new Vector3();
|
|
23928
23928
|
const tangents = [];
|
|
23929
23929
|
const normals = [];
|
|
23930
23930
|
const binormals = [];
|
|
23931
|
-
const vec = new Vector3
|
|
23931
|
+
const vec = new Vector3();
|
|
23932
23932
|
const mat = new Matrix4();
|
|
23933
23933
|
for (let i = 0; i <= segments; i++) {
|
|
23934
23934
|
const u = i / segments;
|
|
23935
|
-
tangents[i] = this.getTangentAt(u, new Vector3
|
|
23935
|
+
tangents[i] = this.getTangentAt(u, new Vector3());
|
|
23936
23936
|
}
|
|
23937
|
-
normals[0] = new Vector3
|
|
23938
|
-
binormals[0] = new Vector3
|
|
23937
|
+
normals[0] = new Vector3();
|
|
23938
|
+
binormals[0] = new Vector3();
|
|
23939
23939
|
let min2 = Number.MAX_VALUE;
|
|
23940
23940
|
const tx = Math.abs(tangents[0].x);
|
|
23941
23941
|
const ty = Math.abs(tangents[0].y);
|
|
@@ -24020,7 +24020,7 @@ class EllipseCurve extends Curve {
|
|
|
24020
24020
|
this.aClockwise = aClockwise;
|
|
24021
24021
|
this.aRotation = aRotation;
|
|
24022
24022
|
}
|
|
24023
|
-
getPoint(t, optionalTarget = new Vector2
|
|
24023
|
+
getPoint(t, optionalTarget = new Vector2()) {
|
|
24024
24024
|
const point = optionalTarget;
|
|
24025
24025
|
const twoPi = Math.PI * 2;
|
|
24026
24026
|
let deltaAngle = this.aEndAngle - this.aStartAngle;
|
|
@@ -24124,7 +24124,7 @@ function CubicPoly() {
|
|
|
24124
24124
|
}
|
|
24125
24125
|
};
|
|
24126
24126
|
}
|
|
24127
|
-
const tmp = /* @__PURE__ */ new Vector3
|
|
24127
|
+
const tmp = /* @__PURE__ */ new Vector3();
|
|
24128
24128
|
const px = /* @__PURE__ */ new CubicPoly();
|
|
24129
24129
|
const py = /* @__PURE__ */ new CubicPoly();
|
|
24130
24130
|
const pz = /* @__PURE__ */ new CubicPoly();
|
|
@@ -24138,7 +24138,7 @@ class CatmullRomCurve3 extends Curve {
|
|
|
24138
24138
|
this.curveType = curveType;
|
|
24139
24139
|
this.tension = tension;
|
|
24140
24140
|
}
|
|
24141
|
-
getPoint(t, optionalTarget = new Vector3
|
|
24141
|
+
getPoint(t, optionalTarget = new Vector3()) {
|
|
24142
24142
|
const point = optionalTarget;
|
|
24143
24143
|
const points = this.points;
|
|
24144
24144
|
const l = points.length;
|
|
@@ -24218,7 +24218,7 @@ class CatmullRomCurve3 extends Curve {
|
|
|
24218
24218
|
this.points = [];
|
|
24219
24219
|
for (let i = 0, l = json.points.length; i < l; i++) {
|
|
24220
24220
|
const point = json.points[i];
|
|
24221
|
-
this.points.push(new Vector3
|
|
24221
|
+
this.points.push(new Vector3().fromArray(point));
|
|
24222
24222
|
}
|
|
24223
24223
|
this.closed = json.closed;
|
|
24224
24224
|
this.curveType = json.curveType;
|
|
@@ -24264,7 +24264,7 @@ function CubicBezier(t, p0, p1, p2, p3) {
|
|
|
24264
24264
|
return CubicBezierP0(t, p0) + CubicBezierP1(t, p1) + CubicBezierP2(t, p2) + CubicBezierP3(t, p3);
|
|
24265
24265
|
}
|
|
24266
24266
|
class CubicBezierCurve extends Curve {
|
|
24267
|
-
constructor(v0 = new Vector2
|
|
24267
|
+
constructor(v0 = new Vector2(), v1 = new Vector2(), v2 = new Vector2(), v3 = new Vector2()) {
|
|
24268
24268
|
super();
|
|
24269
24269
|
this.isCubicBezierCurve = true;
|
|
24270
24270
|
this.type = "CubicBezierCurve";
|
|
@@ -24273,7 +24273,7 @@ class CubicBezierCurve extends Curve {
|
|
|
24273
24273
|
this.v2 = v2;
|
|
24274
24274
|
this.v3 = v3;
|
|
24275
24275
|
}
|
|
24276
|
-
getPoint(t, optionalTarget = new Vector2
|
|
24276
|
+
getPoint(t, optionalTarget = new Vector2()) {
|
|
24277
24277
|
const point = optionalTarget;
|
|
24278
24278
|
const v0 = this.v0, v1 = this.v1, v2 = this.v2, v3 = this.v3;
|
|
24279
24279
|
point.set(
|
|
@@ -24308,7 +24308,7 @@ class CubicBezierCurve extends Curve {
|
|
|
24308
24308
|
}
|
|
24309
24309
|
}
|
|
24310
24310
|
class CubicBezierCurve3 extends Curve {
|
|
24311
|
-
constructor(v0 = new Vector3
|
|
24311
|
+
constructor(v0 = new Vector3(), v1 = new Vector3(), v2 = new Vector3(), v3 = new Vector3()) {
|
|
24312
24312
|
super();
|
|
24313
24313
|
this.isCubicBezierCurve3 = true;
|
|
24314
24314
|
this.type = "CubicBezierCurve3";
|
|
@@ -24317,7 +24317,7 @@ class CubicBezierCurve3 extends Curve {
|
|
|
24317
24317
|
this.v2 = v2;
|
|
24318
24318
|
this.v3 = v3;
|
|
24319
24319
|
}
|
|
24320
|
-
getPoint(t, optionalTarget = new Vector3
|
|
24320
|
+
getPoint(t, optionalTarget = new Vector3()) {
|
|
24321
24321
|
const point = optionalTarget;
|
|
24322
24322
|
const v0 = this.v0, v1 = this.v1, v2 = this.v2, v3 = this.v3;
|
|
24323
24323
|
point.set(
|
|
@@ -24353,14 +24353,14 @@ class CubicBezierCurve3 extends Curve {
|
|
|
24353
24353
|
}
|
|
24354
24354
|
}
|
|
24355
24355
|
class LineCurve extends Curve {
|
|
24356
|
-
constructor(v1 = new Vector2
|
|
24356
|
+
constructor(v1 = new Vector2(), v2 = new Vector2()) {
|
|
24357
24357
|
super();
|
|
24358
24358
|
this.isLineCurve = true;
|
|
24359
24359
|
this.type = "LineCurve";
|
|
24360
24360
|
this.v1 = v1;
|
|
24361
24361
|
this.v2 = v2;
|
|
24362
24362
|
}
|
|
24363
|
-
getPoint(t, optionalTarget = new Vector2
|
|
24363
|
+
getPoint(t, optionalTarget = new Vector2()) {
|
|
24364
24364
|
const point = optionalTarget;
|
|
24365
24365
|
if (t === 1) {
|
|
24366
24366
|
point.copy(this.v2);
|
|
@@ -24374,7 +24374,7 @@ class LineCurve extends Curve {
|
|
|
24374
24374
|
getPointAt(u, optionalTarget) {
|
|
24375
24375
|
return this.getPoint(u, optionalTarget);
|
|
24376
24376
|
}
|
|
24377
|
-
getTangent(t, optionalTarget = new Vector2
|
|
24377
|
+
getTangent(t, optionalTarget = new Vector2()) {
|
|
24378
24378
|
return optionalTarget.subVectors(this.v2, this.v1).normalize();
|
|
24379
24379
|
}
|
|
24380
24380
|
getTangentAt(u, optionalTarget) {
|
|
@@ -24400,14 +24400,14 @@ class LineCurve extends Curve {
|
|
|
24400
24400
|
}
|
|
24401
24401
|
}
|
|
24402
24402
|
class LineCurve3 extends Curve {
|
|
24403
|
-
constructor(v1 = new Vector3
|
|
24403
|
+
constructor(v1 = new Vector3(), v2 = new Vector3()) {
|
|
24404
24404
|
super();
|
|
24405
24405
|
this.isLineCurve3 = true;
|
|
24406
24406
|
this.type = "LineCurve3";
|
|
24407
24407
|
this.v1 = v1;
|
|
24408
24408
|
this.v2 = v2;
|
|
24409
24409
|
}
|
|
24410
|
-
getPoint(t, optionalTarget = new Vector3
|
|
24410
|
+
getPoint(t, optionalTarget = new Vector3()) {
|
|
24411
24411
|
const point = optionalTarget;
|
|
24412
24412
|
if (t === 1) {
|
|
24413
24413
|
point.copy(this.v2);
|
|
@@ -24421,7 +24421,7 @@ class LineCurve3 extends Curve {
|
|
|
24421
24421
|
getPointAt(u, optionalTarget) {
|
|
24422
24422
|
return this.getPoint(u, optionalTarget);
|
|
24423
24423
|
}
|
|
24424
|
-
getTangent(t, optionalTarget = new Vector3
|
|
24424
|
+
getTangent(t, optionalTarget = new Vector3()) {
|
|
24425
24425
|
return optionalTarget.subVectors(this.v2, this.v1).normalize();
|
|
24426
24426
|
}
|
|
24427
24427
|
getTangentAt(u, optionalTarget) {
|
|
@@ -24447,7 +24447,7 @@ class LineCurve3 extends Curve {
|
|
|
24447
24447
|
}
|
|
24448
24448
|
}
|
|
24449
24449
|
class QuadraticBezierCurve extends Curve {
|
|
24450
|
-
constructor(v0 = new Vector2
|
|
24450
|
+
constructor(v0 = new Vector2(), v1 = new Vector2(), v2 = new Vector2()) {
|
|
24451
24451
|
super();
|
|
24452
24452
|
this.isQuadraticBezierCurve = true;
|
|
24453
24453
|
this.type = "QuadraticBezierCurve";
|
|
@@ -24455,7 +24455,7 @@ class QuadraticBezierCurve extends Curve {
|
|
|
24455
24455
|
this.v1 = v1;
|
|
24456
24456
|
this.v2 = v2;
|
|
24457
24457
|
}
|
|
24458
|
-
getPoint(t, optionalTarget = new Vector2
|
|
24458
|
+
getPoint(t, optionalTarget = new Vector2()) {
|
|
24459
24459
|
const point = optionalTarget;
|
|
24460
24460
|
const v0 = this.v0, v1 = this.v1, v2 = this.v2;
|
|
24461
24461
|
point.set(
|
|
@@ -24487,7 +24487,7 @@ class QuadraticBezierCurve extends Curve {
|
|
|
24487
24487
|
}
|
|
24488
24488
|
}
|
|
24489
24489
|
class QuadraticBezierCurve3 extends Curve {
|
|
24490
|
-
constructor(v0 = new Vector3
|
|
24490
|
+
constructor(v0 = new Vector3(), v1 = new Vector3(), v2 = new Vector3()) {
|
|
24491
24491
|
super();
|
|
24492
24492
|
this.isQuadraticBezierCurve3 = true;
|
|
24493
24493
|
this.type = "QuadraticBezierCurve3";
|
|
@@ -24495,7 +24495,7 @@ class QuadraticBezierCurve3 extends Curve {
|
|
|
24495
24495
|
this.v1 = v1;
|
|
24496
24496
|
this.v2 = v2;
|
|
24497
24497
|
}
|
|
24498
|
-
getPoint(t, optionalTarget = new Vector3
|
|
24498
|
+
getPoint(t, optionalTarget = new Vector3()) {
|
|
24499
24499
|
const point = optionalTarget;
|
|
24500
24500
|
const v0 = this.v0, v1 = this.v1, v2 = this.v2;
|
|
24501
24501
|
point.set(
|
|
@@ -24534,7 +24534,7 @@ class SplineCurve extends Curve {
|
|
|
24534
24534
|
this.type = "SplineCurve";
|
|
24535
24535
|
this.points = points;
|
|
24536
24536
|
}
|
|
24537
|
-
getPoint(t, optionalTarget = new Vector2
|
|
24537
|
+
getPoint(t, optionalTarget = new Vector2()) {
|
|
24538
24538
|
const point = optionalTarget;
|
|
24539
24539
|
const points = this.points;
|
|
24540
24540
|
const p = (points.length - 1) * t;
|
|
@@ -24573,7 +24573,7 @@ class SplineCurve extends Curve {
|
|
|
24573
24573
|
this.points = [];
|
|
24574
24574
|
for (let i = 0, l = json.points.length; i < l; i++) {
|
|
24575
24575
|
const point = json.points[i];
|
|
24576
|
-
this.points.push(new Vector2
|
|
24576
|
+
this.points.push(new Vector2().fromArray(point));
|
|
24577
24577
|
}
|
|
24578
24578
|
return this;
|
|
24579
24579
|
}
|
|
@@ -24725,7 +24725,7 @@ class Path extends CurvePath {
|
|
|
24725
24725
|
constructor(points) {
|
|
24726
24726
|
super();
|
|
24727
24727
|
this.type = "Path";
|
|
24728
|
-
this.currentPoint = new Vector2
|
|
24728
|
+
this.currentPoint = new Vector2();
|
|
24729
24729
|
if (points) {
|
|
24730
24730
|
this.setFromPoints(points);
|
|
24731
24731
|
}
|
|
@@ -24742,7 +24742,7 @@ class Path extends CurvePath {
|
|
|
24742
24742
|
return this;
|
|
24743
24743
|
}
|
|
24744
24744
|
lineTo(x, y) {
|
|
24745
|
-
const curve = new LineCurve(this.currentPoint.clone(), new Vector2
|
|
24745
|
+
const curve = new LineCurve(this.currentPoint.clone(), new Vector2(x, y));
|
|
24746
24746
|
this.curves.push(curve);
|
|
24747
24747
|
this.currentPoint.set(x, y);
|
|
24748
24748
|
return this;
|
|
@@ -24750,8 +24750,8 @@ class Path extends CurvePath {
|
|
|
24750
24750
|
quadraticCurveTo(aCPx, aCPy, aX, aY) {
|
|
24751
24751
|
const curve = new QuadraticBezierCurve(
|
|
24752
24752
|
this.currentPoint.clone(),
|
|
24753
|
-
new Vector2
|
|
24754
|
-
new Vector2
|
|
24753
|
+
new Vector2(aCPx, aCPy),
|
|
24754
|
+
new Vector2(aX, aY)
|
|
24755
24755
|
);
|
|
24756
24756
|
this.curves.push(curve);
|
|
24757
24757
|
this.currentPoint.set(aX, aY);
|
|
@@ -24760,9 +24760,9 @@ class Path extends CurvePath {
|
|
|
24760
24760
|
bezierCurveTo(aCP1x, aCP1y, aCP2x, aCP2y, aX, aY) {
|
|
24761
24761
|
const curve = new CubicBezierCurve(
|
|
24762
24762
|
this.currentPoint.clone(),
|
|
24763
|
-
new Vector2
|
|
24764
|
-
new Vector2
|
|
24765
|
-
new Vector2
|
|
24763
|
+
new Vector2(aCP1x, aCP1y),
|
|
24764
|
+
new Vector2(aCP2x, aCP2y),
|
|
24765
|
+
new Vector2(aX, aY)
|
|
24766
24766
|
);
|
|
24767
24767
|
this.curves.push(curve);
|
|
24768
24768
|
this.currentPoint.set(aX, aY);
|
|
@@ -24828,7 +24828,7 @@ class Path extends CurvePath {
|
|
|
24828
24828
|
}
|
|
24829
24829
|
}
|
|
24830
24830
|
class LatheGeometry extends BufferGeometry {
|
|
24831
|
-
constructor(points = [new Vector2
|
|
24831
|
+
constructor(points = [new Vector2(0, -0.5), new Vector2(0.5, 0), new Vector2(0, 0.5)], segments = 12, phiStart = 0, phiLength = Math.PI * 2) {
|
|
24832
24832
|
super();
|
|
24833
24833
|
this.type = "LatheGeometry";
|
|
24834
24834
|
this.parameters = {
|
|
@@ -24845,11 +24845,11 @@ class LatheGeometry extends BufferGeometry {
|
|
|
24845
24845
|
const initNormals = [];
|
|
24846
24846
|
const normals = [];
|
|
24847
24847
|
const inverseSegments = 1 / segments;
|
|
24848
|
-
const vertex2 = new Vector3
|
|
24849
|
-
const uv = new Vector2
|
|
24850
|
-
const normal = new Vector3
|
|
24851
|
-
const curNormal = new Vector3
|
|
24852
|
-
const prevNormal = new Vector3
|
|
24848
|
+
const vertex2 = new Vector3();
|
|
24849
|
+
const uv = new Vector2();
|
|
24850
|
+
const normal = new Vector3();
|
|
24851
|
+
const curNormal = new Vector3();
|
|
24852
|
+
const prevNormal = new Vector3();
|
|
24853
24853
|
let dx = 0;
|
|
24854
24854
|
let dy = 0;
|
|
24855
24855
|
for (let j = 0; j <= points.length - 1; j++) {
|
|
@@ -24958,8 +24958,8 @@ class CircleGeometry extends BufferGeometry {
|
|
|
24958
24958
|
const vertices = [];
|
|
24959
24959
|
const normals = [];
|
|
24960
24960
|
const uvs = [];
|
|
24961
|
-
const vertex2 = new Vector3
|
|
24962
|
-
const uv = new Vector2
|
|
24961
|
+
const vertex2 = new Vector3();
|
|
24962
|
+
const uv = new Vector2();
|
|
24963
24963
|
vertices.push(0, 0, 0);
|
|
24964
24964
|
normals.push(0, 0, 1);
|
|
24965
24965
|
uvs.push(0.5, 0.5);
|
|
@@ -25025,8 +25025,8 @@ class CylinderGeometry extends BufferGeometry {
|
|
|
25025
25025
|
this.setAttribute("normal", new Float32BufferAttribute(normals, 3));
|
|
25026
25026
|
this.setAttribute("uv", new Float32BufferAttribute(uvs, 2));
|
|
25027
25027
|
function generateTorso() {
|
|
25028
|
-
const normal = new Vector3
|
|
25029
|
-
const vertex2 = new Vector3
|
|
25028
|
+
const normal = new Vector3();
|
|
25029
|
+
const vertex2 = new Vector3();
|
|
25030
25030
|
let groupCount = 0;
|
|
25031
25031
|
const slope = (radiusBottom - radiusTop) / height;
|
|
25032
25032
|
for (let y = 0; y <= heightSegments; y++) {
|
|
@@ -25070,8 +25070,8 @@ class CylinderGeometry extends BufferGeometry {
|
|
|
25070
25070
|
}
|
|
25071
25071
|
function generateCap(top) {
|
|
25072
25072
|
const centerIndexStart = index2;
|
|
25073
|
-
const uv = new Vector2
|
|
25074
|
-
const vertex2 = new Vector3
|
|
25073
|
+
const uv = new Vector2();
|
|
25074
|
+
const vertex2 = new Vector3();
|
|
25075
25075
|
let groupCount = 0;
|
|
25076
25076
|
const radius = top === true ? radiusTop : radiusBottom;
|
|
25077
25077
|
const sign2 = top === true ? 1 : -1;
|
|
@@ -25162,9 +25162,9 @@ class PolyhedronGeometry extends BufferGeometry {
|
|
|
25162
25162
|
this.normalizeNormals();
|
|
25163
25163
|
}
|
|
25164
25164
|
function subdivide(detail2) {
|
|
25165
|
-
const a = new Vector3
|
|
25166
|
-
const b = new Vector3
|
|
25167
|
-
const c = new Vector3
|
|
25165
|
+
const a = new Vector3();
|
|
25166
|
+
const b = new Vector3();
|
|
25167
|
+
const c = new Vector3();
|
|
25168
25168
|
for (let i = 0; i < indices.length; i += 3) {
|
|
25169
25169
|
getVertexByIndex(indices[i + 0], a);
|
|
25170
25170
|
getVertexByIndex(indices[i + 1], b);
|
|
@@ -25204,7 +25204,7 @@ class PolyhedronGeometry extends BufferGeometry {
|
|
|
25204
25204
|
}
|
|
25205
25205
|
}
|
|
25206
25206
|
function applyRadius(radius2) {
|
|
25207
|
-
const vertex2 = new Vector3
|
|
25207
|
+
const vertex2 = new Vector3();
|
|
25208
25208
|
for (let i = 0; i < vertexBuffer.length; i += 3) {
|
|
25209
25209
|
vertex2.x = vertexBuffer[i + 0];
|
|
25210
25210
|
vertex2.y = vertexBuffer[i + 1];
|
|
@@ -25216,7 +25216,7 @@ class PolyhedronGeometry extends BufferGeometry {
|
|
|
25216
25216
|
}
|
|
25217
25217
|
}
|
|
25218
25218
|
function generateUVs() {
|
|
25219
|
-
const vertex2 = new Vector3
|
|
25219
|
+
const vertex2 = new Vector3();
|
|
25220
25220
|
for (let i = 0; i < vertexBuffer.length; i += 3) {
|
|
25221
25221
|
vertex2.x = vertexBuffer[i + 0];
|
|
25222
25222
|
vertex2.y = vertexBuffer[i + 1];
|
|
@@ -25252,13 +25252,13 @@ class PolyhedronGeometry extends BufferGeometry {
|
|
|
25252
25252
|
vertex2.z = vertices[stride + 2];
|
|
25253
25253
|
}
|
|
25254
25254
|
function correctUVs() {
|
|
25255
|
-
const a = new Vector3
|
|
25256
|
-
const b = new Vector3
|
|
25257
|
-
const c = new Vector3
|
|
25258
|
-
const centroid = new Vector3
|
|
25259
|
-
const uvA = new Vector2
|
|
25260
|
-
const uvB = new Vector2
|
|
25261
|
-
const uvC = new Vector2
|
|
25255
|
+
const a = new Vector3();
|
|
25256
|
+
const b = new Vector3();
|
|
25257
|
+
const c = new Vector3();
|
|
25258
|
+
const centroid = new Vector3();
|
|
25259
|
+
const uvA = new Vector2();
|
|
25260
|
+
const uvB = new Vector2();
|
|
25261
|
+
const uvC = new Vector2();
|
|
25262
25262
|
for (let i = 0, j = 0; i < vertexBuffer.length; i += 9, j += 6) {
|
|
25263
25263
|
a.set(vertexBuffer[i + 0], vertexBuffer[i + 1], vertexBuffer[i + 2]);
|
|
25264
25264
|
b.set(vertexBuffer[i + 3], vertexBuffer[i + 4], vertexBuffer[i + 5]);
|
|
@@ -25488,9 +25488,9 @@ class DodecahedronGeometry extends PolyhedronGeometry {
|
|
|
25488
25488
|
return new DodecahedronGeometry(data2.radius, data2.detail);
|
|
25489
25489
|
}
|
|
25490
25490
|
}
|
|
25491
|
-
const _v0$3 = /* @__PURE__ */ new Vector3
|
|
25492
|
-
const _v1$1 = /* @__PURE__ */ new Vector3
|
|
25493
|
-
const _normal = /* @__PURE__ */ new Vector3
|
|
25491
|
+
const _v0$3 = /* @__PURE__ */ new Vector3();
|
|
25492
|
+
const _v1$1 = /* @__PURE__ */ new Vector3();
|
|
25493
|
+
const _normal = /* @__PURE__ */ new Vector3();
|
|
25494
25494
|
const _triangle = /* @__PURE__ */ new Triangle();
|
|
25495
25495
|
class EdgesGeometry extends BufferGeometry {
|
|
25496
25496
|
constructor(geometry = null, thresholdAngle = 1) {
|
|
@@ -26064,7 +26064,7 @@ function addContour(vertices, contour) {
|
|
|
26064
26064
|
}
|
|
26065
26065
|
}
|
|
26066
26066
|
class ExtrudeGeometry extends BufferGeometry {
|
|
26067
|
-
constructor(shapes = new Shape([new Vector2
|
|
26067
|
+
constructor(shapes = new Shape([new Vector2(0.5, 0.5), new Vector2(-0.5, 0.5), new Vector2(-0.5, -0.5), new Vector2(0.5, -0.5)]), options = {}) {
|
|
26068
26068
|
super();
|
|
26069
26069
|
this.type = "ExtrudeGeometry";
|
|
26070
26070
|
this.parameters = {
|
|
@@ -26101,9 +26101,9 @@ class ExtrudeGeometry extends BufferGeometry {
|
|
|
26101
26101
|
extrudeByPath = true;
|
|
26102
26102
|
bevelEnabled = false;
|
|
26103
26103
|
splineTube = extrudePath.computeFrenetFrames(steps, false);
|
|
26104
|
-
binormal = new Vector3
|
|
26105
|
-
normal = new Vector3
|
|
26106
|
-
position2 = new Vector3
|
|
26104
|
+
binormal = new Vector3();
|
|
26105
|
+
normal = new Vector3();
|
|
26106
|
+
position2 = new Vector3();
|
|
26107
26107
|
}
|
|
26108
26108
|
if (!bevelEnabled) {
|
|
26109
26109
|
bevelSegments = 0;
|
|
@@ -26153,7 +26153,7 @@ class ExtrudeGeometry extends BufferGeometry {
|
|
|
26153
26153
|
v_trans_y = ptPrevShift_y + v_prev_y * sf - inPt.y;
|
|
26154
26154
|
const v_trans_lensq = v_trans_x * v_trans_x + v_trans_y * v_trans_y;
|
|
26155
26155
|
if (v_trans_lensq <= 2) {
|
|
26156
|
-
return new Vector2
|
|
26156
|
+
return new Vector2(v_trans_x, v_trans_y);
|
|
26157
26157
|
} else {
|
|
26158
26158
|
shrink_by = Math.sqrt(v_trans_lensq / 2);
|
|
26159
26159
|
}
|
|
@@ -26184,7 +26184,7 @@ class ExtrudeGeometry extends BufferGeometry {
|
|
|
26184
26184
|
shrink_by = Math.sqrt(v_prev_lensq / 2);
|
|
26185
26185
|
}
|
|
26186
26186
|
}
|
|
26187
|
-
return new Vector2
|
|
26187
|
+
return new Vector2(v_trans_x / shrink_by, v_trans_y / shrink_by);
|
|
26188
26188
|
}
|
|
26189
26189
|
const contourMovements = [];
|
|
26190
26190
|
for (let i = 0, il = contour.length, j = il - 1, k = i + 1; i < il; i++, j++, k++) {
|
|
@@ -26398,9 +26398,9 @@ const WorldUVGenerator = {
|
|
|
26398
26398
|
const c_x = vertices[indexC * 3];
|
|
26399
26399
|
const c_y = vertices[indexC * 3 + 1];
|
|
26400
26400
|
return [
|
|
26401
|
-
new Vector2
|
|
26402
|
-
new Vector2
|
|
26403
|
-
new Vector2
|
|
26401
|
+
new Vector2(a_x, a_y),
|
|
26402
|
+
new Vector2(b_x, b_y),
|
|
26403
|
+
new Vector2(c_x, c_y)
|
|
26404
26404
|
];
|
|
26405
26405
|
},
|
|
26406
26406
|
generateSideWallUV: function(geometry, vertices, indexA, indexB, indexC, indexD) {
|
|
@@ -26418,17 +26418,17 @@ const WorldUVGenerator = {
|
|
|
26418
26418
|
const d_z = vertices[indexD * 3 + 2];
|
|
26419
26419
|
if (Math.abs(a_y - b_y) < Math.abs(a_x - b_x)) {
|
|
26420
26420
|
return [
|
|
26421
|
-
new Vector2
|
|
26422
|
-
new Vector2
|
|
26423
|
-
new Vector2
|
|
26424
|
-
new Vector2
|
|
26421
|
+
new Vector2(a_x, 1 - a_z),
|
|
26422
|
+
new Vector2(b_x, 1 - b_z),
|
|
26423
|
+
new Vector2(c_x, 1 - c_z),
|
|
26424
|
+
new Vector2(d_x, 1 - d_z)
|
|
26425
26425
|
];
|
|
26426
26426
|
} else {
|
|
26427
26427
|
return [
|
|
26428
|
-
new Vector2
|
|
26429
|
-
new Vector2
|
|
26430
|
-
new Vector2
|
|
26431
|
-
new Vector2
|
|
26428
|
+
new Vector2(a_y, 1 - a_z),
|
|
26429
|
+
new Vector2(b_y, 1 - b_z),
|
|
26430
|
+
new Vector2(c_y, 1 - c_z),
|
|
26431
|
+
new Vector2(d_y, 1 - d_z)
|
|
26432
26432
|
];
|
|
26433
26433
|
}
|
|
26434
26434
|
}
|
|
@@ -26696,8 +26696,8 @@ class RingGeometry extends BufferGeometry {
|
|
|
26696
26696
|
const uvs = [];
|
|
26697
26697
|
let radius = innerRadius;
|
|
26698
26698
|
const radiusStep = (outerRadius - innerRadius) / phiSegments;
|
|
26699
|
-
const vertex2 = new Vector3
|
|
26700
|
-
const uv = new Vector2
|
|
26699
|
+
const vertex2 = new Vector3();
|
|
26700
|
+
const uv = new Vector2();
|
|
26701
26701
|
for (let j = 0; j <= phiSegments; j++) {
|
|
26702
26702
|
for (let i = 0; i <= thetaSegments; i++) {
|
|
26703
26703
|
const segment = thetaStart + i / thetaSegments * thetaLength;
|
|
@@ -26738,7 +26738,7 @@ class RingGeometry extends BufferGeometry {
|
|
|
26738
26738
|
}
|
|
26739
26739
|
}
|
|
26740
26740
|
class ShapeGeometry extends BufferGeometry {
|
|
26741
|
-
constructor(shapes = new Shape([new Vector2
|
|
26741
|
+
constructor(shapes = new Shape([new Vector2(0, 0.5), new Vector2(-0.5, -0.5), new Vector2(0.5, -0.5)]), curveSegments = 12) {
|
|
26742
26742
|
super();
|
|
26743
26743
|
this.type = "ShapeGeometry";
|
|
26744
26744
|
this.parameters = {
|
|
@@ -26849,8 +26849,8 @@ class SphereGeometry extends BufferGeometry {
|
|
|
26849
26849
|
const thetaEnd = Math.min(thetaStart + thetaLength, Math.PI);
|
|
26850
26850
|
let index2 = 0;
|
|
26851
26851
|
const grid = [];
|
|
26852
|
-
const vertex2 = new Vector3
|
|
26853
|
-
const normal = new Vector3
|
|
26852
|
+
const vertex2 = new Vector3();
|
|
26853
|
+
const normal = new Vector3();
|
|
26854
26854
|
const indices = [];
|
|
26855
26855
|
const vertices = [];
|
|
26856
26856
|
const normals = [];
|
|
@@ -26959,9 +26959,9 @@ class TorusGeometry extends BufferGeometry {
|
|
|
26959
26959
|
const vertices = [];
|
|
26960
26960
|
const normals = [];
|
|
26961
26961
|
const uvs = [];
|
|
26962
|
-
const center = new Vector3
|
|
26963
|
-
const vertex2 = new Vector3
|
|
26964
|
-
const normal = new Vector3
|
|
26962
|
+
const center = new Vector3();
|
|
26963
|
+
const vertex2 = new Vector3();
|
|
26964
|
+
const normal = new Vector3();
|
|
26965
26965
|
for (let j = 0; j <= radialSegments; j++) {
|
|
26966
26966
|
for (let i = 0; i <= tubularSegments; i++) {
|
|
26967
26967
|
const u = i / tubularSegments * arc;
|
|
@@ -27020,13 +27020,13 @@ class TorusKnotGeometry extends BufferGeometry {
|
|
|
27020
27020
|
const vertices = [];
|
|
27021
27021
|
const normals = [];
|
|
27022
27022
|
const uvs = [];
|
|
27023
|
-
const vertex2 = new Vector3
|
|
27024
|
-
const normal = new Vector3
|
|
27025
|
-
const P1 = new Vector3
|
|
27026
|
-
const P2 = new Vector3
|
|
27027
|
-
const B = new Vector3
|
|
27028
|
-
const T = new Vector3
|
|
27029
|
-
const N = new Vector3
|
|
27023
|
+
const vertex2 = new Vector3();
|
|
27024
|
+
const normal = new Vector3();
|
|
27025
|
+
const P1 = new Vector3();
|
|
27026
|
+
const P2 = new Vector3();
|
|
27027
|
+
const B = new Vector3();
|
|
27028
|
+
const T = new Vector3();
|
|
27029
|
+
const N = new Vector3();
|
|
27030
27030
|
for (let i = 0; i <= tubularSegments; ++i) {
|
|
27031
27031
|
const u = i / tubularSegments * p * Math.PI * 2;
|
|
27032
27032
|
calculatePositionOnCurve(u, p, q, radius, P1);
|
|
@@ -27085,7 +27085,7 @@ class TorusKnotGeometry extends BufferGeometry {
|
|
|
27085
27085
|
}
|
|
27086
27086
|
}
|
|
27087
27087
|
class TubeGeometry extends BufferGeometry {
|
|
27088
|
-
constructor(path = new QuadraticBezierCurve3(new Vector3
|
|
27088
|
+
constructor(path = new QuadraticBezierCurve3(new Vector3(-1, -1, 0), new Vector3(-1, 1, 0), new Vector3(1, 1, 0)), tubularSegments = 64, radius = 1, radialSegments = 8, closed = false) {
|
|
27089
27089
|
super();
|
|
27090
27090
|
this.type = "TubeGeometry";
|
|
27091
27091
|
this.parameters = {
|
|
@@ -27099,10 +27099,10 @@ class TubeGeometry extends BufferGeometry {
|
|
|
27099
27099
|
this.tangents = frames.tangents;
|
|
27100
27100
|
this.normals = frames.normals;
|
|
27101
27101
|
this.binormals = frames.binormals;
|
|
27102
|
-
const vertex2 = new Vector3
|
|
27103
|
-
const normal = new Vector3
|
|
27104
|
-
const uv = new Vector2
|
|
27105
|
-
let P = new Vector3
|
|
27102
|
+
const vertex2 = new Vector3();
|
|
27103
|
+
const normal = new Vector3();
|
|
27104
|
+
const uv = new Vector2();
|
|
27105
|
+
let P = new Vector3();
|
|
27106
27106
|
const vertices = [];
|
|
27107
27107
|
const normals = [];
|
|
27108
27108
|
const uvs = [];
|
|
@@ -27191,8 +27191,8 @@ class WireframeGeometry extends BufferGeometry {
|
|
|
27191
27191
|
if (geometry !== null) {
|
|
27192
27192
|
const vertices = [];
|
|
27193
27193
|
const edges = /* @__PURE__ */ new Set();
|
|
27194
|
-
const start = new Vector3
|
|
27195
|
-
const end = new Vector3
|
|
27194
|
+
const start = new Vector3();
|
|
27195
|
+
const end = new Vector3();
|
|
27196
27196
|
if (geometry.index !== null) {
|
|
27197
27197
|
const position = geometry.attributes.position;
|
|
27198
27198
|
const indices = geometry.index;
|
|
@@ -27321,7 +27321,7 @@ class MeshStandardMaterial extends Material {
|
|
|
27321
27321
|
this.bumpScale = 1;
|
|
27322
27322
|
this.normalMap = null;
|
|
27323
27323
|
this.normalMapType = TangentSpaceNormalMap;
|
|
27324
|
-
this.normalScale = new Vector2
|
|
27324
|
+
this.normalScale = new Vector2(1, 1);
|
|
27325
27325
|
this.displacementMap = null;
|
|
27326
27326
|
this.displacementScale = 1;
|
|
27327
27327
|
this.displacementBias = 0;
|
|
@@ -27390,7 +27390,7 @@ class MeshPhysicalMaterial extends MeshStandardMaterial {
|
|
|
27390
27390
|
this.clearcoatMap = null;
|
|
27391
27391
|
this.clearcoatRoughness = 0;
|
|
27392
27392
|
this.clearcoatRoughnessMap = null;
|
|
27393
|
-
this.clearcoatNormalScale = new Vector2
|
|
27393
|
+
this.clearcoatNormalScale = new Vector2(1, 1);
|
|
27394
27394
|
this.clearcoatNormalMap = null;
|
|
27395
27395
|
this.ior = 1.5;
|
|
27396
27396
|
Object.defineProperty(this, "reflectivity", {
|
|
@@ -27540,7 +27540,7 @@ class MeshPhongMaterial extends Material {
|
|
|
27540
27540
|
this.bumpScale = 1;
|
|
27541
27541
|
this.normalMap = null;
|
|
27542
27542
|
this.normalMapType = TangentSpaceNormalMap;
|
|
27543
|
-
this.normalScale = new Vector2
|
|
27543
|
+
this.normalScale = new Vector2(1, 1);
|
|
27544
27544
|
this.displacementMap = null;
|
|
27545
27545
|
this.displacementScale = 1;
|
|
27546
27546
|
this.displacementBias = 0;
|
|
@@ -27616,7 +27616,7 @@ class MeshToonMaterial extends Material {
|
|
|
27616
27616
|
this.bumpScale = 1;
|
|
27617
27617
|
this.normalMap = null;
|
|
27618
27618
|
this.normalMapType = TangentSpaceNormalMap;
|
|
27619
|
-
this.normalScale = new Vector2
|
|
27619
|
+
this.normalScale = new Vector2(1, 1);
|
|
27620
27620
|
this.displacementMap = null;
|
|
27621
27621
|
this.displacementScale = 1;
|
|
27622
27622
|
this.displacementBias = 0;
|
|
@@ -27666,7 +27666,7 @@ class MeshNormalMaterial extends Material {
|
|
|
27666
27666
|
this.bumpScale = 1;
|
|
27667
27667
|
this.normalMap = null;
|
|
27668
27668
|
this.normalMapType = TangentSpaceNormalMap;
|
|
27669
|
-
this.normalScale = new Vector2
|
|
27669
|
+
this.normalScale = new Vector2(1, 1);
|
|
27670
27670
|
this.displacementMap = null;
|
|
27671
27671
|
this.displacementScale = 1;
|
|
27672
27672
|
this.displacementBias = 0;
|
|
@@ -27709,7 +27709,7 @@ class MeshLambertMaterial extends Material {
|
|
|
27709
27709
|
this.bumpScale = 1;
|
|
27710
27710
|
this.normalMap = null;
|
|
27711
27711
|
this.normalMapType = TangentSpaceNormalMap;
|
|
27712
|
-
this.normalScale = new Vector2
|
|
27712
|
+
this.normalScale = new Vector2(1, 1);
|
|
27713
27713
|
this.displacementMap = null;
|
|
27714
27714
|
this.displacementScale = 1;
|
|
27715
27715
|
this.displacementBias = 0;
|
|
@@ -27826,7 +27826,7 @@ class MeshMatcapMaterial extends Material {
|
|
|
27826
27826
|
this.bumpScale = 1;
|
|
27827
27827
|
this.normalMap = null;
|
|
27828
27828
|
this.normalMapType = TangentSpaceNormalMap;
|
|
27829
|
-
this.normalScale = new Vector2
|
|
27829
|
+
this.normalScale = new Vector2(1, 1);
|
|
27830
27830
|
this.displacementMap = null;
|
|
27831
27831
|
this.displacementScale = 1;
|
|
27832
27832
|
this.displacementBias = 0;
|
|
@@ -29346,8 +29346,8 @@ class HemisphereLight extends Light {
|
|
|
29346
29346
|
}
|
|
29347
29347
|
}
|
|
29348
29348
|
const _projScreenMatrix$1 = /* @__PURE__ */ new Matrix4();
|
|
29349
|
-
const _lightPositionWorld$1 = /* @__PURE__ */ new Vector3
|
|
29350
|
-
const _lookTarget$1 = /* @__PURE__ */ new Vector3
|
|
29349
|
+
const _lightPositionWorld$1 = /* @__PURE__ */ new Vector3();
|
|
29350
|
+
const _lookTarget$1 = /* @__PURE__ */ new Vector3();
|
|
29351
29351
|
class LightShadow {
|
|
29352
29352
|
constructor(camera2) {
|
|
29353
29353
|
this.camera = camera2;
|
|
@@ -29356,14 +29356,14 @@ class LightShadow {
|
|
|
29356
29356
|
this.normalBias = 0;
|
|
29357
29357
|
this.radius = 1;
|
|
29358
29358
|
this.blurSamples = 8;
|
|
29359
|
-
this.mapSize = new Vector2
|
|
29359
|
+
this.mapSize = new Vector2(512, 512);
|
|
29360
29360
|
this.map = null;
|
|
29361
29361
|
this.mapPass = null;
|
|
29362
29362
|
this.matrix = new Matrix4();
|
|
29363
29363
|
this.autoUpdate = true;
|
|
29364
29364
|
this.needsUpdate = false;
|
|
29365
29365
|
this._frustum = new Frustum();
|
|
29366
|
-
this._frameExtents = new Vector2
|
|
29366
|
+
this._frameExtents = new Vector2(1, 1);
|
|
29367
29367
|
this._viewportCount = 1;
|
|
29368
29368
|
this._viewports = [
|
|
29369
29369
|
new Vector4(0, 0, 1, 1)
|
|
@@ -29503,13 +29503,13 @@ class SpotLight extends Light {
|
|
|
29503
29503
|
}
|
|
29504
29504
|
}
|
|
29505
29505
|
const _projScreenMatrix = /* @__PURE__ */ new Matrix4();
|
|
29506
|
-
const _lightPositionWorld = /* @__PURE__ */ new Vector3
|
|
29507
|
-
const _lookTarget = /* @__PURE__ */ new Vector3
|
|
29506
|
+
const _lightPositionWorld = /* @__PURE__ */ new Vector3();
|
|
29507
|
+
const _lookTarget = /* @__PURE__ */ new Vector3();
|
|
29508
29508
|
class PointLightShadow extends LightShadow {
|
|
29509
29509
|
constructor() {
|
|
29510
29510
|
super(new PerspectiveCamera(90, 1, 0.5, 500));
|
|
29511
29511
|
this.isPointLightShadow = true;
|
|
29512
|
-
this._frameExtents = new Vector2
|
|
29512
|
+
this._frameExtents = new Vector2(4, 2);
|
|
29513
29513
|
this._viewportCount = 6;
|
|
29514
29514
|
this._viewports = [
|
|
29515
29515
|
// These viewports map a cube-map onto a 2D texture with the
|
|
@@ -29538,20 +29538,20 @@ class PointLightShadow extends LightShadow {
|
|
|
29538
29538
|
new Vector4(1, 0, 1, 1)
|
|
29539
29539
|
];
|
|
29540
29540
|
this._cubeDirections = [
|
|
29541
|
-
new Vector3
|
|
29542
|
-
new Vector3
|
|
29543
|
-
new Vector3
|
|
29544
|
-
new Vector3
|
|
29545
|
-
new Vector3
|
|
29546
|
-
new Vector3
|
|
29541
|
+
new Vector3(1, 0, 0),
|
|
29542
|
+
new Vector3(-1, 0, 0),
|
|
29543
|
+
new Vector3(0, 0, 1),
|
|
29544
|
+
new Vector3(0, 0, -1),
|
|
29545
|
+
new Vector3(0, 1, 0),
|
|
29546
|
+
new Vector3(0, -1, 0)
|
|
29547
29547
|
];
|
|
29548
29548
|
this._cubeUps = [
|
|
29549
|
-
new Vector3
|
|
29550
|
-
new Vector3
|
|
29551
|
-
new Vector3
|
|
29552
|
-
new Vector3
|
|
29553
|
-
new Vector3
|
|
29554
|
-
new Vector3
|
|
29549
|
+
new Vector3(0, 1, 0),
|
|
29550
|
+
new Vector3(0, 1, 0),
|
|
29551
|
+
new Vector3(0, 1, 0),
|
|
29552
|
+
new Vector3(0, 1, 0),
|
|
29553
|
+
new Vector3(0, 0, 1),
|
|
29554
|
+
new Vector3(0, 0, -1)
|
|
29555
29555
|
];
|
|
29556
29556
|
}
|
|
29557
29557
|
updateMatrices(light, viewportIndex = 0) {
|
|
@@ -29752,7 +29752,7 @@ class SphericalHarmonics3 {
|
|
|
29752
29752
|
this.isSphericalHarmonics3 = true;
|
|
29753
29753
|
this.coefficients = [];
|
|
29754
29754
|
for (let i = 0; i < 9; i++) {
|
|
29755
|
-
this.coefficients.push(new Vector3
|
|
29755
|
+
this.coefficients.push(new Vector3());
|
|
29756
29756
|
}
|
|
29757
29757
|
}
|
|
29758
29758
|
set(coefficients) {
|
|
@@ -30015,10 +30015,10 @@ class MaterialLoader extends Loader {
|
|
|
30015
30015
|
material.uniforms[name].value = new Color().setHex(uniform.value);
|
|
30016
30016
|
break;
|
|
30017
30017
|
case "v2":
|
|
30018
|
-
material.uniforms[name].value = new Vector2
|
|
30018
|
+
material.uniforms[name].value = new Vector2().fromArray(uniform.value);
|
|
30019
30019
|
break;
|
|
30020
30020
|
case "v3":
|
|
30021
|
-
material.uniforms[name].value = new Vector3
|
|
30021
|
+
material.uniforms[name].value = new Vector3().fromArray(uniform.value);
|
|
30022
30022
|
break;
|
|
30023
30023
|
case "v4":
|
|
30024
30024
|
material.uniforms[name].value = new Vector4().fromArray(uniform.value);
|
|
@@ -30059,7 +30059,7 @@ class MaterialLoader extends Loader {
|
|
|
30059
30059
|
if (Array.isArray(normalScale) === false) {
|
|
30060
30060
|
normalScale = [normalScale, normalScale];
|
|
30061
30061
|
}
|
|
30062
|
-
material.normalScale = new Vector2
|
|
30062
|
+
material.normalScale = new Vector2().fromArray(normalScale);
|
|
30063
30063
|
}
|
|
30064
30064
|
if (json.displacementMap !== void 0) material.displacementMap = getTexture(json.displacementMap);
|
|
30065
30065
|
if (json.displacementScale !== void 0) material.displacementScale = json.displacementScale;
|
|
@@ -30084,7 +30084,7 @@ class MaterialLoader extends Loader {
|
|
|
30084
30084
|
if (json.clearcoatMap !== void 0) material.clearcoatMap = getTexture(json.clearcoatMap);
|
|
30085
30085
|
if (json.clearcoatRoughnessMap !== void 0) material.clearcoatRoughnessMap = getTexture(json.clearcoatRoughnessMap);
|
|
30086
30086
|
if (json.clearcoatNormalMap !== void 0) material.clearcoatNormalMap = getTexture(json.clearcoatNormalMap);
|
|
30087
|
-
if (json.clearcoatNormalScale !== void 0) material.clearcoatNormalScale = new Vector2
|
|
30087
|
+
if (json.clearcoatNormalScale !== void 0) material.clearcoatNormalScale = new Vector2().fromArray(json.clearcoatNormalScale);
|
|
30088
30088
|
if (json.iridescenceMap !== void 0) material.iridescenceMap = getTexture(json.iridescenceMap);
|
|
30089
30089
|
if (json.iridescenceThicknessMap !== void 0) material.iridescenceThicknessMap = getTexture(json.iridescenceThicknessMap);
|
|
30090
30090
|
if (json.transmissionMap !== void 0) material.transmissionMap = getTexture(json.transmissionMap);
|
|
@@ -30277,7 +30277,7 @@ class BufferGeometryLoader extends Loader {
|
|
|
30277
30277
|
}
|
|
30278
30278
|
const boundingSphere = json.data.boundingSphere;
|
|
30279
30279
|
if (boundingSphere !== void 0) {
|
|
30280
|
-
const center = new Vector3
|
|
30280
|
+
const center = new Vector3();
|
|
30281
30281
|
if (boundingSphere.center !== void 0) {
|
|
30282
30282
|
center.fromArray(boundingSphere.center);
|
|
30283
30283
|
}
|
|
@@ -30752,7 +30752,7 @@ class ObjectLoader extends Loader {
|
|
|
30752
30752
|
object._visibility = data2.visibility;
|
|
30753
30753
|
object._active = data2.active;
|
|
30754
30754
|
object._bounds = data2.bounds.map((bound) => {
|
|
30755
|
-
const box = new Box3
|
|
30755
|
+
const box = new Box3();
|
|
30756
30756
|
box.min.fromArray(bound.boxMin);
|
|
30757
30757
|
box.max.fromArray(bound.boxMax);
|
|
30758
30758
|
const sphere = new Sphere();
|
|
@@ -31113,10 +31113,10 @@ class Clock {
|
|
|
31113
31113
|
function now() {
|
|
31114
31114
|
return performance.now();
|
|
31115
31115
|
}
|
|
31116
|
-
const _position$1 = /* @__PURE__ */ new Vector3
|
|
31116
|
+
const _position$1 = /* @__PURE__ */ new Vector3();
|
|
31117
31117
|
const _quaternion$1 = /* @__PURE__ */ new Quaternion();
|
|
31118
|
-
const _scale$1 = /* @__PURE__ */ new Vector3
|
|
31119
|
-
const _orientation$1 = /* @__PURE__ */ new Vector3
|
|
31118
|
+
const _scale$1 = /* @__PURE__ */ new Vector3();
|
|
31119
|
+
const _orientation$1 = /* @__PURE__ */ new Vector3();
|
|
31120
31120
|
class AudioListener extends Object3D$1 {
|
|
31121
31121
|
constructor() {
|
|
31122
31122
|
super();
|
|
@@ -31428,10 +31428,10 @@ class Audio extends Object3D$1 {
|
|
|
31428
31428
|
return new this.constructor(this.listener).copy(this, recursive);
|
|
31429
31429
|
}
|
|
31430
31430
|
}
|
|
31431
|
-
const _position = /* @__PURE__ */ new Vector3
|
|
31431
|
+
const _position = /* @__PURE__ */ new Vector3();
|
|
31432
31432
|
const _quaternion = /* @__PURE__ */ new Quaternion();
|
|
31433
|
-
const _scale = /* @__PURE__ */ new Vector3
|
|
31434
|
-
const _orientation = /* @__PURE__ */ new Vector3
|
|
31433
|
+
const _scale = /* @__PURE__ */ new Vector3();
|
|
31434
|
+
const _orientation = /* @__PURE__ */ new Vector3();
|
|
31435
31435
|
class PositionalAudio extends Audio {
|
|
31436
31436
|
constructor(listener2) {
|
|
31437
31437
|
super(listener2);
|
|
@@ -33218,9 +33218,9 @@ class Matrix2 {
|
|
|
33218
33218
|
return this;
|
|
33219
33219
|
}
|
|
33220
33220
|
}
|
|
33221
|
-
const _vector$4 = /* @__PURE__ */ new Vector2
|
|
33221
|
+
const _vector$4 = /* @__PURE__ */ new Vector2();
|
|
33222
33222
|
class Box2 {
|
|
33223
|
-
constructor(min2 = new Vector2
|
|
33223
|
+
constructor(min2 = new Vector2(Infinity, Infinity), max2 = new Vector2(-Infinity, -Infinity)) {
|
|
33224
33224
|
this.isBox2 = true;
|
|
33225
33225
|
this.min = min2;
|
|
33226
33226
|
this.max = max2;
|
|
@@ -33321,10 +33321,10 @@ class Box2 {
|
|
|
33321
33321
|
return box.min.equals(this.min) && box.max.equals(this.max);
|
|
33322
33322
|
}
|
|
33323
33323
|
}
|
|
33324
|
-
const _startP = /* @__PURE__ */ new Vector3
|
|
33325
|
-
const _startEnd = /* @__PURE__ */ new Vector3
|
|
33324
|
+
const _startP = /* @__PURE__ */ new Vector3();
|
|
33325
|
+
const _startEnd = /* @__PURE__ */ new Vector3();
|
|
33326
33326
|
class Line3 {
|
|
33327
|
-
constructor(start = new Vector3
|
|
33327
|
+
constructor(start = new Vector3(), end = new Vector3()) {
|
|
33328
33328
|
this.start = start;
|
|
33329
33329
|
this.end = end;
|
|
33330
33330
|
}
|
|
@@ -33380,7 +33380,7 @@ class Line3 {
|
|
|
33380
33380
|
return new this.constructor().copy(this);
|
|
33381
33381
|
}
|
|
33382
33382
|
}
|
|
33383
|
-
const _vector$3 = /* @__PURE__ */ new Vector3
|
|
33383
|
+
const _vector$3 = /* @__PURE__ */ new Vector3();
|
|
33384
33384
|
class SpotLightHelper extends Object3D$1 {
|
|
33385
33385
|
constructor(light, color) {
|
|
33386
33386
|
super();
|
|
@@ -33465,7 +33465,7 @@ class SpotLightHelper extends Object3D$1 {
|
|
|
33465
33465
|
}
|
|
33466
33466
|
}
|
|
33467
33467
|
}
|
|
33468
|
-
const _vector$2 = /* @__PURE__ */ new Vector3
|
|
33468
|
+
const _vector$2 = /* @__PURE__ */ new Vector3();
|
|
33469
33469
|
const _boneMatrix = /* @__PURE__ */ new Matrix4();
|
|
33470
33470
|
const _matrixWorldInv = /* @__PURE__ */ new Matrix4();
|
|
33471
33471
|
class SkeletonHelper extends LineSegments {
|
|
@@ -33556,7 +33556,7 @@ class PointLightHelper extends Mesh {
|
|
|
33556
33556
|
}
|
|
33557
33557
|
}
|
|
33558
33558
|
}
|
|
33559
|
-
const _vector$1 = /* @__PURE__ */ new Vector3
|
|
33559
|
+
const _vector$1 = /* @__PURE__ */ new Vector3();
|
|
33560
33560
|
const _color1 = /* @__PURE__ */ new Color();
|
|
33561
33561
|
const _color2 = /* @__PURE__ */ new Color();
|
|
33562
33562
|
class HemisphereLightHelper extends Object3D$1 {
|
|
@@ -33678,9 +33678,9 @@ class PolarGridHelper extends LineSegments {
|
|
|
33678
33678
|
this.material.dispose();
|
|
33679
33679
|
}
|
|
33680
33680
|
}
|
|
33681
|
-
const _v1 = /* @__PURE__ */ new Vector3
|
|
33682
|
-
const _v2 = /* @__PURE__ */ new Vector3
|
|
33683
|
-
const _v3 = /* @__PURE__ */ new Vector3
|
|
33681
|
+
const _v1 = /* @__PURE__ */ new Vector3();
|
|
33682
|
+
const _v2 = /* @__PURE__ */ new Vector3();
|
|
33683
|
+
const _v3 = /* @__PURE__ */ new Vector3();
|
|
33684
33684
|
class DirectionalLightHelper extends Object3D$1 {
|
|
33685
33685
|
constructor(light, size, color) {
|
|
33686
33686
|
super();
|
|
@@ -33741,7 +33741,7 @@ class DirectionalLightHelper extends Object3D$1 {
|
|
|
33741
33741
|
this.targetLine.scale.z = _v3.length();
|
|
33742
33742
|
}
|
|
33743
33743
|
}
|
|
33744
|
-
const _vector$d = /* @__PURE__ */ new Vector3
|
|
33744
|
+
const _vector$d = /* @__PURE__ */ new Vector3();
|
|
33745
33745
|
const _camera$1 = /* @__PURE__ */ new Camera$2();
|
|
33746
33746
|
class CameraHelper extends LineSegments {
|
|
33747
33747
|
constructor(camera2) {
|
|
@@ -33902,7 +33902,7 @@ function setPoint(point, pointMap, geometry, camera2, x, y, z) {
|
|
|
33902
33902
|
}
|
|
33903
33903
|
}
|
|
33904
33904
|
}
|
|
33905
|
-
const _box = /* @__PURE__ */ new Box3
|
|
33905
|
+
const _box = /* @__PURE__ */ new Box3();
|
|
33906
33906
|
class BoxHelper extends LineSegments {
|
|
33907
33907
|
constructor(object, color = 16776960) {
|
|
33908
33908
|
const indices = new Uint16Array([0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7]);
|
|
@@ -34026,11 +34026,11 @@ class PlaneHelper extends Line {
|
|
|
34026
34026
|
this.children[0].material.dispose();
|
|
34027
34027
|
}
|
|
34028
34028
|
}
|
|
34029
|
-
const _axis = /* @__PURE__ */ new Vector3
|
|
34029
|
+
const _axis = /* @__PURE__ */ new Vector3();
|
|
34030
34030
|
let _lineGeometry, _coneGeometry;
|
|
34031
34031
|
class ArrowHelper extends Object3D$1 {
|
|
34032
34032
|
// dir is assumed to be normalized
|
|
34033
|
-
constructor(dir = new Vector3
|
|
34033
|
+
constructor(dir = new Vector3(0, 0, 1), origin = new Vector3(0, 0, 0), length = 1, color = 16776960, headLength = length * 0.2, headWidth = headLength * 0.2) {
|
|
34034
34034
|
super();
|
|
34035
34035
|
this.type = "ArrowHelper";
|
|
34036
34036
|
if (_lineGeometry === void 0) {
|
|
@@ -34983,7 +34983,7 @@ const UniformsLib = {
|
|
|
34983
34983
|
normalmap: {
|
|
34984
34984
|
normalMap: { value: null },
|
|
34985
34985
|
normalMapTransform: { value: /* @__PURE__ */ new Matrix3() },
|
|
34986
|
-
normalScale: { value: /* @__PURE__ */ new Vector2
|
|
34986
|
+
normalScale: { value: /* @__PURE__ */ new Vector2(1, 1) }
|
|
34987
34987
|
},
|
|
34988
34988
|
displacementmap: {
|
|
34989
34989
|
displacementMap: { value: null },
|
|
@@ -35093,7 +35093,7 @@ const UniformsLib = {
|
|
|
35093
35093
|
sprite: {
|
|
35094
35094
|
diffuse: { value: /* @__PURE__ */ new Color(16777215) },
|
|
35095
35095
|
opacity: { value: 1 },
|
|
35096
|
-
center: { value: /* @__PURE__ */ new Vector2
|
|
35096
|
+
center: { value: /* @__PURE__ */ new Vector2(0.5, 0.5) },
|
|
35097
35097
|
rotation: { value: 0 },
|
|
35098
35098
|
map: { value: null },
|
|
35099
35099
|
mapTransform: { value: /* @__PURE__ */ new Matrix3() },
|
|
@@ -35305,7 +35305,7 @@ const ShaderLib = {
|
|
|
35305
35305
|
UniformsLib.common,
|
|
35306
35306
|
UniformsLib.displacementmap,
|
|
35307
35307
|
{
|
|
35308
|
-
referencePosition: { value: /* @__PURE__ */ new Vector3
|
|
35308
|
+
referencePosition: { value: /* @__PURE__ */ new Vector3() },
|
|
35309
35309
|
nearDistance: { value: 1 },
|
|
35310
35310
|
farDistance: { value: 1e3 }
|
|
35311
35311
|
}
|
|
@@ -35335,7 +35335,7 @@ ShaderLib.physical = {
|
|
|
35335
35335
|
clearcoatMapTransform: { value: /* @__PURE__ */ new Matrix3() },
|
|
35336
35336
|
clearcoatNormalMap: { value: null },
|
|
35337
35337
|
clearcoatNormalMapTransform: { value: /* @__PURE__ */ new Matrix3() },
|
|
35338
|
-
clearcoatNormalScale: { value: /* @__PURE__ */ new Vector2
|
|
35338
|
+
clearcoatNormalScale: { value: /* @__PURE__ */ new Vector2(1, 1) },
|
|
35339
35339
|
clearcoatRoughness: { value: 0 },
|
|
35340
35340
|
clearcoatRoughnessMap: { value: null },
|
|
35341
35341
|
clearcoatRoughnessMapTransform: { value: /* @__PURE__ */ new Matrix3() },
|
|
@@ -35358,7 +35358,7 @@ ShaderLib.physical = {
|
|
|
35358
35358
|
transmission: { value: 0 },
|
|
35359
35359
|
transmissionMap: { value: null },
|
|
35360
35360
|
transmissionMapTransform: { value: /* @__PURE__ */ new Matrix3() },
|
|
35361
|
-
transmissionSamplerSize: { value: /* @__PURE__ */ new Vector2
|
|
35361
|
+
transmissionSamplerSize: { value: /* @__PURE__ */ new Vector2() },
|
|
35362
35362
|
transmissionSamplerMap: { value: null },
|
|
35363
35363
|
thickness: { value: 0 },
|
|
35364
35364
|
thicknessMap: { value: null },
|
|
@@ -35371,7 +35371,7 @@ ShaderLib.physical = {
|
|
|
35371
35371
|
specularIntensity: { value: 1 },
|
|
35372
35372
|
specularIntensityMap: { value: null },
|
|
35373
35373
|
specularIntensityMapTransform: { value: /* @__PURE__ */ new Matrix3() },
|
|
35374
|
-
anisotropyVector: { value: /* @__PURE__ */ new Vector2
|
|
35374
|
+
anisotropyVector: { value: /* @__PURE__ */ new Vector2() },
|
|
35375
35375
|
anisotropyMap: { value: null },
|
|
35376
35376
|
anisotropyMapTransform: { value: /* @__PURE__ */ new Matrix3() }
|
|
35377
35377
|
}
|
|
@@ -36142,16 +36142,16 @@ let _oldXrEnabled = false;
|
|
|
36142
36142
|
const PHI = (1 + Math.sqrt(5)) / 2;
|
|
36143
36143
|
const INV_PHI = 1 / PHI;
|
|
36144
36144
|
const _axisDirections = [
|
|
36145
|
-
/* @__PURE__ */ new Vector3
|
|
36146
|
-
/* @__PURE__ */ new Vector3
|
|
36147
|
-
/* @__PURE__ */ new Vector3
|
|
36148
|
-
/* @__PURE__ */ new Vector3
|
|
36149
|
-
/* @__PURE__ */ new Vector3
|
|
36150
|
-
/* @__PURE__ */ new Vector3
|
|
36151
|
-
/* @__PURE__ */ new Vector3
|
|
36152
|
-
/* @__PURE__ */ new Vector3
|
|
36153
|
-
/* @__PURE__ */ new Vector3
|
|
36154
|
-
/* @__PURE__ */ new Vector3
|
|
36145
|
+
/* @__PURE__ */ new Vector3(-PHI, INV_PHI, 0),
|
|
36146
|
+
/* @__PURE__ */ new Vector3(PHI, INV_PHI, 0),
|
|
36147
|
+
/* @__PURE__ */ new Vector3(-INV_PHI, 0, PHI),
|
|
36148
|
+
/* @__PURE__ */ new Vector3(INV_PHI, 0, PHI),
|
|
36149
|
+
/* @__PURE__ */ new Vector3(0, PHI, -INV_PHI),
|
|
36150
|
+
/* @__PURE__ */ new Vector3(0, PHI, INV_PHI),
|
|
36151
|
+
/* @__PURE__ */ new Vector3(-1, 1, -1),
|
|
36152
|
+
/* @__PURE__ */ new Vector3(1, 1, -1),
|
|
36153
|
+
/* @__PURE__ */ new Vector3(-1, 1, 1),
|
|
36154
|
+
/* @__PURE__ */ new Vector3(1, 1, 1)
|
|
36155
36155
|
];
|
|
36156
36156
|
class PMREMGenerator {
|
|
36157
36157
|
constructor(renderer) {
|
|
@@ -36552,7 +36552,7 @@ function _setViewport(target, x, y, width, height) {
|
|
|
36552
36552
|
}
|
|
36553
36553
|
function _getBlurShader(lodMax, width, height) {
|
|
36554
36554
|
const weights = new Float32Array(MAX_SAMPLES);
|
|
36555
|
-
const poleAxis = new Vector3
|
|
36555
|
+
const poleAxis = new Vector3(0, 1, 0);
|
|
36556
36556
|
const shaderMaterial = new ShaderMaterial({
|
|
36557
36557
|
name: "SphericalGaussianBlur",
|
|
36558
36558
|
defines: {
|
|
@@ -37144,7 +37144,7 @@ function WebGLMorphtargets(gl, capabilities, textures) {
|
|
|
37144
37144
|
entry = {
|
|
37145
37145
|
count: morphTargetsCount,
|
|
37146
37146
|
texture,
|
|
37147
|
-
size: new Vector2
|
|
37147
|
+
size: new Vector2(width, height)
|
|
37148
37148
|
};
|
|
37149
37149
|
morphTextures.set(geometry, entry);
|
|
37150
37150
|
geometry.addEventListener("dispose", disposeTexture);
|
|
@@ -37955,7 +37955,7 @@ function getToneMappingFunction(functionName2, toneMapping) {
|
|
|
37955
37955
|
}
|
|
37956
37956
|
return "vec3 " + functionName2 + "( vec3 color ) { return " + toneMappingName + "ToneMapping( color ); }";
|
|
37957
37957
|
}
|
|
37958
|
-
const _v0 = /* @__PURE__ */ new Vector3
|
|
37958
|
+
const _v0 = /* @__PURE__ */ new Vector3();
|
|
37959
37959
|
function getLuminanceFunction() {
|
|
37960
37960
|
ColorManagement.getLuminanceCoefficients(_v0);
|
|
37961
37961
|
const r = _v0.x.toFixed(4);
|
|
@@ -39211,14 +39211,14 @@ function UniformsCache() {
|
|
|
39211
39211
|
switch (light.type) {
|
|
39212
39212
|
case "DirectionalLight":
|
|
39213
39213
|
uniforms = {
|
|
39214
|
-
direction: new Vector3
|
|
39214
|
+
direction: new Vector3(),
|
|
39215
39215
|
color: new Color()
|
|
39216
39216
|
};
|
|
39217
39217
|
break;
|
|
39218
39218
|
case "SpotLight":
|
|
39219
39219
|
uniforms = {
|
|
39220
|
-
position: new Vector3
|
|
39221
|
-
direction: new Vector3
|
|
39220
|
+
position: new Vector3(),
|
|
39221
|
+
direction: new Vector3(),
|
|
39222
39222
|
color: new Color(),
|
|
39223
39223
|
distance: 0,
|
|
39224
39224
|
coneCos: 0,
|
|
@@ -39228,7 +39228,7 @@ function UniformsCache() {
|
|
|
39228
39228
|
break;
|
|
39229
39229
|
case "PointLight":
|
|
39230
39230
|
uniforms = {
|
|
39231
|
-
position: new Vector3
|
|
39231
|
+
position: new Vector3(),
|
|
39232
39232
|
color: new Color(),
|
|
39233
39233
|
distance: 0,
|
|
39234
39234
|
decay: 0
|
|
@@ -39236,7 +39236,7 @@ function UniformsCache() {
|
|
|
39236
39236
|
break;
|
|
39237
39237
|
case "HemisphereLight":
|
|
39238
39238
|
uniforms = {
|
|
39239
|
-
direction: new Vector3
|
|
39239
|
+
direction: new Vector3(),
|
|
39240
39240
|
skyColor: new Color(),
|
|
39241
39241
|
groundColor: new Color()
|
|
39242
39242
|
};
|
|
@@ -39244,9 +39244,9 @@ function UniformsCache() {
|
|
|
39244
39244
|
case "RectAreaLight":
|
|
39245
39245
|
uniforms = {
|
|
39246
39246
|
color: new Color(),
|
|
39247
|
-
position: new Vector3
|
|
39248
|
-
halfWidth: new Vector3
|
|
39249
|
-
halfHeight: new Vector3
|
|
39247
|
+
position: new Vector3(),
|
|
39248
|
+
halfWidth: new Vector3(),
|
|
39249
|
+
halfHeight: new Vector3()
|
|
39250
39250
|
};
|
|
39251
39251
|
break;
|
|
39252
39252
|
}
|
|
@@ -39270,7 +39270,7 @@ function ShadowUniformsCache() {
|
|
|
39270
39270
|
shadowBias: 0,
|
|
39271
39271
|
shadowNormalBias: 0,
|
|
39272
39272
|
shadowRadius: 1,
|
|
39273
|
-
shadowMapSize: new Vector2
|
|
39273
|
+
shadowMapSize: new Vector2()
|
|
39274
39274
|
};
|
|
39275
39275
|
break;
|
|
39276
39276
|
case "SpotLight":
|
|
@@ -39279,7 +39279,7 @@ function ShadowUniformsCache() {
|
|
|
39279
39279
|
shadowBias: 0,
|
|
39280
39280
|
shadowNormalBias: 0,
|
|
39281
39281
|
shadowRadius: 1,
|
|
39282
|
-
shadowMapSize: new Vector2
|
|
39282
|
+
shadowMapSize: new Vector2()
|
|
39283
39283
|
};
|
|
39284
39284
|
break;
|
|
39285
39285
|
case "PointLight":
|
|
@@ -39288,7 +39288,7 @@ function ShadowUniformsCache() {
|
|
|
39288
39288
|
shadowBias: 0,
|
|
39289
39289
|
shadowNormalBias: 0,
|
|
39290
39290
|
shadowRadius: 1,
|
|
39291
|
-
shadowMapSize: new Vector2
|
|
39291
|
+
shadowMapSize: new Vector2(),
|
|
39292
39292
|
shadowCameraNear: 1,
|
|
39293
39293
|
shadowCameraFar: 1e3
|
|
39294
39294
|
};
|
|
@@ -39342,8 +39342,8 @@ function WebGLLights(extensions) {
|
|
|
39342
39342
|
numSpotLightShadowsWithMaps: 0,
|
|
39343
39343
|
numLightProbes: 0
|
|
39344
39344
|
};
|
|
39345
|
-
for (let i = 0; i < 9; i++) state.probe.push(new Vector3
|
|
39346
|
-
const vector3 = new Vector3
|
|
39345
|
+
for (let i = 0; i < 9; i++) state.probe.push(new Vector3());
|
|
39346
|
+
const vector3 = new Vector3();
|
|
39347
39347
|
const matrix4 = new Matrix4();
|
|
39348
39348
|
const matrix42 = new Matrix4();
|
|
39349
39349
|
function setup(lights) {
|
|
@@ -39628,7 +39628,7 @@ const vertex = "void main() {\n gl_Position = vec4( position, 1.0 );\n}";
|
|
|
39628
39628
|
const fragment = "uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n const float samples = float( VSM_SAMPLES );\n float mean = 0.0;\n float squared_mean = 0.0;\n float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n float uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n for ( float i = 0.0; i < samples; i ++ ) {\n float uvOffset = uvStart + i * uvStride;\n #ifdef HORIZONTAL_PASS\n vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n #else\n float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n mean += depth;\n squared_mean += depth * depth;\n #endif\n }\n mean = mean / samples;\n squared_mean = squared_mean / samples;\n float std_dev = sqrt( squared_mean - mean * mean );\n gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}";
|
|
39629
39629
|
function WebGLShadowMap(renderer, objects, capabilities) {
|
|
39630
39630
|
let _frustum2 = new Frustum();
|
|
39631
|
-
const _shadowMapSize = new Vector2
|
|
39631
|
+
const _shadowMapSize = new Vector2(), _viewportSize = new Vector2(), _viewport = new Vector4(), _depthMaterial = new MeshDepthMaterial({ depthPacking: RGBADepthPacking }), _distanceMaterial = new MeshDistanceMaterial(), _materialCache = {}, _maxTextureSize = capabilities.maxTextureSize;
|
|
39632
39632
|
const shadowSide = { [FrontSide]: BackSide, [BackSide]: FrontSide, [DoubleSide]: DoubleSide };
|
|
39633
39633
|
const shadowMaterialVertical = new ShaderMaterial({
|
|
39634
39634
|
defines: {
|
|
@@ -39636,7 +39636,7 @@ function WebGLShadowMap(renderer, objects, capabilities) {
|
|
|
39636
39636
|
},
|
|
39637
39637
|
uniforms: {
|
|
39638
39638
|
shadow_pass: { value: null },
|
|
39639
|
-
resolution: { value: new Vector2
|
|
39639
|
+
resolution: { value: new Vector2() },
|
|
39640
39640
|
radius: { value: 4 }
|
|
39641
39641
|
},
|
|
39642
39642
|
vertexShader: vertex,
|
|
@@ -40612,7 +40612,7 @@ function WebGLState(gl, extensions) {
|
|
|
40612
40612
|
function WebGLTextures(_gl, extensions, state, properties, capabilities, utils, info) {
|
|
40613
40613
|
const multisampledRTTExt = extensions.has("WEBGL_multisampled_render_to_texture") ? extensions.get("WEBGL_multisampled_render_to_texture") : null;
|
|
40614
40614
|
const supportsInvalidateFramebuffer = typeof navigator === "undefined" ? false : /OculusBrowser/g.test(navigator.userAgent);
|
|
40615
|
-
const _imageDimensions = new Vector2
|
|
40615
|
+
const _imageDimensions = new Vector2();
|
|
40616
40616
|
const _videoTextures = /* @__PURE__ */ new WeakMap();
|
|
40617
40617
|
let _canvas2;
|
|
40618
40618
|
const _sources = /* @__PURE__ */ new WeakMap();
|
|
@@ -41886,9 +41886,9 @@ class WebXRController {
|
|
|
41886
41886
|
this._targetRay.matrixAutoUpdate = false;
|
|
41887
41887
|
this._targetRay.visible = false;
|
|
41888
41888
|
this._targetRay.hasLinearVelocity = false;
|
|
41889
|
-
this._targetRay.linearVelocity = new Vector3
|
|
41889
|
+
this._targetRay.linearVelocity = new Vector3();
|
|
41890
41890
|
this._targetRay.hasAngularVelocity = false;
|
|
41891
|
-
this._targetRay.angularVelocity = new Vector3
|
|
41891
|
+
this._targetRay.angularVelocity = new Vector3();
|
|
41892
41892
|
}
|
|
41893
41893
|
return this._targetRay;
|
|
41894
41894
|
}
|
|
@@ -41898,9 +41898,9 @@ class WebXRController {
|
|
|
41898
41898
|
this._grip.matrixAutoUpdate = false;
|
|
41899
41899
|
this._grip.visible = false;
|
|
41900
41900
|
this._grip.hasLinearVelocity = false;
|
|
41901
|
-
this._grip.linearVelocity = new Vector3
|
|
41901
|
+
this._grip.linearVelocity = new Vector3();
|
|
41902
41902
|
this._grip.hasAngularVelocity = false;
|
|
41903
|
-
this._grip.angularVelocity = new Vector3
|
|
41903
|
+
this._grip.angularVelocity = new Vector3();
|
|
41904
41904
|
}
|
|
41905
41905
|
return this._grip;
|
|
41906
41906
|
}
|
|
@@ -42144,7 +42144,7 @@ class WebXRManager extends EventDispatcher {
|
|
|
42144
42144
|
let newRenderTarget = null;
|
|
42145
42145
|
const controllers = [];
|
|
42146
42146
|
const controllerInputSources = [];
|
|
42147
|
-
const currentSize = new Vector2
|
|
42147
|
+
const currentSize = new Vector2();
|
|
42148
42148
|
let currentPixelRatio = null;
|
|
42149
42149
|
const cameraL = new PerspectiveCamera();
|
|
42150
42150
|
cameraL.viewport = new Vector4();
|
|
@@ -42374,8 +42374,8 @@ class WebXRManager extends EventDispatcher {
|
|
|
42374
42374
|
}
|
|
42375
42375
|
}
|
|
42376
42376
|
}
|
|
42377
|
-
const cameraLPos = new Vector3
|
|
42378
|
-
const cameraRPos = new Vector3
|
|
42377
|
+
const cameraLPos = new Vector3();
|
|
42378
|
+
const cameraRPos = new Vector3();
|
|
42379
42379
|
function setProjectionFromUnion(camera2, cameraL2, cameraR2) {
|
|
42380
42380
|
cameraLPos.setFromMatrixPosition(cameraL2.matrixWorld);
|
|
42381
42381
|
cameraRPos.setFromMatrixPosition(cameraR2.matrixWorld);
|
|
@@ -43168,7 +43168,7 @@ let WebGLRenderer$1 = class WebGLRenderer {
|
|
|
43168
43168
|
let _localClippingEnabled = false;
|
|
43169
43169
|
const _currentProjectionMatrix = new Matrix4();
|
|
43170
43170
|
const _projScreenMatrix2 = new Matrix4();
|
|
43171
|
-
const _vector32 = new Vector3
|
|
43171
|
+
const _vector32 = new Vector3();
|
|
43172
43172
|
const _vector4 = new Vector4();
|
|
43173
43173
|
const _emptyScene = { background: null, fog: null, environment: null, overrideMaterial: null, isScene: true };
|
|
43174
43174
|
let _renderBackground = false;
|
|
@@ -44642,7 +44642,7 @@ const three_module = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.define
|
|
|
44642
44642
|
Bone,
|
|
44643
44643
|
BooleanKeyframeTrack,
|
|
44644
44644
|
Box2,
|
|
44645
|
-
Box3
|
|
44645
|
+
Box3,
|
|
44646
44646
|
Box3Helper,
|
|
44647
44647
|
BoxGeometry,
|
|
44648
44648
|
BoxHelper,
|
|
@@ -45002,8 +45002,8 @@ const three_module = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.define
|
|
|
45002
45002
|
UnsignedShort5551Type,
|
|
45003
45003
|
UnsignedShortType,
|
|
45004
45004
|
VSMShadowMap,
|
|
45005
|
-
Vector2
|
|
45006
|
-
Vector3
|
|
45005
|
+
Vector2,
|
|
45006
|
+
Vector3,
|
|
45007
45007
|
Vector4,
|
|
45008
45008
|
VectorKeyframeTrack,
|
|
45009
45009
|
VideoTexture,
|
|
@@ -45178,7 +45178,7 @@ var Geometry;
|
|
|
45178
45178
|
let vertex2 = 0;
|
|
45179
45179
|
let offset = 0;
|
|
45180
45180
|
const matrix = new Matrix4();
|
|
45181
|
-
const vector = new Vector3
|
|
45181
|
+
const vector = new Vector3();
|
|
45182
45182
|
for (let i = 0; i < info.instances.length; i++) {
|
|
45183
45183
|
const instance = info.instances[i];
|
|
45184
45184
|
const mesh = g3d2.getInstanceMesh(instance);
|
|
@@ -45209,7 +45209,7 @@ var Geometry;
|
|
|
45209
45209
|
vector.applyMatrix4(matrix);
|
|
45210
45210
|
vector.toArray(buffer.vertices, vertex2);
|
|
45211
45211
|
vertex2 += distExports$2.G3d.POSITION_SIZE;
|
|
45212
|
-
buffer.boxes[i] = new Box3
|
|
45212
|
+
buffer.boxes[i] = new Box3(vector.clone(), vector.clone());
|
|
45213
45213
|
}
|
|
45214
45214
|
for (let p = vertexStart + 1; p < vertexEnd; p++) {
|
|
45215
45215
|
vector.fromArray(g3d2.positions, p * distExports$2.G3d.POSITION_SIZE);
|
|
@@ -45281,8 +45281,8 @@ var Geometry;
|
|
|
45281
45281
|
Geometry2.MergeResult = MergeResult;
|
|
45282
45282
|
})(Geometry || (Geometry = {}));
|
|
45283
45283
|
const defaultConfig = {
|
|
45284
|
-
position: new Vector3
|
|
45285
|
-
rotation: new Vector3
|
|
45284
|
+
position: new Vector3(),
|
|
45285
|
+
rotation: new Vector3(),
|
|
45286
45286
|
scale: 1,
|
|
45287
45287
|
matrix: void 0,
|
|
45288
45288
|
transparency: "all",
|
|
@@ -45304,7 +45304,7 @@ function getFullSettings$1(options) {
|
|
|
45304
45304
|
merge.rotation.z * Math.PI / 180
|
|
45305
45305
|
)
|
|
45306
45306
|
),
|
|
45307
|
-
new Vector3
|
|
45307
|
+
new Vector3(merge.scale, merge.scale, merge.scale)
|
|
45308
45308
|
);
|
|
45309
45309
|
return merge;
|
|
45310
45310
|
}
|
|
@@ -45765,7 +45765,7 @@ class Object3D2 {
|
|
|
45765
45765
|
* A new instance is created if none is provided.
|
|
45766
45766
|
* @returns {THREE.Vector3 | undefined} The center position of the object, or undefined if the object has no geometry.
|
|
45767
45767
|
*/
|
|
45768
|
-
getCenter(target = new Vector3
|
|
45768
|
+
getCenter(target = new Vector3()) {
|
|
45769
45769
|
var _a2;
|
|
45770
45770
|
return (_a2 = this.getBoundingBox()) == null ? void 0 : _a2.getCenter(target);
|
|
45771
45771
|
}
|
|
@@ -47308,12 +47308,12 @@ function estimateBytesUsed(geometry) {
|
|
|
47308
47308
|
}
|
|
47309
47309
|
function getAverageBoundingBox(positions, thresholdSpan = 1e3, framingDistanceMultiplier = 2) {
|
|
47310
47310
|
if (positions.length === 0) {
|
|
47311
|
-
return new Box3
|
|
47311
|
+
return new Box3();
|
|
47312
47312
|
}
|
|
47313
47313
|
const { centroid, aabb } = calculateCentroidAndBoundingBox(positions);
|
|
47314
|
-
const span = aabb.getSize(new Vector3
|
|
47315
|
-
const center = span > thresholdSpan ? centroid : aabb.getCenter(new Vector3
|
|
47316
|
-
const avgDist = new Vector3
|
|
47314
|
+
const span = aabb.getSize(new Vector3()).length();
|
|
47315
|
+
const center = span > thresholdSpan ? centroid : aabb.getCenter(new Vector3());
|
|
47316
|
+
const avgDist = new Vector3();
|
|
47317
47317
|
for (const pos of positions) {
|
|
47318
47318
|
avgDist.set(
|
|
47319
47319
|
avgDist.x + Math.abs(pos.x - center.x),
|
|
@@ -47322,14 +47322,14 @@ function getAverageBoundingBox(positions, thresholdSpan = 1e3, framingDistanceMu
|
|
|
47322
47322
|
);
|
|
47323
47323
|
}
|
|
47324
47324
|
const scaledDist = avgDist.multiplyScalar(framingDistanceMultiplier / positions.length);
|
|
47325
|
-
return new Box3
|
|
47325
|
+
return new Box3(
|
|
47326
47326
|
center.clone().sub(scaledDist),
|
|
47327
47327
|
center.clone().add(scaledDist)
|
|
47328
47328
|
);
|
|
47329
47329
|
}
|
|
47330
47330
|
function calculateCentroidAndBoundingBox(positions) {
|
|
47331
|
-
const sum = new Vector3
|
|
47332
|
-
const aabb = new Box3
|
|
47331
|
+
const sum = new Vector3();
|
|
47332
|
+
const aabb = new Box3();
|
|
47333
47333
|
for (const pos of positions) {
|
|
47334
47334
|
sum.add(pos);
|
|
47335
47335
|
aabb.expandByPoint(pos);
|
|
@@ -47374,7 +47374,7 @@ class Scene2 {
|
|
|
47374
47374
|
/**
|
|
47375
47375
|
* Returns the scene bounding box. Returns undefined if scene is empty.
|
|
47376
47376
|
*/
|
|
47377
|
-
getBoundingBox(target = new Box3
|
|
47377
|
+
getBoundingBox(target = new Box3()) {
|
|
47378
47378
|
return this._boundingBox ? target.copy(this._boundingBox) : void 0;
|
|
47379
47379
|
}
|
|
47380
47380
|
/**
|
|
@@ -47389,7 +47389,7 @@ class Scene2 {
|
|
|
47389
47389
|
this.meshes.forEach((m) => {
|
|
47390
47390
|
const subs = m.getSubmeshes();
|
|
47391
47391
|
subs.forEach((s) => {
|
|
47392
|
-
const p = s.boundingBox.getCenter(new Vector3
|
|
47392
|
+
const p = s.boundingBox.getCenter(new Vector3());
|
|
47393
47393
|
p.applyMatrix4(this._matrix);
|
|
47394
47394
|
points.push(p);
|
|
47395
47395
|
});
|
|
@@ -47565,11 +47565,11 @@ class GeometrySubmesh {
|
|
|
47565
47565
|
__publicField(this, "instance");
|
|
47566
47566
|
__publicField(this, "start");
|
|
47567
47567
|
__publicField(this, "end");
|
|
47568
|
-
__publicField(this, "boundingBox", new Box3
|
|
47568
|
+
__publicField(this, "boundingBox", new Box3());
|
|
47569
47569
|
}
|
|
47570
47570
|
expandBox(point) {
|
|
47571
47571
|
var _a2;
|
|
47572
|
-
this.boundingBox = ((_a2 = this.boundingBox) == null ? void 0 : _a2.expandByPoint(point)) ?? new Box3
|
|
47572
|
+
this.boundingBox = ((_a2 = this.boundingBox) == null ? void 0 : _a2.expandByPoint(point)) ?? new Box3().set(point, point);
|
|
47573
47573
|
}
|
|
47574
47574
|
}
|
|
47575
47575
|
class InsertableGeometry {
|
|
@@ -47629,7 +47629,7 @@ class InsertableGeometry {
|
|
|
47629
47629
|
return added;
|
|
47630
47630
|
}
|
|
47631
47631
|
const matrix = new Matrix4();
|
|
47632
|
-
const vector = new Vector3
|
|
47632
|
+
const vector = new Vector3();
|
|
47633
47633
|
const vertexStart = mesh.getVertexStart(section);
|
|
47634
47634
|
const vertexEnd = mesh.getVertexEnd(section);
|
|
47635
47635
|
const vertexCount = vertexEnd - vertexStart;
|
|
@@ -47703,7 +47703,7 @@ class InsertableGeometry {
|
|
|
47703
47703
|
return added;
|
|
47704
47704
|
}
|
|
47705
47705
|
const matrix = new Matrix4();
|
|
47706
|
-
const vector = new Vector3
|
|
47706
|
+
const vector = new Vector3();
|
|
47707
47707
|
const indexOffset = this.offsets.getIndexOffset(mesh);
|
|
47708
47708
|
const vertexOffset = this.offsets.getVertexOffset(mesh);
|
|
47709
47709
|
const vertexStart = g3d2.getMeshVertexStart(meshG3dIndex);
|
|
@@ -48075,7 +48075,7 @@ function createGhostMaterial() {
|
|
|
48075
48075
|
// Uniform controlling the overall transparency of the non-visible objects.
|
|
48076
48076
|
opacity: { value: 1e-3 },
|
|
48077
48077
|
// Uniform specifying the fill color for non-visible objects.
|
|
48078
|
-
fillColor: { value: new Vector3
|
|
48078
|
+
fillColor: { value: new Vector3(0, 0, 0) }
|
|
48079
48079
|
},
|
|
48080
48080
|
// Render only the front side of faces to prevent drawing internal geometry.
|
|
48081
48081
|
side: FrontSide,
|
|
@@ -48142,7 +48142,7 @@ class OutlineMaterial {
|
|
|
48142
48142
|
this.material = createOutlineMaterial();
|
|
48143
48143
|
this._antialias = (options == null ? void 0 : options.antialias) ?? false;
|
|
48144
48144
|
this._precision = (options == null ? void 0 : options.precision) ?? 1;
|
|
48145
|
-
this._resolution = (options == null ? void 0 : options.resolution) ?? new Vector2
|
|
48145
|
+
this._resolution = (options == null ? void 0 : options.resolution) ?? new Vector2(1, 1);
|
|
48146
48146
|
this.resolution = this._resolution;
|
|
48147
48147
|
if (options == null ? void 0 : options.sceneBuffer) {
|
|
48148
48148
|
this.sceneBuffer = options.sceneBuffer;
|
|
@@ -48583,7 +48583,7 @@ class SkyboxMaterial extends ShaderMaterial {
|
|
|
48583
48583
|
|
|
48584
48584
|
void main() {
|
|
48585
48585
|
// Define the up vector
|
|
48586
|
-
vec3 up = vec3(0.0,
|
|
48586
|
+
vec3 up = vec3(0.0, 0.0, 1.0);
|
|
48587
48587
|
|
|
48588
48588
|
// Calculate the direction from the pixel to the camera
|
|
48589
48589
|
vec3 directionToCamera = normalize(vCameraPosition - vPosition);
|
|
@@ -49099,7 +49099,7 @@ class InstancedMesh2 {
|
|
|
49099
49099
|
this.bimInstances = g3d2 instanceof distExports$2.G3dMesh ? instances.map((i) => g3d2.scene.instanceNodes[i]) : instances;
|
|
49100
49100
|
this.meshInstances = instances;
|
|
49101
49101
|
this.boxes = g3d2 instanceof distExports$2.G3dMesh ? this.importBoundingBoxes() : this.computeBoundingBoxes();
|
|
49102
|
-
this.size = ((_a2 = this.boxes[0]) == null ? void 0 : _a2.getSize(new Vector3
|
|
49102
|
+
this.size = ((_a2 = this.boxes[0]) == null ? void 0 : _a2.getSize(new Vector3()).length()) ?? 0;
|
|
49103
49103
|
this.boundingBox = this.computeBoundingBox(this.boxes);
|
|
49104
49104
|
this._material = this.mesh.material;
|
|
49105
49105
|
}
|
|
@@ -49147,7 +49147,7 @@ class InstancedMesh2 {
|
|
|
49147
49147
|
if (this.g3dMesh instanceof distExports$2.G3d) throw new Error("Wrong type");
|
|
49148
49148
|
const boxes = new Array(this.meshInstances.length);
|
|
49149
49149
|
for (let i = 0; i < this.meshInstances.length; i++) {
|
|
49150
|
-
const box = new Box3
|
|
49150
|
+
const box = new Box3();
|
|
49151
49151
|
const instance = this.meshInstances[i];
|
|
49152
49152
|
box.min.fromArray(this.g3dMesh.scene.getInstanceMin(instance));
|
|
49153
49153
|
box.max.fromArray(this.g3dMesh.scene.getInstanceMax(instance));
|
|
@@ -49692,8 +49692,8 @@ class G3dSubset {
|
|
|
49692
49692
|
if (this._source instanceof distExports$2.G3d) {
|
|
49693
49693
|
throw new Error("Feature requires a vimx file");
|
|
49694
49694
|
}
|
|
49695
|
-
const min2 = new Vector3
|
|
49696
|
-
const max2 = new Vector3
|
|
49695
|
+
const min2 = new Vector3();
|
|
49696
|
+
const max2 = new Vector3();
|
|
49697
49697
|
const values = new Array(this._instances.length);
|
|
49698
49698
|
for (let i = 0; i < this._instances.length; i++) {
|
|
49699
49699
|
const instance = this._instances[i];
|
|
@@ -49808,7 +49808,7 @@ class G3dSubset {
|
|
|
49808
49808
|
getBoundingBox() {
|
|
49809
49809
|
if (this._instances.length === 0) return;
|
|
49810
49810
|
if (this._source instanceof distExports$2.G3dScene) {
|
|
49811
|
-
const box = new Box3
|
|
49811
|
+
const box = new Box3();
|
|
49812
49812
|
const first = this._instances[0];
|
|
49813
49813
|
box.min.fromArray(this._source.getInstanceMin(first));
|
|
49814
49814
|
box.max.fromArray(this._source.getInstanceMax(first));
|
|
@@ -50245,14 +50245,14 @@ const defaultViewerSettings = {
|
|
|
50245
50245
|
},
|
|
50246
50246
|
camera: {
|
|
50247
50247
|
orthographic: false,
|
|
50248
|
-
allowedMovement: new Vector3
|
|
50249
|
-
allowedRotation: new Vector2
|
|
50248
|
+
allowedMovement: new Vector3(1, 1, 1),
|
|
50249
|
+
allowedRotation: new Vector2(1, 1),
|
|
50250
50250
|
near: 1e-3,
|
|
50251
50251
|
far: 15e3,
|
|
50252
50252
|
fov: 50,
|
|
50253
50253
|
zoom: 1,
|
|
50254
50254
|
// 45 deg down looking down z.
|
|
50255
|
-
forward: new Vector3
|
|
50255
|
+
forward: new Vector3(1, -1, -1),
|
|
50256
50256
|
controls: {
|
|
50257
50257
|
orbit: true,
|
|
50258
50258
|
rotateSpeed: 1,
|
|
@@ -50285,13 +50285,13 @@ const defaultViewerSettings = {
|
|
|
50285
50285
|
sunlights: [
|
|
50286
50286
|
{
|
|
50287
50287
|
followCamera: true,
|
|
50288
|
-
position: new Vector3
|
|
50288
|
+
position: new Vector3(1e3, 1e3, 1e3),
|
|
50289
50289
|
color: new Color(16777215),
|
|
50290
50290
|
intensity: 0.8
|
|
50291
50291
|
},
|
|
50292
50292
|
{
|
|
50293
50293
|
followCamera: true,
|
|
50294
|
-
position: new Vector3
|
|
50294
|
+
position: new Vector3(-1e3, -1e3, -1e3),
|
|
50295
50295
|
color: new Color(16777215),
|
|
50296
50296
|
intensity: 0.2
|
|
50297
50297
|
}
|
|
@@ -50364,7 +50364,7 @@ class PerspectiveWrapper {
|
|
|
50364
50364
|
frustrumSizeAt(point) {
|
|
50365
50365
|
const dist2 = this.camera.position.distanceTo(point);
|
|
50366
50366
|
const size = 2 * dist2 * Math.tan(this.camera.fov / 2 * (Math.PI / 180));
|
|
50367
|
-
return new Vector2
|
|
50367
|
+
return new Vector2(size * this.camera.aspect, size);
|
|
50368
50368
|
}
|
|
50369
50369
|
}
|
|
50370
50370
|
class OrthographicWrapper {
|
|
@@ -50373,7 +50373,7 @@ class OrthographicWrapper {
|
|
|
50373
50373
|
this.camera = camera2;
|
|
50374
50374
|
}
|
|
50375
50375
|
frustrumSizeAt(point) {
|
|
50376
|
-
return new Vector2
|
|
50376
|
+
return new Vector2(
|
|
50377
50377
|
this.camera.right - this.camera.left,
|
|
50378
50378
|
this.camera.top - this.camera.bottom
|
|
50379
50379
|
);
|
|
@@ -50462,14 +50462,14 @@ class GizmoMarker {
|
|
|
50462
50462
|
/** Sets the position of the marker in the 3d scene */
|
|
50463
50463
|
set position(value) {
|
|
50464
50464
|
const m = new Matrix4();
|
|
50465
|
-
m.compose(value, new Quaternion(), new Vector3
|
|
50465
|
+
m.compose(value, new Quaternion(), new Vector3(1, 1, 1));
|
|
50466
50466
|
this._submesh.mesh.setMatrixAt(this._submesh.index, m);
|
|
50467
50467
|
this._submesh.mesh.instanceMatrix.needsUpdate = true;
|
|
50468
50468
|
}
|
|
50469
50469
|
get position() {
|
|
50470
50470
|
const m = new Matrix4();
|
|
50471
50471
|
this._submesh.mesh.getMatrixAt(0, m);
|
|
50472
|
-
return new Vector3
|
|
50472
|
+
return new Vector3().setFromMatrixPosition(m);
|
|
50473
50473
|
}
|
|
50474
50474
|
/**
|
|
50475
50475
|
* Always false
|
|
@@ -50539,7 +50539,7 @@ class GizmoMarker {
|
|
|
50539
50539
|
* @returns {THREE.Box3 | undefined} The bounding box of the object.
|
|
50540
50540
|
*/
|
|
50541
50541
|
getBoundingBox() {
|
|
50542
|
-
return new Box3
|
|
50542
|
+
return new Box3().setFromCenterAndSize(this.position.clone(), new Vector3(1, 1, 1));
|
|
50543
50543
|
}
|
|
50544
50544
|
}
|
|
50545
50545
|
class CameraMovement {
|
|
@@ -50553,7 +50553,7 @@ class CameraMovement {
|
|
|
50553
50553
|
* @param {'XY' | 'XZ'} axes - The axes defining the plane of movement ('XY' or 'XZ').
|
|
50554
50554
|
*/
|
|
50555
50555
|
move2(vector, axes) {
|
|
50556
|
-
const direction = axes === "XY" ? new Vector3
|
|
50556
|
+
const direction = axes === "XY" ? new Vector3(-vector.x, vector.y, 0) : axes === "XZ" ? new Vector3(-vector.x, 0, vector.y) : void 0;
|
|
50557
50557
|
if (direction) this.move3(direction);
|
|
50558
50558
|
}
|
|
50559
50559
|
/**
|
|
@@ -50562,7 +50562,7 @@ class CameraMovement {
|
|
|
50562
50562
|
* @param {'X' | 'Y' | 'Z'} axis - The axis along which to move the camera ('X', 'Y', or 'Z').
|
|
50563
50563
|
*/
|
|
50564
50564
|
move1(amount, axis) {
|
|
50565
|
-
const direction = new Vector3
|
|
50565
|
+
const direction = new Vector3(
|
|
50566
50566
|
axis === "X" ? -amount : 0,
|
|
50567
50567
|
axis === "Y" ? amount : 0,
|
|
50568
50568
|
axis === "Z" ? amount : 0
|
|
@@ -50589,7 +50589,7 @@ class CameraMovement {
|
|
|
50589
50589
|
const angleForward = flatForward.angleTo(forward) * Math.sign(forward.z);
|
|
50590
50590
|
const angleDirection = flatDirection.angleTo(_direction) * Math.sign(_direction.z);
|
|
50591
50591
|
const declination = angleForward - angleDirection;
|
|
50592
|
-
const angle = new Vector2
|
|
50592
|
+
const angle = new Vector2(-declination, azimuth);
|
|
50593
50593
|
angle.multiplyScalar(180 / Math.PI);
|
|
50594
50594
|
this.orbit(angle);
|
|
50595
50595
|
}
|
|
@@ -50608,7 +50608,7 @@ class CameraMovement {
|
|
|
50608
50608
|
if (target === "all") {
|
|
50609
50609
|
target = this._camera._scene.getAverageBoundingBox();
|
|
50610
50610
|
}
|
|
50611
|
-
if (target instanceof Box3
|
|
50611
|
+
if (target instanceof Box3) {
|
|
50612
50612
|
target = target.getBoundingSphere(new Sphere());
|
|
50613
50613
|
}
|
|
50614
50614
|
if (target instanceof Sphere) {
|
|
@@ -50675,7 +50675,7 @@ class CameraLerp extends CameraMovement {
|
|
|
50675
50675
|
v.applyQuaternion(this._camera.quaternion);
|
|
50676
50676
|
const start = this._camera.position.clone();
|
|
50677
50677
|
const end = this._camera.position.clone().add(v);
|
|
50678
|
-
const pos = new Vector3
|
|
50678
|
+
const pos = new Vector3();
|
|
50679
50679
|
this.onProgress = (progress) => {
|
|
50680
50680
|
pos.copy(start);
|
|
50681
50681
|
pos.lerp(end, progress);
|
|
@@ -50714,7 +50714,7 @@ class CameraLerp extends CameraMovement {
|
|
|
50714
50714
|
orbit(angle) {
|
|
50715
50715
|
const startPos = this._camera.position.clone();
|
|
50716
50716
|
const startTarget = this._camera.target.clone();
|
|
50717
|
-
const a = new Vector2
|
|
50717
|
+
const a = new Vector2();
|
|
50718
50718
|
this.onProgress = (progress) => {
|
|
50719
50719
|
a.set(0, 0);
|
|
50720
50720
|
a.lerp(angle, progress);
|
|
@@ -50727,7 +50727,7 @@ class CameraLerp extends CameraMovement {
|
|
|
50727
50727
|
const next = pos.clone().sub(this._camera.position);
|
|
50728
50728
|
const start = this._camera.quaternion.clone();
|
|
50729
50729
|
const rot = new Quaternion().setFromUnitVectors(
|
|
50730
|
-
new Vector3
|
|
50730
|
+
new Vector3(0, 0, -1),
|
|
50731
50731
|
next.normalize()
|
|
50732
50732
|
);
|
|
50733
50733
|
this.onProgress = (progress) => {
|
|
@@ -50789,26 +50789,26 @@ class CameraMovementSnap extends CameraMovement {
|
|
|
50789
50789
|
move3(vector) {
|
|
50790
50790
|
const v = vector.clone();
|
|
50791
50791
|
v.applyQuaternion(this._camera.quaternion);
|
|
50792
|
-
const locked = this.lockVector(v, new Vector3
|
|
50792
|
+
const locked = this.lockVector(v, new Vector3());
|
|
50793
50793
|
const pos = this._camera.position.clone().add(locked);
|
|
50794
50794
|
const target = this._camera.target.clone().add(locked);
|
|
50795
50795
|
this.set(pos, target);
|
|
50796
50796
|
}
|
|
50797
50797
|
set(position, target) {
|
|
50798
50798
|
target = target ?? this._camera.target;
|
|
50799
|
-
const direction = new Vector3
|
|
50799
|
+
const direction = new Vector3().subVectors(position, target);
|
|
50800
50800
|
const dist2 = direction.length();
|
|
50801
50801
|
if (dist2 > 1e-6) {
|
|
50802
|
-
const up = new Vector3
|
|
50802
|
+
const up = new Vector3(0, 0, 1);
|
|
50803
50803
|
const angle = direction.angleTo(up);
|
|
50804
50804
|
const minAngle = MathUtils.degToRad(5);
|
|
50805
50805
|
const maxAngle = MathUtils.degToRad(175);
|
|
50806
50806
|
if (angle < minAngle) {
|
|
50807
|
-
const axis = new Vector3
|
|
50807
|
+
const axis = new Vector3().crossVectors(up, direction).normalize();
|
|
50808
50808
|
const delta = minAngle - angle;
|
|
50809
50809
|
direction.applyQuaternion(new Quaternion().setFromAxisAngle(axis, delta));
|
|
50810
50810
|
} else if (angle > maxAngle) {
|
|
50811
|
-
const axis = new Vector3
|
|
50811
|
+
const axis = new Vector3().crossVectors(up, direction).normalize();
|
|
50812
50812
|
const delta = maxAngle - angle;
|
|
50813
50813
|
direction.applyQuaternion(new Quaternion().setFromAxisAngle(axis, delta));
|
|
50814
50814
|
}
|
|
@@ -50824,17 +50824,17 @@ class CameraMovementSnap extends CameraMovement {
|
|
|
50824
50824
|
const x = this._camera.allowedMovement.x === 0 ? fallback.x : position.x;
|
|
50825
50825
|
const y = this._camera.allowedMovement.y === 0 ? fallback.y : position.y;
|
|
50826
50826
|
const z = this._camera.allowedMovement.z === 0 ? fallback.z : position.z;
|
|
50827
|
-
return new Vector3
|
|
50827
|
+
return new Vector3(x, y, z);
|
|
50828
50828
|
}
|
|
50829
50829
|
predictOrbit(angle) {
|
|
50830
50830
|
const rotation = this.predictRotate(angle);
|
|
50831
|
-
const delta = new Vector3
|
|
50831
|
+
const delta = new Vector3(0, 0, 1).applyQuaternion(rotation).multiplyScalar(this._camera.orbitDistance);
|
|
50832
50832
|
const pos = this._camera.target.clone().add(delta);
|
|
50833
50833
|
return pos;
|
|
50834
50834
|
}
|
|
50835
50835
|
predictRotate(angle) {
|
|
50836
|
-
const xQuat = new Quaternion().setFromAxisAngle(new Vector3
|
|
50837
|
-
const zQuat = new Quaternion().setFromAxisAngle(new Vector3
|
|
50836
|
+
const xQuat = new Quaternion().setFromAxisAngle(new Vector3(1, 0, 0), angle.x * Math.PI / 180);
|
|
50837
|
+
const zQuat = new Quaternion().setFromAxisAngle(new Vector3(0, 1, 0), angle.y * Math.PI / 180);
|
|
50838
50838
|
const rotation = this._camera.quaternion.clone();
|
|
50839
50839
|
rotation.multiply(xQuat).multiply(zQuat);
|
|
50840
50840
|
return rotation;
|
|
@@ -50850,22 +50850,22 @@ let Camera$1 = class Camera2 {
|
|
|
50850
50850
|
__publicField(this, "_lerp");
|
|
50851
50851
|
__publicField(this, "_movement");
|
|
50852
50852
|
// movements
|
|
50853
|
-
__publicField(this, "_inputVelocity", new Vector3
|
|
50854
|
-
__publicField(this, "_velocity", new Vector3
|
|
50853
|
+
__publicField(this, "_inputVelocity", new Vector3());
|
|
50854
|
+
__publicField(this, "_velocity", new Vector3());
|
|
50855
50855
|
__publicField(this, "_speed", 0);
|
|
50856
50856
|
// orbit
|
|
50857
50857
|
__publicField(this, "_orthographic", false);
|
|
50858
|
-
__publicField(this, "_target", new Vector3
|
|
50858
|
+
__publicField(this, "_target", new Vector3());
|
|
50859
50859
|
// updates
|
|
50860
|
-
__publicField(this, "_lastPosition", new Vector3
|
|
50860
|
+
__publicField(this, "_lastPosition", new Vector3());
|
|
50861
50861
|
__publicField(this, "_lastQuaternion", new Quaternion());
|
|
50862
|
-
__publicField(this, "_lastTarget", new Vector3
|
|
50862
|
+
__publicField(this, "_lastTarget", new Vector3());
|
|
50863
50863
|
// Reuseable vectors for calculations
|
|
50864
|
-
__publicField(this, "_tmp1", new Vector3
|
|
50865
|
-
__publicField(this, "_tmp2", new Vector3
|
|
50864
|
+
__publicField(this, "_tmp1", new Vector3());
|
|
50865
|
+
__publicField(this, "_tmp2", new Vector3());
|
|
50866
50866
|
// saves
|
|
50867
|
-
__publicField(this, "_savedPosition", new Vector3
|
|
50868
|
-
__publicField(this, "_savedTarget", new Vector3
|
|
50867
|
+
__publicField(this, "_savedPosition", new Vector3(0, 0, -5));
|
|
50868
|
+
__publicField(this, "_savedTarget", new Vector3(0, 0, 0));
|
|
50869
50869
|
__publicField(this, "_onValueChanged", new distExports$1.SignalDispatcher());
|
|
50870
50870
|
__publicField(this, "_hasMoved");
|
|
50871
50871
|
__publicField(this, "_onMoved", new distExports$1.SignalDispatcher());
|
|
@@ -50875,18 +50875,18 @@ let Camera$1 = class Camera2 {
|
|
|
50875
50875
|
* Represents allowed movement along each axis using a Vector3 object.
|
|
50876
50876
|
* Each component of the Vector3 should be either 0 or 1 to enable/disable movement along the corresponding axis.
|
|
50877
50877
|
*/
|
|
50878
|
-
__publicField(this, "_allowedMovement", new Vector3
|
|
50879
|
-
__publicField(this, "_allowedRotation", new Vector2
|
|
50878
|
+
__publicField(this, "_allowedMovement", new Vector3(1, 1, 1));
|
|
50879
|
+
__publicField(this, "_allowedRotation", new Vector2(1, 1));
|
|
50880
50880
|
/**
|
|
50881
50881
|
* The default forward direction that can be used to initialize the camera.
|
|
50882
50882
|
*/
|
|
50883
|
-
__publicField(this, "_defaultForward", new Vector3
|
|
50883
|
+
__publicField(this, "_defaultForward", new Vector3(1, -1, 1).normalize());
|
|
50884
50884
|
// Settings
|
|
50885
50885
|
__publicField(this, "_velocityBlendFactor", 1e-4);
|
|
50886
50886
|
__publicField(this, "_moveSpeed", 1);
|
|
50887
50887
|
this.camPerspective = new PerspectiveWrapper(new PerspectiveCamera());
|
|
50888
|
-
this.camPerspective.camera.up = new Vector3
|
|
50889
|
-
this.camPerspective.camera.lookAt(new Vector3
|
|
50888
|
+
this.camPerspective.camera.up = new Vector3(0, 0, 1);
|
|
50889
|
+
this.camPerspective.camera.lookAt(new Vector3(0, 1, 0));
|
|
50890
50890
|
this.camOrthographic = new OrthographicWrapper(
|
|
50891
50891
|
new OrthographicCamera()
|
|
50892
50892
|
);
|
|
@@ -50922,7 +50922,7 @@ let Camera$1 = class Camera2 {
|
|
|
50922
50922
|
return this._onMoved.asEvent();
|
|
50923
50923
|
}
|
|
50924
50924
|
get allowedMovement() {
|
|
50925
|
-
return this._force ? new Vector3
|
|
50925
|
+
return this._force ? new Vector3(1, 1, 1) : this._allowedMovement;
|
|
50926
50926
|
}
|
|
50927
50927
|
set allowedMovement(axes) {
|
|
50928
50928
|
this._allowedMovement.copy(axes);
|
|
@@ -50935,7 +50935,7 @@ let Camera$1 = class Camera2 {
|
|
|
50935
50935
|
* Each component of the Vector2 should be either 0 or 1 to enable/disable rotation around the corresponding axis.
|
|
50936
50936
|
*/
|
|
50937
50937
|
get allowedRotation() {
|
|
50938
|
-
return this._force ? new Vector2
|
|
50938
|
+
return this._force ? new Vector2(1, 1) : this._allowedRotation;
|
|
50939
50939
|
}
|
|
50940
50940
|
set allowedRotation(axes) {
|
|
50941
50941
|
this._allowedRotation.copy(axes);
|
|
@@ -51011,7 +51011,7 @@ let Camera$1 = class Camera2 {
|
|
|
51011
51011
|
* The forward direction of the camera.
|
|
51012
51012
|
*/
|
|
51013
51013
|
get forward() {
|
|
51014
|
-
return this.camPerspective.camera.getWorldDirection(new Vector3
|
|
51014
|
+
return this.camPerspective.camera.getWorldDirection(new Vector3());
|
|
51015
51015
|
}
|
|
51016
51016
|
/**
|
|
51017
51017
|
* The camera speed factor.
|
|
@@ -51376,7 +51376,7 @@ class KeyboardHandler extends InputHandler$1 {
|
|
|
51376
51376
|
}
|
|
51377
51377
|
}
|
|
51378
51378
|
applyMove() {
|
|
51379
|
-
const move = new Vector3
|
|
51379
|
+
const move = new Vector3(
|
|
51380
51380
|
(this.isRightPressed ? 1 : 0) - (this.isLeftPressed ? 1 : 0),
|
|
51381
51381
|
(this.isEPressed ? 1 : 0) - (this.isQPressed ? 1 : 0),
|
|
51382
51382
|
(this.isUpPressed ? 1 : 0) - (this.isDownPressed ? 1 : 0)
|
|
@@ -51591,7 +51591,7 @@ class Raycaster2 {
|
|
|
51591
51591
|
const size = this._viewport.getSize();
|
|
51592
51592
|
const x = position.x / size.x * 2 - 1;
|
|
51593
51593
|
const y = -(position.y / size.y) * 2 + 1;
|
|
51594
|
-
target.setFromCamera(new Vector2
|
|
51594
|
+
target.setFromCamera(new Vector2(x, y), this._camera.three);
|
|
51595
51595
|
return target;
|
|
51596
51596
|
}
|
|
51597
51597
|
/**
|
|
@@ -51719,7 +51719,7 @@ class TouchHandler extends InputHandler$1 {
|
|
|
51719
51719
|
if (event.touches.length === 1) {
|
|
51720
51720
|
const pos = this.touchToVector(event.touches[0]);
|
|
51721
51721
|
const size = this.viewport.getSize();
|
|
51722
|
-
const delta = pos.clone().sub(this._touch).multiply(new Vector2
|
|
51722
|
+
const delta = pos.clone().sub(this._touch).multiply(new Vector2(1 / size.x, 1 / size.y));
|
|
51723
51723
|
this._touch = pos;
|
|
51724
51724
|
this.onDrag(delta);
|
|
51725
51725
|
return;
|
|
@@ -51732,7 +51732,7 @@ class TouchHandler extends InputHandler$1 {
|
|
|
51732
51732
|
const size = this.viewport.getSize();
|
|
51733
51733
|
const moveDelta = this._touch.clone().sub(p).multiply(
|
|
51734
51734
|
// -1 to invert movement
|
|
51735
|
-
new Vector2
|
|
51735
|
+
new Vector2(-1 / size.x, -1 / size.y)
|
|
51736
51736
|
);
|
|
51737
51737
|
const zoom2 = p1.distanceTo(p2);
|
|
51738
51738
|
const prevZoom = this._touch1.distanceTo(this._touch2);
|
|
@@ -51774,7 +51774,7 @@ class TouchHandler extends InputHandler$1 {
|
|
|
51774
51774
|
this.reg(canvas, "touchmove", this.onTouchMove);
|
|
51775
51775
|
}
|
|
51776
51776
|
toRotation(delta, speed) {
|
|
51777
|
-
const rotation = new Vector2
|
|
51777
|
+
const rotation = new Vector2();
|
|
51778
51778
|
rotation.x = delta.y;
|
|
51779
51779
|
rotation.y = delta.x;
|
|
51780
51780
|
rotation.multiplyScalar(-180 * speed);
|
|
@@ -51784,7 +51784,7 @@ class TouchHandler extends InputHandler$1 {
|
|
|
51784
51784
|
return this._touch !== void 0 && this._touchStartTime !== void 0 && this._touch1 === void 0 && this._touch2 === void 0;
|
|
51785
51785
|
}
|
|
51786
51786
|
touchToVector(touch) {
|
|
51787
|
-
return new Vector2
|
|
51787
|
+
return new Vector2(touch.pageX, touch.pageY);
|
|
51788
51788
|
}
|
|
51789
51789
|
average(p1, p2) {
|
|
51790
51790
|
return p1.clone().lerp(p2, 0.5);
|
|
@@ -51837,7 +51837,7 @@ class MouseHandler extends InputHandler$1 {
|
|
|
51837
51837
|
this.gizmoRect.visible = false;
|
|
51838
51838
|
});
|
|
51839
51839
|
__publicField(this, "onMouseMove", (event) => {
|
|
51840
|
-
this._lastPosition = new Vector2
|
|
51840
|
+
this._lastPosition = new Vector2(event.offsetX, event.offsetY);
|
|
51841
51841
|
if (!this._idlePosition || this._lastPosition.distanceTo(this._idlePosition) > 5) {
|
|
51842
51842
|
this.resetIdle();
|
|
51843
51843
|
}
|
|
@@ -51850,7 +51850,7 @@ class MouseHandler extends InputHandler$1 {
|
|
|
51850
51850
|
if (this._buttonDown) return;
|
|
51851
51851
|
this.inputs.ContextMenu(void 0);
|
|
51852
51852
|
this._hasCameraMoved = false;
|
|
51853
|
-
this._downPosition = new Vector2
|
|
51853
|
+
this._downPosition = new Vector2(event.offsetX, event.offsetY);
|
|
51854
51854
|
this._hasMouseMoved = false;
|
|
51855
51855
|
this.viewport.canvas.focus();
|
|
51856
51856
|
this._buttonDown = this.getButton(event);
|
|
@@ -51879,12 +51879,12 @@ class MouseHandler extends InputHandler$1 {
|
|
|
51879
51879
|
this.onRectEnd();
|
|
51880
51880
|
} else if (event.button === 0 && !this._hasMouseMoved) {
|
|
51881
51881
|
this.onMouseClick(
|
|
51882
|
-
new Vector2
|
|
51882
|
+
new Vector2(event.offsetX, event.offsetY),
|
|
51883
51883
|
false,
|
|
51884
51884
|
this.getModifier(event)
|
|
51885
51885
|
);
|
|
51886
51886
|
} else if (event.button === 2 && !this._hasMouseMoved) {
|
|
51887
|
-
this.inputs.ContextMenu(new Vector2
|
|
51887
|
+
this.inputs.ContextMenu(new Vector2(event.clientX, event.clientY));
|
|
51888
51888
|
}
|
|
51889
51889
|
this._buttonDown = void 0;
|
|
51890
51890
|
this.inputs.pointerOverride = void 0;
|
|
@@ -51892,7 +51892,7 @@ class MouseHandler extends InputHandler$1 {
|
|
|
51892
51892
|
__publicField(this, "onDoubleClick", (event) => {
|
|
51893
51893
|
event.stopImmediatePropagation();
|
|
51894
51894
|
this.onMouseClick(
|
|
51895
|
-
new Vector2
|
|
51895
|
+
new Vector2(event.offsetX, event.offsetY),
|
|
51896
51896
|
true,
|
|
51897
51897
|
this.getModifier(event)
|
|
51898
51898
|
);
|
|
@@ -51967,8 +51967,8 @@ class MouseHandler extends InputHandler$1 {
|
|
|
51967
51967
|
const deltaX = event.movementX || event.mozMovementX || event.webkitMovementX || 0;
|
|
51968
51968
|
const deltaY = event.movementY || event.mozMovementY || event.webkitMovementY || 0;
|
|
51969
51969
|
const size = this.viewport.getSize();
|
|
51970
|
-
const delta = new Vector2
|
|
51971
|
-
const position = new Vector2
|
|
51970
|
+
const delta = new Vector2(deltaX / size.x, deltaY / size.y);
|
|
51971
|
+
const position = new Vector2(event.offsetX, event.offsetY);
|
|
51972
51972
|
this._hasMouseMoved = this._hasMouseMoved || this._downPosition && ((_a2 = this._downPosition) == null ? void 0 : _a2.distanceTo(position)) > 4;
|
|
51973
51973
|
switch (this._buttonDown) {
|
|
51974
51974
|
case "main":
|
|
@@ -52028,8 +52028,8 @@ class MouseHandler extends InputHandler$1 {
|
|
|
52028
52028
|
onRectEnd() {
|
|
52029
52029
|
const box = this.gizmoRect.getBoundingBox();
|
|
52030
52030
|
if (!box) return;
|
|
52031
|
-
const center = box.getCenter(new Vector3
|
|
52032
|
-
const size = box.getSize(new Vector3
|
|
52031
|
+
const center = box.getCenter(new Vector3());
|
|
52032
|
+
const size = box.getSize(new Vector3());
|
|
52033
52033
|
size.multiplyScalar(0.5);
|
|
52034
52034
|
box.setFromCenterAndSize(center, size);
|
|
52035
52035
|
this._viewer.camera.lerp(1).frame(box);
|
|
@@ -52237,7 +52237,7 @@ class DefaultInputScheme {
|
|
|
52237
52237
|
}
|
|
52238
52238
|
}
|
|
52239
52239
|
onIdleAction(hit) {
|
|
52240
|
-
if (!this._viewer.gizmos.
|
|
52240
|
+
if (!this._viewer.gizmos.sectionBox.interactive) {
|
|
52241
52241
|
this._viewer.selection.focus(hit == null ? void 0 : hit.object);
|
|
52242
52242
|
}
|
|
52243
52243
|
}
|
|
@@ -52459,7 +52459,7 @@ class Selection {
|
|
|
52459
52459
|
* @param {THREE.Box3} [target] Optional parameter to specify a box to use for the result.
|
|
52460
52460
|
* @returns {THREE.Box3 | undefined} The bounding box of the selection or `undefined` if no selection exists.
|
|
52461
52461
|
*/
|
|
52462
|
-
getBoundingBox(target = new Box3
|
|
52462
|
+
getBoundingBox(target = new Box3()) {
|
|
52463
52463
|
if (this._objects.size === 0) return;
|
|
52464
52464
|
let initialized = false;
|
|
52465
52465
|
for (const o of this._objects) {
|
|
@@ -52814,7 +52814,7 @@ class CSS2DObject extends Object3D$1 {
|
|
|
52814
52814
|
this.element.style.position = "absolute";
|
|
52815
52815
|
this.element.style.userSelect = "none";
|
|
52816
52816
|
this.element.setAttribute("draggable", false);
|
|
52817
|
-
this.center = new Vector2
|
|
52817
|
+
this.center = new Vector2(0.5, 0.5);
|
|
52818
52818
|
this.addEventListener("removed", function() {
|
|
52819
52819
|
this.traverse(function(object) {
|
|
52820
52820
|
if (object.element instanceof object.element.ownerDocument.defaultView.Element && object.element.parentNode !== null) {
|
|
@@ -52830,11 +52830,11 @@ class CSS2DObject extends Object3D$1 {
|
|
|
52830
52830
|
return this;
|
|
52831
52831
|
}
|
|
52832
52832
|
}
|
|
52833
|
-
const _vector = new Vector3
|
|
52833
|
+
const _vector = new Vector3();
|
|
52834
52834
|
const _viewMatrix = new Matrix4();
|
|
52835
52835
|
const _viewProjectionMatrix = new Matrix4();
|
|
52836
|
-
const _a = new Vector3
|
|
52837
|
-
const _b = new Vector3
|
|
52836
|
+
const _a = new Vector3();
|
|
52837
|
+
const _b = new Vector3();
|
|
52838
52838
|
class CSS2DRenderer {
|
|
52839
52839
|
constructor(parameters = {}) {
|
|
52840
52840
|
const _this = this;
|
|
@@ -52967,8 +52967,8 @@ class RenderScene {
|
|
|
52967
52967
|
* Returns the bounding box encompasing all rendererd objects.
|
|
52968
52968
|
* @param target box in which to copy result, a new instance is created if undefined.
|
|
52969
52969
|
*/
|
|
52970
|
-
getBoundingBox(target = new Box3
|
|
52971
|
-
return this._boundingBox ? target.copy(this._boundingBox) : target.set(new Vector3
|
|
52970
|
+
getBoundingBox(target = new Box3()) {
|
|
52971
|
+
return this._boundingBox ? target.copy(this._boundingBox) : target.set(new Vector3(-1, -1, -1), new Vector3(1, 1, 1));
|
|
52972
52972
|
}
|
|
52973
52973
|
/**
|
|
52974
52974
|
* Returns the bounding box of the average center of all meshes.
|
|
@@ -52976,9 +52976,9 @@ class RenderScene {
|
|
|
52976
52976
|
*/
|
|
52977
52977
|
getAverageBoundingBox() {
|
|
52978
52978
|
if (this._vimScenes.length === 0) {
|
|
52979
|
-
return new Box3
|
|
52979
|
+
return new Box3();
|
|
52980
52980
|
}
|
|
52981
|
-
const result = new Box3
|
|
52981
|
+
const result = new Box3();
|
|
52982
52982
|
result.copy(this._vimScenes[0].getAverageBoundingBox());
|
|
52983
52983
|
for (let i = 1; i < this._vimScenes.length; i++) {
|
|
52984
52984
|
result.union(this._vimScenes[i].getAverageBoundingBox());
|
|
@@ -53180,7 +53180,7 @@ let Viewport$1 = class Viewport {
|
|
|
53180
53180
|
* @returns {THREE.Vector2} The pixel size of the parent element.
|
|
53181
53181
|
*/
|
|
53182
53182
|
getParentSize() {
|
|
53183
|
-
return new Vector2
|
|
53183
|
+
return new Vector2(
|
|
53184
53184
|
this.getParentWidth(),
|
|
53185
53185
|
this.getParentHeight()
|
|
53186
53186
|
);
|
|
@@ -53198,7 +53198,7 @@ let Viewport$1 = class Viewport {
|
|
|
53198
53198
|
* @returns {THREE.Vector2} The pixel size of the canvas.
|
|
53199
53199
|
*/
|
|
53200
53200
|
getSize() {
|
|
53201
|
-
return new Vector2
|
|
53201
|
+
return new Vector2(this.canvas.clientWidth, this.canvas.clientHeight);
|
|
53202
53202
|
}
|
|
53203
53203
|
/**
|
|
53204
53204
|
* Calculates and returns the aspect ratio of the parent element.
|
|
@@ -53260,64 +53260,64 @@ function createAxes(settings2) {
|
|
|
53260
53260
|
return [
|
|
53261
53261
|
new Axis({
|
|
53262
53262
|
axis: "x",
|
|
53263
|
-
direction: new Vector3
|
|
53263
|
+
direction: new Vector3(1, 0, 0),
|
|
53264
53264
|
size: settings2.bubbleSizePrimary,
|
|
53265
53265
|
color: settings2.colorX,
|
|
53266
53266
|
colorSub: settings2.colorXSub,
|
|
53267
53267
|
line: settings2.lineWidth,
|
|
53268
53268
|
label: "X",
|
|
53269
|
-
position: new Vector3
|
|
53269
|
+
position: new Vector3(0, 0, 0)
|
|
53270
53270
|
}),
|
|
53271
53271
|
new Axis({
|
|
53272
53272
|
axis: "y",
|
|
53273
|
-
direction: new Vector3
|
|
53273
|
+
direction: new Vector3(0, 1, 0),
|
|
53274
53274
|
size: settings2.bubbleSizePrimary,
|
|
53275
53275
|
color: settings2.colorY,
|
|
53276
53276
|
colorSub: settings2.colorYSub,
|
|
53277
53277
|
line: settings2.lineWidth,
|
|
53278
53278
|
label: "Y",
|
|
53279
|
-
position: new Vector3
|
|
53279
|
+
position: new Vector3(0, 0, 0)
|
|
53280
53280
|
}),
|
|
53281
53281
|
new Axis({
|
|
53282
53282
|
axis: "z",
|
|
53283
|
-
direction: new Vector3
|
|
53283
|
+
direction: new Vector3(0, 0, 1),
|
|
53284
53284
|
size: settings2.bubbleSizePrimary,
|
|
53285
53285
|
color: settings2.colorZ,
|
|
53286
53286
|
colorSub: settings2.colorZSub,
|
|
53287
53287
|
line: settings2.lineWidth,
|
|
53288
53288
|
label: "Z",
|
|
53289
|
-
position: new Vector3
|
|
53289
|
+
position: new Vector3(0, 0, 0)
|
|
53290
53290
|
}),
|
|
53291
53291
|
new Axis({
|
|
53292
53292
|
axis: "-x",
|
|
53293
|
-
direction: new Vector3
|
|
53293
|
+
direction: new Vector3(-1, 0, 0),
|
|
53294
53294
|
size: settings2.bubbleSizeSecondary,
|
|
53295
53295
|
color: settings2.colorX,
|
|
53296
53296
|
colorSub: settings2.colorXSub,
|
|
53297
53297
|
line: void 0,
|
|
53298
53298
|
label: void 0,
|
|
53299
|
-
position: new Vector3
|
|
53299
|
+
position: new Vector3(0, 0, 0)
|
|
53300
53300
|
}),
|
|
53301
53301
|
new Axis({
|
|
53302
53302
|
axis: "-y",
|
|
53303
|
-
direction: new Vector3
|
|
53303
|
+
direction: new Vector3(0, -1, 0),
|
|
53304
53304
|
size: settings2.bubbleSizeSecondary,
|
|
53305
53305
|
color: settings2.colorY,
|
|
53306
53306
|
colorSub: settings2.colorYSub,
|
|
53307
53307
|
line: void 0,
|
|
53308
53308
|
label: void 0,
|
|
53309
|
-
position: new Vector3
|
|
53309
|
+
position: new Vector3(0, 0, 0)
|
|
53310
53310
|
}),
|
|
53311
53311
|
new Axis({
|
|
53312
53312
|
axis: "-z",
|
|
53313
53313
|
// inverted Z
|
|
53314
|
-
direction: new Vector3
|
|
53314
|
+
direction: new Vector3(0, 0, -1),
|
|
53315
53315
|
size: settings2.bubbleSizeSecondary,
|
|
53316
53316
|
color: settings2.colorZ,
|
|
53317
53317
|
colorSub: settings2.colorZSub,
|
|
53318
53318
|
line: void 0,
|
|
53319
53319
|
label: void 0,
|
|
53320
|
-
position: new Vector3
|
|
53320
|
+
position: new Vector3(0, 0, 0)
|
|
53321
53321
|
})
|
|
53322
53322
|
];
|
|
53323
53323
|
}
|
|
@@ -53338,9 +53338,9 @@ class GizmoAxes {
|
|
|
53338
53338
|
__publicField(this, "_pointerInside", false);
|
|
53339
53339
|
__publicField(this, "_isDragging", false);
|
|
53340
53340
|
__publicField(this, "_isDragSignificant", false);
|
|
53341
|
-
__publicField(this, "_dragStart", new Vector2
|
|
53342
|
-
__publicField(this, "_dragLast", new Vector2
|
|
53343
|
-
__publicField(this, "_pointer", new Vector3
|
|
53341
|
+
__publicField(this, "_dragStart", new Vector2());
|
|
53342
|
+
__publicField(this, "_dragLast", new Vector2());
|
|
53343
|
+
__publicField(this, "_pointer", new Vector3());
|
|
53344
53344
|
__publicField(this, "_center");
|
|
53345
53345
|
__publicField(this, "_invRotMat", new Matrix4());
|
|
53346
53346
|
__publicField(this, "_selectedAxis", null);
|
|
@@ -53438,7 +53438,7 @@ class GizmoAxes {
|
|
|
53438
53438
|
const margin = 24 * ratio;
|
|
53439
53439
|
this._canvas.style.top = `${margin}px`;
|
|
53440
53440
|
this._canvas.style.right = `${margin}px`;
|
|
53441
|
-
this._center = new Vector3
|
|
53441
|
+
this._center = new Vector3(size / 2, size / 2, 0);
|
|
53442
53442
|
this._axes = createAxes(this._options);
|
|
53443
53443
|
}
|
|
53444
53444
|
createCanvas() {
|
|
@@ -53464,14 +53464,14 @@ class GizmoAxes {
|
|
|
53464
53464
|
}
|
|
53465
53465
|
}
|
|
53466
53466
|
updateDrag(x, y) {
|
|
53467
|
-
if (new Vector2
|
|
53467
|
+
if (new Vector2(x, y).sub(this._dragStart).length() > 3) {
|
|
53468
53468
|
this._isDragSignificant = true;
|
|
53469
53469
|
}
|
|
53470
|
-
const drag = new Vector2
|
|
53470
|
+
const drag = new Vector2(x, y).sub(this._dragLast);
|
|
53471
53471
|
this._dragLast.set(x, y);
|
|
53472
53472
|
const rotX = drag.y / this._canvas.height;
|
|
53473
53473
|
const rotY = drag.x / this._canvas.width;
|
|
53474
|
-
this._camera.snap().orbit(new Vector2
|
|
53474
|
+
this._camera.snap().orbit(new Vector2(rotX * -180, rotY * -180));
|
|
53475
53475
|
}
|
|
53476
53476
|
endDrag() {
|
|
53477
53477
|
this._isDragging = false;
|
|
@@ -53489,8 +53489,8 @@ class GizmoAxes {
|
|
|
53489
53489
|
const axis = this._axes[i];
|
|
53490
53490
|
const highlight = this._selectedAxis === axis;
|
|
53491
53491
|
const color = axis.position.z >= -0.01 ? axis.color : axis.colorSub;
|
|
53492
|
-
const center2 = new Vector2
|
|
53493
|
-
const pos2 = new Vector2
|
|
53492
|
+
const center2 = new Vector2(this._center.x, this._center.y);
|
|
53493
|
+
const pos2 = new Vector2(axis.position.x, axis.position.y);
|
|
53494
53494
|
if (axis.line) this.drawLine(center2, pos2, axis.line, color);
|
|
53495
53495
|
const circleColor = new Color(color);
|
|
53496
53496
|
circleColor.multiplyScalar(highlight ? 1.5 : 1);
|
|
@@ -53854,14 +53854,14 @@ class GizmoRectangle {
|
|
|
53854
53854
|
const center = A.clone().add(B).multiplyScalar(0.5);
|
|
53855
53855
|
const [dx, dy] = this.getBoxSize(A, B);
|
|
53856
53856
|
this.updateRect(center, dx, dy);
|
|
53857
|
-
const AB = this.getIntersection(plane, new Vector2
|
|
53858
|
-
const BA = this.getIntersection(plane, new Vector2
|
|
53857
|
+
const AB = this.getIntersection(plane, new Vector2(posA.x, posB.y));
|
|
53858
|
+
const BA = this.getIntersection(plane, new Vector2(posB.x, posA.y));
|
|
53859
53859
|
if (!AB || !BA) return;
|
|
53860
53860
|
this.points = [A, B, AB, BA, center];
|
|
53861
53861
|
}
|
|
53862
53862
|
getIntersection(plane, position) {
|
|
53863
53863
|
const raycaster = this.viewer.raycaster.fromPoint2(position);
|
|
53864
|
-
return raycaster.ray.intersectPlane(plane, new Vector3
|
|
53864
|
+
return raycaster.ray.intersectPlane(plane, new Vector3()) ?? void 0;
|
|
53865
53865
|
}
|
|
53866
53866
|
updateRect(position, dx, dy) {
|
|
53867
53867
|
this.line.quaternion.copy(this.viewer.camera.quaternion);
|
|
@@ -53872,8 +53872,8 @@ class GizmoRectangle {
|
|
|
53872
53872
|
}
|
|
53873
53873
|
getBoxSize(A, B) {
|
|
53874
53874
|
const cam = this.viewer.camera;
|
|
53875
|
-
const up = new Vector3
|
|
53876
|
-
const right = new Vector3
|
|
53875
|
+
const up = new Vector3(0, 1, 0).applyQuaternion(cam.quaternion);
|
|
53876
|
+
const right = new Vector3(1, 0, 0).applyQuaternion(cam.quaternion);
|
|
53877
53877
|
const Ax = A.dot(right);
|
|
53878
53878
|
const Ay = A.dot(up);
|
|
53879
53879
|
const Bx = B.dot(right);
|
|
@@ -53891,7 +53891,7 @@ class GizmoRectangle {
|
|
|
53891
53891
|
* X-----X
|
|
53892
53892
|
* @returns {THREE.Box3} The bounding box of the selection.
|
|
53893
53893
|
*/
|
|
53894
|
-
getBoundingBox(target = new Box3
|
|
53894
|
+
getBoundingBox(target = new Box3()) {
|
|
53895
53895
|
const position = this.getClosestHit();
|
|
53896
53896
|
const projections = position ? this.projectPoints(position) : this.points;
|
|
53897
53897
|
if (!projections) return;
|
|
@@ -53923,7 +53923,7 @@ class GizmoRectangle {
|
|
|
53923
53923
|
this.viewer.camera.forward,
|
|
53924
53924
|
position
|
|
53925
53925
|
);
|
|
53926
|
-
return (_a2 = this.points) == null ? void 0 : _a2.map((p) => plane.projectPoint(p, new Vector3
|
|
53926
|
+
return (_a2 = this.points) == null ? void 0 : _a2.map((p) => plane.projectPoint(p, new Vector3()));
|
|
53927
53927
|
}
|
|
53928
53928
|
}
|
|
53929
53929
|
class MeasureFlow {
|
|
@@ -54057,7 +54057,7 @@ MeshLine.prototype.setPoints = function(points, wcb) {
|
|
|
54057
54057
|
this.widthCallback = wcb;
|
|
54058
54058
|
this.positions = [];
|
|
54059
54059
|
this.counters = [];
|
|
54060
|
-
if (points.length && points[0] instanceof Vector3
|
|
54060
|
+
if (points.length && points[0] instanceof Vector3) {
|
|
54061
54061
|
for (let j = 0; j < points.length; j++) {
|
|
54062
54062
|
const p = points[j];
|
|
54063
54063
|
const c = j / points.length;
|
|
@@ -54081,7 +54081,7 @@ function MeshLineRaycast(raycaster, intersects2) {
|
|
|
54081
54081
|
const inverseMatrix = new Matrix4();
|
|
54082
54082
|
const ray = new Ray();
|
|
54083
54083
|
const sphere = new Sphere();
|
|
54084
|
-
const interRay = new Vector3
|
|
54084
|
+
const interRay = new Vector3();
|
|
54085
54085
|
const geometry = this.geometry;
|
|
54086
54086
|
if (!geometry.boundingSphere) geometry.computeBoundingSphere();
|
|
54087
54087
|
sphere.copy(geometry.boundingSphere);
|
|
@@ -54091,9 +54091,9 @@ function MeshLineRaycast(raycaster, intersects2) {
|
|
|
54091
54091
|
}
|
|
54092
54092
|
inverseMatrix.copy(this.matrixWorld).invert();
|
|
54093
54093
|
ray.copy(raycaster.ray).applyMatrix4(inverseMatrix);
|
|
54094
|
-
const vStart = new Vector3
|
|
54095
|
-
const vEnd = new Vector3
|
|
54096
|
-
const interSegment = new Vector3
|
|
54094
|
+
const vStart = new Vector3();
|
|
54095
|
+
const vEnd = new Vector3();
|
|
54096
|
+
const interSegment = new Vector3();
|
|
54097
54097
|
const step = this instanceof LineSegments ? 2 : 1;
|
|
54098
54098
|
const index2 = geometry.index;
|
|
54099
54099
|
const attributes = geometry.attributes;
|
|
@@ -54396,7 +54396,7 @@ class MeshLineMaterial extends ShaderMaterial {
|
|
|
54396
54396
|
useAlphaMap: { value: 0 },
|
|
54397
54397
|
color: { value: new Color(16777215) },
|
|
54398
54398
|
opacity: { value: 1 },
|
|
54399
|
-
resolution: { value: new Vector2
|
|
54399
|
+
resolution: { value: new Vector2(1, 1) },
|
|
54400
54400
|
sizeAttenuation: { value: 1 },
|
|
54401
54401
|
dashArray: { value: 0 },
|
|
54402
54402
|
dashOffset: { value: 0 },
|
|
@@ -54404,7 +54404,7 @@ class MeshLineMaterial extends ShaderMaterial {
|
|
|
54404
54404
|
useDash: { value: 0 },
|
|
54405
54405
|
visibility: { value: 1 },
|
|
54406
54406
|
alphaTest: { value: 0 },
|
|
54407
|
-
repeat: { value: new Vector2
|
|
54407
|
+
repeat: { value: new Vector2(1, 1) }
|
|
54408
54408
|
}),
|
|
54409
54409
|
vertexShader: ShaderChunk.meshline_vert,
|
|
54410
54410
|
fragmentShader: ShaderChunk.meshline_frag
|
|
@@ -54795,12 +54795,12 @@ class MeasureGizmo {
|
|
|
54795
54795
|
const xz = this.screenDist(this._lineX.position, this._lineZ.position);
|
|
54796
54796
|
const yz = this.screenDist(this._lineY.position, this._lineZ.position);
|
|
54797
54797
|
let conflicts = 0;
|
|
54798
|
-
if (lx !== void 0 && lx < 0.
|
|
54799
|
-
if (ly !== void 0 && ly < 0.
|
|
54800
|
-
if (lz !== void 0 && lz < 0.
|
|
54801
|
-
if (xy !== void 0 && xy < 0.
|
|
54802
|
-
if (xz !== void 0 && xz < 0.
|
|
54803
|
-
if (yz !== void 0 && yz < 0.
|
|
54798
|
+
if (lx !== void 0 && lx < 0.3) conflicts++;
|
|
54799
|
+
if (ly !== void 0 && ly < 0.3) conflicts++;
|
|
54800
|
+
if (lz !== void 0 && lz < 0.3) conflicts++;
|
|
54801
|
+
if (xy !== void 0 && xy < 0.3) conflicts++;
|
|
54802
|
+
if (xz !== void 0 && xz < 0.3) conflicts++;
|
|
54803
|
+
if (yz !== void 0 && yz < 0.3) conflicts++;
|
|
54804
54804
|
const collapse2 = conflicts > 1;
|
|
54805
54805
|
this._label.visible = collapse2;
|
|
54806
54806
|
this._line.label.visible = !collapse2;
|
|
@@ -54830,6 +54830,7 @@ class MeasureGizmo {
|
|
|
54830
54830
|
this._line.mesh.visible = false;
|
|
54831
54831
|
this._line.label.visible = false;
|
|
54832
54832
|
}
|
|
54833
|
+
this._label.visible = false;
|
|
54833
54834
|
this._viewer.renderer.needsUpdate = true;
|
|
54834
54835
|
}
|
|
54835
54836
|
/**
|
|
@@ -54879,7 +54880,9 @@ class MeasureGizmo {
|
|
|
54879
54880
|
* Disposes all resources.
|
|
54880
54881
|
*/
|
|
54881
54882
|
dispose() {
|
|
54883
|
+
console.log("dispose");
|
|
54882
54884
|
if (this._animId !== void 0) cancelAnimationFrame(this._animId);
|
|
54885
|
+
this._html.div.remove();
|
|
54883
54886
|
this._viewer.renderer.remove(this._group);
|
|
54884
54887
|
this._startMarker.dispose();
|
|
54885
54888
|
this._endMarker.dispose();
|
|
@@ -55062,7 +55065,7 @@ class BoxInputs {
|
|
|
55062
55065
|
/** The currently hovered/dragged handle, if any. */
|
|
55063
55066
|
__publicField(this, "_handle");
|
|
55064
55067
|
/** The origin point for dragging, updated on pointer down. */
|
|
55065
|
-
__publicField(this, "_dragOrigin", new Vector3
|
|
55068
|
+
__publicField(this, "_dragOrigin", new Vector3());
|
|
55066
55069
|
/** The plane used for drag intersection (perpendicular to the camera direction). */
|
|
55067
55070
|
__publicField(this, "_dragPlane", new Plane());
|
|
55068
55071
|
/** Whether a pointer is currently down on a handle. */
|
|
@@ -55070,7 +55073,7 @@ class BoxInputs {
|
|
|
55070
55073
|
/** A reusable Raycaster for picking and plane intersection. */
|
|
55071
55074
|
__publicField(this, "_raycaster", new Raycaster$1());
|
|
55072
55075
|
/** The box state before the current drag. */
|
|
55073
|
-
__publicField(this, "_lastBox", new Box3
|
|
55076
|
+
__publicField(this, "_lastBox", new Box3());
|
|
55074
55077
|
/** A collection of unregister callbacks for event listeners. */
|
|
55075
55078
|
__publicField(this, "_unregisters", []);
|
|
55076
55079
|
/** The ID of the pointer that is captured, if any. */
|
|
@@ -55155,7 +55158,7 @@ class BoxInputs {
|
|
|
55155
55158
|
onPointerLeave(event) {
|
|
55156
55159
|
var _a2, _b2;
|
|
55157
55160
|
if (!this.pointerCaptured) {
|
|
55158
|
-
(_b2 = this.onFaceEnter) == null ? void 0 : _b2.call(this, ((_a2 = this._handle) == null ? void 0 : _a2.forward) ?? new Vector3
|
|
55161
|
+
(_b2 = this.onFaceEnter) == null ? void 0 : _b2.call(this, ((_a2 = this._handle) == null ? void 0 : _a2.forward) ?? new Vector3());
|
|
55159
55162
|
}
|
|
55160
55163
|
}
|
|
55161
55164
|
/**
|
|
@@ -55190,13 +55193,13 @@ class BoxInputs {
|
|
|
55190
55193
|
this.onDrag(event);
|
|
55191
55194
|
return;
|
|
55192
55195
|
}
|
|
55193
|
-
const hits = this.raycast(new Vector2
|
|
55196
|
+
const hits = this.raycast(new Vector2(event.offsetX, event.offsetY));
|
|
55194
55197
|
const handle = (_b2 = (_a2 = hits == null ? void 0 : hits[0]) == null ? void 0 : _a2.object) == null ? void 0 : _b2.userData.handle;
|
|
55195
55198
|
if (handle !== this._handle) {
|
|
55196
55199
|
(_c = this._handle) == null ? void 0 : _c.highlight(false);
|
|
55197
55200
|
handle == null ? void 0 : handle.highlight(true);
|
|
55198
55201
|
this._handle = handle;
|
|
55199
|
-
(_d = this.onFaceEnter) == null ? void 0 : _d.call(this, (handle == null ? void 0 : handle.forward) ?? new Vector3
|
|
55202
|
+
(_d = this.onFaceEnter) == null ? void 0 : _d.call(this, (handle == null ? void 0 : handle.forward) ?? new Vector3());
|
|
55200
55203
|
}
|
|
55201
55204
|
}
|
|
55202
55205
|
/**
|
|
@@ -55214,7 +55217,7 @@ class BoxInputs {
|
|
|
55214
55217
|
this.onMouseMove(event);
|
|
55215
55218
|
} else {
|
|
55216
55219
|
this._handle = void 0;
|
|
55217
|
-
(_a2 = this.onFaceEnter) == null ? void 0 : _a2.call(this, new Vector3
|
|
55220
|
+
(_a2 = this.onFaceEnter) == null ? void 0 : _a2.call(this, new Vector3());
|
|
55218
55221
|
}
|
|
55219
55222
|
(_b2 = this.onBoxConfirm) == null ? void 0 : _b2.call(this, this._sharedBox);
|
|
55220
55223
|
}
|
|
@@ -55226,7 +55229,7 @@ class BoxInputs {
|
|
|
55226
55229
|
*/
|
|
55227
55230
|
onMouseDown(event) {
|
|
55228
55231
|
var _a2, _b2, _c, _d;
|
|
55229
|
-
const hits = this.raycast(new Vector2
|
|
55232
|
+
const hits = this.raycast(new Vector2(event.offsetX, event.offsetY));
|
|
55230
55233
|
const handle = (_c = (_b2 = (_a2 = hits == null ? void 0 : hits[0]) == null ? void 0 : _a2.object) == null ? void 0 : _b2.userData) == null ? void 0 : _c.handle;
|
|
55231
55234
|
if (!handle) return;
|
|
55232
55235
|
this._handle = handle;
|
|
@@ -55248,7 +55251,7 @@ class BoxInputs {
|
|
|
55248
55251
|
onDrag(event) {
|
|
55249
55252
|
var _a2;
|
|
55250
55253
|
if (!this._handle) return;
|
|
55251
|
-
const point = this.raycastPlane(new Vector2
|
|
55254
|
+
const point = this.raycastPlane(new Vector2(event.offsetX, event.offsetY)) ?? this._dragOrigin.clone();
|
|
55252
55255
|
const delta = point.sub(this._dragOrigin);
|
|
55253
55256
|
const amount = delta.dot(this._handle.forward);
|
|
55254
55257
|
const box = this.stretch(this._handle.axis, this._handle.sign, amount);
|
|
@@ -55302,7 +55305,7 @@ class BoxInputs {
|
|
|
55302
55305
|
raycastPlane(position) {
|
|
55303
55306
|
return this.getRaycaster(position).ray.intersectPlane(
|
|
55304
55307
|
this._dragPlane,
|
|
55305
|
-
new Vector3
|
|
55308
|
+
new Vector3()
|
|
55306
55309
|
);
|
|
55307
55310
|
}
|
|
55308
55311
|
}
|
|
@@ -55450,15 +55453,24 @@ class SectionBoxHandle extends Mesh {
|
|
|
55450
55453
|
__publicField(this, "_color");
|
|
55451
55454
|
__publicField(this, "_highlightColor");
|
|
55452
55455
|
__publicField(this, "_materials");
|
|
55456
|
+
__publicField(this, "_camSub");
|
|
55453
55457
|
this._materials = [matAlways, matBehind];
|
|
55454
|
-
this._forward = new Vector3
|
|
55458
|
+
this._forward = new Vector3();
|
|
55455
55459
|
this.forward[axes] = sign2;
|
|
55456
55460
|
this.axis = axes;
|
|
55457
55461
|
this.sign = sign2;
|
|
55458
55462
|
this._color = color ?? new Color(0);
|
|
55459
55463
|
this._highlightColor = this._color.clone().lerp(new Color(13421772), 0.8);
|
|
55460
55464
|
this.userData.handle = this;
|
|
55461
|
-
this.quaternion.setFromUnitVectors(new Vector3
|
|
55465
|
+
this.quaternion.setFromUnitVectors(new Vector3(0, -1, 0), this._forward);
|
|
55466
|
+
}
|
|
55467
|
+
trackCamera(camera2) {
|
|
55468
|
+
const rescale = () => {
|
|
55469
|
+
const size = camera2.frustrumSizeAt(this.position);
|
|
55470
|
+
this.scale.set(size.x * 3e-3, size.x * 3e-3, size.x * 3e-3);
|
|
55471
|
+
};
|
|
55472
|
+
this._camSub = camera2.onMoved.subscribe(() => rescale());
|
|
55473
|
+
rescale();
|
|
55462
55474
|
}
|
|
55463
55475
|
setPosition(position) {
|
|
55464
55476
|
this.position.copy(position);
|
|
@@ -55471,8 +55483,10 @@ class SectionBoxHandle extends Mesh {
|
|
|
55471
55483
|
this.material[1].color.set(value ? this._highlightColor : this._color);
|
|
55472
55484
|
}
|
|
55473
55485
|
dispose() {
|
|
55486
|
+
var _a2;
|
|
55474
55487
|
this.geometry.dispose();
|
|
55475
55488
|
this._materials.forEach((m) => m.dispose());
|
|
55489
|
+
(_a2 = this._camSub) == null ? void 0 : _a2.call(this);
|
|
55476
55490
|
}
|
|
55477
55491
|
}
|
|
55478
55492
|
function createDoubleCone(size) {
|
|
@@ -55488,7 +55502,7 @@ function createDoubleCone(size) {
|
|
|
55488
55502
|
return mergedGeo;
|
|
55489
55503
|
}
|
|
55490
55504
|
class SectionBoxHandles {
|
|
55491
|
-
constructor() {
|
|
55505
|
+
constructor(camera2) {
|
|
55492
55506
|
__publicField(this, "up");
|
|
55493
55507
|
__publicField(this, "down");
|
|
55494
55508
|
__publicField(this, "left");
|
|
@@ -55503,6 +55517,12 @@ class SectionBoxHandles {
|
|
|
55503
55517
|
this.right = new SectionBoxHandle("x", 1, size, new Color(16711680));
|
|
55504
55518
|
this.front = new SectionBoxHandle("z", 1, size, new Color(255));
|
|
55505
55519
|
this.back = new SectionBoxHandle("z", -1, size, new Color(255));
|
|
55520
|
+
this.up.trackCamera(camera2);
|
|
55521
|
+
this.down.trackCamera(camera2);
|
|
55522
|
+
this.left.trackCamera(camera2);
|
|
55523
|
+
this.right.trackCamera(camera2);
|
|
55524
|
+
this.front.trackCamera(camera2);
|
|
55525
|
+
this.back.trackCamera(camera2);
|
|
55506
55526
|
this.meshes = new Group();
|
|
55507
55527
|
this.meshes.add(this.up);
|
|
55508
55528
|
this.meshes.add(this.down);
|
|
@@ -55518,13 +55538,13 @@ class SectionBoxHandles {
|
|
|
55518
55538
|
this.meshes.visible = value;
|
|
55519
55539
|
}
|
|
55520
55540
|
fitBox(box) {
|
|
55521
|
-
const center = box.getCenter(new Vector3
|
|
55522
|
-
this.up.setPosition(new Vector3
|
|
55523
|
-
this.down.setPosition(new Vector3
|
|
55524
|
-
this.left.setPosition(new Vector3
|
|
55525
|
-
this.right.setPosition(new Vector3
|
|
55526
|
-
this.front.setPosition(new Vector3
|
|
55527
|
-
this.back.setPosition(new Vector3
|
|
55541
|
+
const center = box.getCenter(new Vector3());
|
|
55542
|
+
this.up.setPosition(new Vector3(center.x, box.max.y, center.z));
|
|
55543
|
+
this.down.setPosition(new Vector3(center.x, box.min.y, center.z));
|
|
55544
|
+
this.left.setPosition(new Vector3(box.min.x, center.y, center.z));
|
|
55545
|
+
this.right.setPosition(new Vector3(box.max.x, center.y, center.z));
|
|
55546
|
+
this.front.setPosition(new Vector3(center.x, center.y, box.max.z));
|
|
55547
|
+
this.back.setPosition(new Vector3(center.x, center.y, box.min.z));
|
|
55528
55548
|
}
|
|
55529
55549
|
dispose() {
|
|
55530
55550
|
this.up.dispose();
|
|
@@ -55536,7 +55556,7 @@ class SectionBoxHandles {
|
|
|
55536
55556
|
}
|
|
55537
55557
|
}
|
|
55538
55558
|
class SectionBoxGizmo {
|
|
55539
|
-
constructor(renderer) {
|
|
55559
|
+
constructor(renderer, camera2) {
|
|
55540
55560
|
__publicField(this, "_renderer");
|
|
55541
55561
|
__publicField(this, "cube");
|
|
55542
55562
|
__publicField(this, "outline");
|
|
@@ -55545,7 +55565,7 @@ class SectionBoxGizmo {
|
|
|
55545
55565
|
this._renderer = renderer;
|
|
55546
55566
|
this.cube = new SectionBoxMesh();
|
|
55547
55567
|
this.outline = new SectionBoxOutline(new Color(8882833));
|
|
55548
|
-
this.handles = new SectionBoxHandles();
|
|
55568
|
+
this.handles = new SectionBoxHandles(camera2);
|
|
55549
55569
|
this._renderer.add(this.outline);
|
|
55550
55570
|
this._renderer.add(this.handles.meshes);
|
|
55551
55571
|
this.visible = false;
|
|
@@ -55596,7 +55616,7 @@ let SectionBox$1 = class SectionBox {
|
|
|
55596
55616
|
__publicField(this, "_onBoxConfirm", new distExports.SimpleEventDispatcher());
|
|
55597
55617
|
__publicField(this, "_onHover", new distExports.SimpleEventDispatcher());
|
|
55598
55618
|
this._viewer = viewer;
|
|
55599
|
-
this._gizmos = new SectionBoxGizmo(viewer.renderer);
|
|
55619
|
+
this._gizmos = new SectionBoxGizmo(viewer.renderer, viewer.camera);
|
|
55600
55620
|
this._inputs = new BoxInputs(
|
|
55601
55621
|
viewer,
|
|
55602
55622
|
this._gizmos.handles,
|
|
@@ -55611,6 +55631,9 @@ let SectionBox$1 = class SectionBox {
|
|
|
55611
55631
|
this.update();
|
|
55612
55632
|
};
|
|
55613
55633
|
this._inputs.onBoxConfirm = (box) => this._onBoxConfirm.dispatch(box);
|
|
55634
|
+
viewer.renderer.onBoxUpdated.subscribe(() => {
|
|
55635
|
+
this.fitBox(viewer.renderer.getBoundingBox());
|
|
55636
|
+
});
|
|
55614
55637
|
this.clip = false;
|
|
55615
55638
|
this.visible = false;
|
|
55616
55639
|
this.interactive = false;
|
|
@@ -55711,6 +55734,7 @@ let SectionBox$1 = class SectionBox {
|
|
|
55711
55734
|
set visible(value) {
|
|
55712
55735
|
if (value === this._visible) return;
|
|
55713
55736
|
this._gizmos.visible = value;
|
|
55737
|
+
this._visible = value;
|
|
55714
55738
|
if (value) {
|
|
55715
55739
|
this.update();
|
|
55716
55740
|
}
|
|
@@ -55727,11 +55751,10 @@ let SectionBox$1 = class SectionBox {
|
|
|
55727
55751
|
* @param box - The bounding box to match (required).
|
|
55728
55752
|
* @param padding - The scalar amount by which to expand the bounding box. Default is `1`.
|
|
55729
55753
|
*/
|
|
55730
|
-
fitBox(box
|
|
55754
|
+
fitBox(box) {
|
|
55731
55755
|
if (!box) return;
|
|
55732
|
-
|
|
55733
|
-
this.
|
|
55734
|
-
this.renderer.section.fitBox(b);
|
|
55756
|
+
this._gizmos.fitBox(box);
|
|
55757
|
+
this.renderer.section.fitBox(box);
|
|
55735
55758
|
this._onBoxConfirm.dispatch(this.box);
|
|
55736
55759
|
this.renderer.needsUpdate = true;
|
|
55737
55760
|
}
|
|
@@ -55741,7 +55764,7 @@ let SectionBox$1 = class SectionBox {
|
|
|
55741
55764
|
* Call this if the renderer's section box is changed by code outside this class.
|
|
55742
55765
|
*/
|
|
55743
55766
|
update() {
|
|
55744
|
-
this.fitBox(this.section.box
|
|
55767
|
+
this.fitBox(this.section.box);
|
|
55745
55768
|
this.renderer.needsUpdate = true;
|
|
55746
55769
|
}
|
|
55747
55770
|
/**
|
|
@@ -55763,7 +55786,7 @@ class Gizmos {
|
|
|
55763
55786
|
/**
|
|
55764
55787
|
* The section box gizmo.
|
|
55765
55788
|
*/
|
|
55766
|
-
__publicField(this, "
|
|
55789
|
+
__publicField(this, "sectionBox");
|
|
55767
55790
|
/**
|
|
55768
55791
|
* The loading indicator gizmo.
|
|
55769
55792
|
*/
|
|
@@ -55787,7 +55810,7 @@ class Gizmos {
|
|
|
55787
55810
|
var _a2;
|
|
55788
55811
|
this.viewer = viewer;
|
|
55789
55812
|
this._measure = new Measure(viewer);
|
|
55790
|
-
this.
|
|
55813
|
+
this.sectionBox = new SectionBox$1(viewer);
|
|
55791
55814
|
this.loading = new GizmoLoading(viewer);
|
|
55792
55815
|
this.orbit = new GizmoOrbit(
|
|
55793
55816
|
viewer.renderer,
|
|
@@ -55816,7 +55839,7 @@ class Gizmos {
|
|
|
55816
55839
|
var _a2;
|
|
55817
55840
|
(_a2 = this.viewer.viewport.canvas.parentElement) == null ? void 0 : _a2.removeChild(this.axes.canvas);
|
|
55818
55841
|
this._measure.clear();
|
|
55819
|
-
this.
|
|
55842
|
+
this.sectionBox.dispose();
|
|
55820
55843
|
this.loading.dispose();
|
|
55821
55844
|
this.orbit.dispose();
|
|
55822
55845
|
this.rectangle.dispose();
|
|
@@ -55831,16 +55854,16 @@ class RenderingSection {
|
|
|
55831
55854
|
/**
|
|
55832
55855
|
* Current section box. To update the box use fitbox.
|
|
55833
55856
|
*/
|
|
55834
|
-
__publicField(this, "box", new Box3
|
|
55835
|
-
new Vector3
|
|
55836
|
-
new Vector3
|
|
55857
|
+
__publicField(this, "box", new Box3(
|
|
55858
|
+
new Vector3(-100, -100, -100),
|
|
55859
|
+
new Vector3(100, 100, 100)
|
|
55837
55860
|
));
|
|
55838
|
-
__publicField(this, "maxX", new Plane(new Vector3
|
|
55839
|
-
__publicField(this, "minX", new Plane(new Vector3
|
|
55840
|
-
__publicField(this, "maxY", new Plane(new Vector3
|
|
55841
|
-
__publicField(this, "minY", new Plane(new Vector3
|
|
55842
|
-
__publicField(this, "maxZ", new Plane(new Vector3
|
|
55843
|
-
__publicField(this, "minZ", new Plane(new Vector3
|
|
55861
|
+
__publicField(this, "maxX", new Plane(new Vector3(-1, 0, 0)));
|
|
55862
|
+
__publicField(this, "minX", new Plane(new Vector3(1, 0, 0)));
|
|
55863
|
+
__publicField(this, "maxY", new Plane(new Vector3(0, -1, 0)));
|
|
55864
|
+
__publicField(this, "minY", new Plane(new Vector3(0, 1, 0)));
|
|
55865
|
+
__publicField(this, "maxZ", new Plane(new Vector3(0, 0, -1)));
|
|
55866
|
+
__publicField(this, "minZ", new Plane(new Vector3(0, 0, 1)));
|
|
55844
55867
|
__publicField(this, "planes", [
|
|
55845
55868
|
this.maxX,
|
|
55846
55869
|
this.minX,
|
|
@@ -56057,7 +56080,7 @@ class EffectComposer {
|
|
|
56057
56080
|
this.renderer = renderer;
|
|
56058
56081
|
this._pixelRatio = renderer.getPixelRatio();
|
|
56059
56082
|
if (renderTarget === void 0) {
|
|
56060
|
-
const size = renderer.getSize(new Vector2
|
|
56083
|
+
const size = renderer.getSize(new Vector2());
|
|
56061
56084
|
this._width = size.width;
|
|
56062
56085
|
this._height = size.height;
|
|
56063
56086
|
renderTarget = new WebGLRenderTarget(this._width * this._pixelRatio, this._height * this._pixelRatio, { type: HalfFloatType });
|
|
@@ -56137,7 +56160,7 @@ class EffectComposer {
|
|
|
56137
56160
|
}
|
|
56138
56161
|
reset(renderTarget) {
|
|
56139
56162
|
if (renderTarget === void 0) {
|
|
56140
|
-
const size = this.renderer.getSize(new Vector2
|
|
56163
|
+
const size = this.renderer.getSize(new Vector2());
|
|
56141
56164
|
this._pixelRatio = this.renderer.getPixelRatio();
|
|
56142
56165
|
this._width = size.width;
|
|
56143
56166
|
this._height = size.height;
|
|
@@ -56225,7 +56248,7 @@ const FXAAShader = {
|
|
|
56225
56248
|
name: "FXAAShader",
|
|
56226
56249
|
uniforms: {
|
|
56227
56250
|
"tDiffuse": { value: null },
|
|
56228
|
-
"resolution": { value: new Vector2
|
|
56251
|
+
"resolution": { value: new Vector2(1 / 1024, 1 / 512) }
|
|
56229
56252
|
},
|
|
56230
56253
|
vertexShader: (
|
|
56231
56254
|
/* glsl */
|
|
@@ -56512,7 +56535,7 @@ class OutlinePass extends Pass {
|
|
|
56512
56535
|
this.needsSwap = true;
|
|
56513
56536
|
}
|
|
56514
56537
|
setSize(width, height) {
|
|
56515
|
-
this.material.resolution = new Vector2
|
|
56538
|
+
this.material.resolution = new Vector2(width, height);
|
|
56516
56539
|
}
|
|
56517
56540
|
get camera() {
|
|
56518
56541
|
return this.material.camera;
|
|
@@ -56752,7 +56775,7 @@ class RenderingComposer {
|
|
|
56752
56775
|
* @param height - New height in pixels
|
|
56753
56776
|
*/
|
|
56754
56777
|
setSize(width, height) {
|
|
56755
|
-
this._size = new Vector2
|
|
56778
|
+
this._size = new Vector2(width, height);
|
|
56756
56779
|
this._sceneTarget.setSize(width, height);
|
|
56757
56780
|
this._renderPass.setSize(width, height);
|
|
56758
56781
|
this._composer.setSize(width, height);
|
|
@@ -56945,7 +56968,7 @@ let Renderer$1 = class Renderer {
|
|
|
56945
56968
|
* @param target - Box in which to copy the result. A new instance is created if undefined.
|
|
56946
56969
|
* @returns The bounding box encompassing all rendered objects.
|
|
56947
56970
|
*/
|
|
56948
|
-
getBoundingBox(target = new Box3
|
|
56971
|
+
getBoundingBox(target = new Box3()) {
|
|
56949
56972
|
return this._scene.getBoundingBox(target);
|
|
56950
56973
|
}
|
|
56951
56974
|
/**
|
|
@@ -57308,7 +57331,7 @@ function strToVector3(str) {
|
|
|
57308
57331
|
const x = Number.parseFloat(split2[0]);
|
|
57309
57332
|
const y = Number.parseFloat(split2[1]);
|
|
57310
57333
|
const z = Number.parseFloat(split2[2]);
|
|
57311
|
-
return new Vector3
|
|
57334
|
+
return new Vector3(x, y, z);
|
|
57312
57335
|
} catch {
|
|
57313
57336
|
}
|
|
57314
57337
|
}
|
|
@@ -57320,7 +57343,7 @@ function strToVector2(str) {
|
|
|
57320
57343
|
try {
|
|
57321
57344
|
const x = Number.parseFloat(split2[0]);
|
|
57322
57345
|
const y = Number.parseFloat(split2[1]);
|
|
57323
|
-
return new Vector2
|
|
57346
|
+
return new Vector2(x, y);
|
|
57324
57347
|
} catch {
|
|
57325
57348
|
}
|
|
57326
57349
|
}
|
|
@@ -57353,8 +57376,8 @@ function removeUndefinedProperties(obj) {
|
|
|
57353
57376
|
return result;
|
|
57354
57377
|
}
|
|
57355
57378
|
function createBoxes(boxes) {
|
|
57356
|
-
const center = new Vector3
|
|
57357
|
-
const size = new Vector3
|
|
57379
|
+
const center = new Vector3();
|
|
57380
|
+
const size = new Vector3();
|
|
57358
57381
|
const quaternion = new Quaternion();
|
|
57359
57382
|
const matrices = boxes.map((b) => {
|
|
57360
57383
|
b.getCenter(center);
|
|
@@ -57430,134 +57453,11 @@ class InputHandler2 {
|
|
|
57430
57453
|
});
|
|
57431
57454
|
}
|
|
57432
57455
|
}
|
|
57433
|
-
|
|
57434
|
-
|
|
57435
|
-
__publicField(this, "x");
|
|
57436
|
-
__publicField(this, "y");
|
|
57437
|
-
__publicField(this, "z");
|
|
57438
|
-
this.x = x;
|
|
57439
|
-
this.y = y;
|
|
57440
|
-
this.z = z;
|
|
57441
|
-
}
|
|
57442
|
-
set(x, y, z) {
|
|
57443
|
-
this.x = x;
|
|
57444
|
-
this.y = y;
|
|
57445
|
-
this.z = z;
|
|
57446
|
-
return this;
|
|
57447
|
-
}
|
|
57448
|
-
copy(v) {
|
|
57449
|
-
this.x = v.x;
|
|
57450
|
-
this.y = v.y;
|
|
57451
|
-
this.z = v.z;
|
|
57452
|
-
return this;
|
|
57453
|
-
}
|
|
57454
|
-
add(v) {
|
|
57455
|
-
this.x += v.x;
|
|
57456
|
-
this.y += v.y;
|
|
57457
|
-
this.z += v.z;
|
|
57458
|
-
return this;
|
|
57459
|
-
}
|
|
57460
|
-
sub(v) {
|
|
57461
|
-
this.x -= v.x;
|
|
57462
|
-
this.y -= v.y;
|
|
57463
|
-
this.z -= v.z;
|
|
57464
|
-
return this;
|
|
57465
|
-
}
|
|
57466
|
-
multiplyScalar(scalar) {
|
|
57467
|
-
this.x *= scalar;
|
|
57468
|
-
this.y *= scalar;
|
|
57469
|
-
this.z *= scalar;
|
|
57470
|
-
return this;
|
|
57471
|
-
}
|
|
57472
|
-
min(v) {
|
|
57473
|
-
this.x = Math.min(this.x, v.x);
|
|
57474
|
-
this.y = Math.min(this.y, v.y);
|
|
57475
|
-
this.z = Math.min(this.z, v.z);
|
|
57476
|
-
return this;
|
|
57477
|
-
}
|
|
57478
|
-
max(v) {
|
|
57479
|
-
this.x = Math.max(this.x, v.x);
|
|
57480
|
-
this.y = Math.max(this.y, v.y);
|
|
57481
|
-
this.z = Math.max(this.z, v.z);
|
|
57482
|
-
return this;
|
|
57483
|
-
}
|
|
57484
|
-
isValid() {
|
|
57485
|
-
return Number.isFinite(this.x) && Number.isFinite(this.y) && Number.isFinite(this.z);
|
|
57486
|
-
}
|
|
57487
|
-
equals(v) {
|
|
57488
|
-
return this.x === v.x && this.y === v.y && this.z === v.z;
|
|
57489
|
-
}
|
|
57490
|
-
toArray() {
|
|
57491
|
-
return [this.x, this.y, this.z];
|
|
57492
|
-
}
|
|
57493
|
-
}
|
|
57494
|
-
class Vector22 {
|
|
57495
|
-
constructor(x = 0, y = 0) {
|
|
57496
|
-
__publicField(this, "x");
|
|
57497
|
-
__publicField(this, "y");
|
|
57498
|
-
this.x = x;
|
|
57499
|
-
this.y = y;
|
|
57500
|
-
}
|
|
57501
|
-
set(x, y) {
|
|
57502
|
-
this.x = x;
|
|
57503
|
-
this.y = y;
|
|
57504
|
-
return this;
|
|
57505
|
-
}
|
|
57506
|
-
copy(v) {
|
|
57507
|
-
this.x = v.x;
|
|
57508
|
-
this.y = v.y;
|
|
57509
|
-
return this;
|
|
57510
|
-
}
|
|
57511
|
-
add(v) {
|
|
57512
|
-
this.x += v.x;
|
|
57513
|
-
this.y += v.y;
|
|
57514
|
-
return this;
|
|
57515
|
-
}
|
|
57516
|
-
sub(v) {
|
|
57517
|
-
this.x -= v.x;
|
|
57518
|
-
this.y -= v.y;
|
|
57519
|
-
return this;
|
|
57520
|
-
}
|
|
57521
|
-
multiplyScalar(scalar) {
|
|
57522
|
-
this.x *= scalar;
|
|
57523
|
-
this.y *= scalar;
|
|
57524
|
-
return this;
|
|
57525
|
-
}
|
|
57526
|
-
min(v) {
|
|
57527
|
-
this.x = Math.min(this.x, v.x);
|
|
57528
|
-
this.y = Math.min(this.y, v.y);
|
|
57529
|
-
return this;
|
|
57530
|
-
}
|
|
57531
|
-
max(v) {
|
|
57532
|
-
this.x = Math.max(this.x, v.x);
|
|
57533
|
-
this.y = Math.max(this.y, v.y);
|
|
57534
|
-
return this;
|
|
57535
|
-
}
|
|
57536
|
-
equals(v) {
|
|
57537
|
-
return this.x === v.x && this.y === v.y;
|
|
57538
|
-
}
|
|
57539
|
-
isValid() {
|
|
57540
|
-
return Number.isFinite(this.x) && Number.isFinite(this.y);
|
|
57541
|
-
}
|
|
57542
|
-
almostEquals(v, tolerance = Number.EPSILON) {
|
|
57543
|
-
return Math.abs(this.x - v.x) < tolerance && Math.abs(this.y - v.y) < tolerance;
|
|
57544
|
-
}
|
|
57545
|
-
toArray() {
|
|
57546
|
-
return [this.x, this.y];
|
|
57547
|
-
}
|
|
57548
|
-
distanceTo(v) {
|
|
57549
|
-
const dx = this.x - v.x;
|
|
57550
|
-
const dy = this.y - v.y;
|
|
57551
|
-
return Math.sqrt(dx * dx + dy * dy);
|
|
57552
|
-
}
|
|
57553
|
-
clamp01() {
|
|
57554
|
-
this.x = clamp$1(this.x, 0, 1);
|
|
57555
|
-
this.y = clamp$1(this.y, 0, 1);
|
|
57556
|
-
return this;
|
|
57557
|
-
}
|
|
57456
|
+
function almostEqual(v1, v2, epsilon = 1e-6) {
|
|
57457
|
+
return Math.abs(v1.x - v2.x) < epsilon && Math.abs(v1.y - v2.y) < epsilon;
|
|
57558
57458
|
}
|
|
57559
57459
|
class Segment {
|
|
57560
|
-
constructor(origin = new
|
|
57460
|
+
constructor(origin = new Vector3(), target = new Vector3()) {
|
|
57561
57461
|
__publicField(this, "origin");
|
|
57562
57462
|
__publicField(this, "target");
|
|
57563
57463
|
this.origin = origin;
|
|
@@ -57565,8 +57465,8 @@ class Segment {
|
|
|
57565
57465
|
}
|
|
57566
57466
|
static fromArray(array) {
|
|
57567
57467
|
return new Segment(
|
|
57568
|
-
new
|
|
57569
|
-
new
|
|
57468
|
+
new Vector3(array[0], array[1], array[2]),
|
|
57469
|
+
new Vector3(array[3], array[4], array[5])
|
|
57570
57470
|
);
|
|
57571
57471
|
}
|
|
57572
57472
|
toArray() {
|
|
@@ -57579,62 +57479,6 @@ class Segment {
|
|
|
57579
57479
|
return this.origin.equals(segment.origin) && this.target.equals(segment.target);
|
|
57580
57480
|
}
|
|
57581
57481
|
}
|
|
57582
|
-
class Box32 {
|
|
57583
|
-
constructor(min2 = new Vector32(Infinity, Infinity, Infinity), max2 = new Vector32(-Infinity, -Infinity, -Infinity)) {
|
|
57584
|
-
__publicField(this, "min");
|
|
57585
|
-
__publicField(this, "max");
|
|
57586
|
-
this.min = min2;
|
|
57587
|
-
this.max = max2;
|
|
57588
|
-
}
|
|
57589
|
-
static fromArray(array) {
|
|
57590
|
-
return new Box32().set(
|
|
57591
|
-
new Vector32(array[0], array[1], array[2]),
|
|
57592
|
-
new Vector32(array[3], array[4], array[5])
|
|
57593
|
-
);
|
|
57594
|
-
}
|
|
57595
|
-
isValid() {
|
|
57596
|
-
return this.min.x <= this.max.x && this.min.y <= this.max.y && this.min.z <= this.max.z;
|
|
57597
|
-
}
|
|
57598
|
-
set(min2, max2) {
|
|
57599
|
-
this.min.copy(min2);
|
|
57600
|
-
this.max.copy(max2);
|
|
57601
|
-
return this;
|
|
57602
|
-
}
|
|
57603
|
-
setFromPoints(points) {
|
|
57604
|
-
this.min.set(Infinity, Infinity, Infinity);
|
|
57605
|
-
this.max.set(-Infinity, -Infinity, -Infinity);
|
|
57606
|
-
points.forEach((point) => {
|
|
57607
|
-
this.min.min(point);
|
|
57608
|
-
this.max.max(point);
|
|
57609
|
-
});
|
|
57610
|
-
return this;
|
|
57611
|
-
}
|
|
57612
|
-
getCenter(target = new Vector32()) {
|
|
57613
|
-
return target.copy(this.min).add(this.max).multiplyScalar(0.5);
|
|
57614
|
-
}
|
|
57615
|
-
getSize(target = new Vector32()) {
|
|
57616
|
-
return target.copy(this.max).sub(this.min);
|
|
57617
|
-
}
|
|
57618
|
-
containsPoint(point) {
|
|
57619
|
-
return point.x >= this.min.x && point.x <= this.max.x && point.y >= this.min.y && point.y <= this.max.y && point.z >= this.min.z && point.z <= this.max.z;
|
|
57620
|
-
}
|
|
57621
|
-
intersectsBox(box) {
|
|
57622
|
-
return !(box.max.x < this.min.x || box.min.x > this.max.x || box.max.y < this.min.y || box.min.y > this.max.y || box.max.z < this.min.z || box.min.z > this.max.z);
|
|
57623
|
-
}
|
|
57624
|
-
expandByPoint(point) {
|
|
57625
|
-
this.min.min(point);
|
|
57626
|
-
this.max.max(point);
|
|
57627
|
-
return this;
|
|
57628
|
-
}
|
|
57629
|
-
union(box) {
|
|
57630
|
-
this.min.min(box.min);
|
|
57631
|
-
this.max.max(box.max);
|
|
57632
|
-
return this;
|
|
57633
|
-
}
|
|
57634
|
-
toArray() {
|
|
57635
|
-
return [this.min.x, this.min.y, this.min.z, this.max.x, this.max.y, this.max.z];
|
|
57636
|
-
}
|
|
57637
|
-
}
|
|
57638
57482
|
class RGBA {
|
|
57639
57483
|
constructor(r, g, b, a = 1) {
|
|
57640
57484
|
__publicField(this, "r");
|
|
@@ -57772,7 +57616,7 @@ class InputMouse extends InputHandler2 {
|
|
|
57772
57616
|
super();
|
|
57773
57617
|
__publicField(this, "_rpc");
|
|
57774
57618
|
__publicField(this, "_canvas");
|
|
57775
|
-
__publicField(this, "_lastMouseDownPosition", new
|
|
57619
|
+
__publicField(this, "_lastMouseDownPosition", new Vector2(0, 0));
|
|
57776
57620
|
__publicField(this, "_selection");
|
|
57777
57621
|
__publicField(this, "_camera");
|
|
57778
57622
|
this._canvas = canvas;
|
|
@@ -57819,7 +57663,7 @@ class InputMouse extends InputHandler2 {
|
|
|
57819
57663
|
async handleMouseClick(event) {
|
|
57820
57664
|
if (event.pointerType !== "mouse") return;
|
|
57821
57665
|
const pos = this.relativePosition(event);
|
|
57822
|
-
if (!this._lastMouseDownPosition
|
|
57666
|
+
if (!almostEqual(this._lastMouseDownPosition, pos, 0.01)) {
|
|
57823
57667
|
return;
|
|
57824
57668
|
}
|
|
57825
57669
|
const hit = await this._selection.hitTest(pos);
|
|
@@ -57853,7 +57697,7 @@ class InputMouse extends InputHandler2 {
|
|
|
57853
57697
|
}
|
|
57854
57698
|
relativePosition(event) {
|
|
57855
57699
|
const rect = this._canvas.getBoundingClientRect();
|
|
57856
|
-
return new
|
|
57700
|
+
return new Vector2(
|
|
57857
57701
|
event.offsetX / rect.width,
|
|
57858
57702
|
event.offsetY / rect.height
|
|
57859
57703
|
);
|
|
@@ -57864,7 +57708,7 @@ class InputTouch extends InputHandler2 {
|
|
|
57864
57708
|
super();
|
|
57865
57709
|
__publicField(this, "_rpc");
|
|
57866
57710
|
__publicField(this, "_canvas");
|
|
57867
|
-
__publicField(this, "_lastTouchStartPosition", new
|
|
57711
|
+
__publicField(this, "_lastTouchStartPosition", new Vector2(0, 0));
|
|
57868
57712
|
// Add these properties to your InputTouch class
|
|
57869
57713
|
__publicField(this, "_initialTouchDistance");
|
|
57870
57714
|
this._canvas = canvas;
|
|
@@ -57928,7 +57772,7 @@ class InputTouch extends InputHandler2 {
|
|
|
57928
57772
|
if (this.handlePinch(pos1, pos2)) {
|
|
57929
57773
|
return;
|
|
57930
57774
|
}
|
|
57931
|
-
const avg = new
|
|
57775
|
+
const avg = new Vector2(
|
|
57932
57776
|
(pos1.x + pos2.x) / 2,
|
|
57933
57777
|
(pos1.y + pos2.y) / 2
|
|
57934
57778
|
);
|
|
@@ -57967,7 +57811,7 @@ class InputTouch extends InputHandler2 {
|
|
|
57967
57811
|
handleDoubleTouchEnd(touch1, touch2) {
|
|
57968
57812
|
const pos1 = this.relativeTouchPosition(touch1);
|
|
57969
57813
|
const pos2 = this.relativeTouchPosition(touch2);
|
|
57970
|
-
const avg = new
|
|
57814
|
+
const avg = new Vector2(
|
|
57971
57815
|
(pos1.x + pos2.x) / 2,
|
|
57972
57816
|
(pos1.y + pos2.y) / 2
|
|
57973
57817
|
);
|
|
@@ -57987,7 +57831,7 @@ class InputTouch extends InputHandler2 {
|
|
|
57987
57831
|
}
|
|
57988
57832
|
relativeTouchPosition(touch) {
|
|
57989
57833
|
const rect = this._canvas.getBoundingClientRect();
|
|
57990
|
-
return new
|
|
57834
|
+
return new Vector2(
|
|
57991
57835
|
(touch.clientX - rect.left) / rect.width,
|
|
57992
57836
|
(touch.clientY - rect.top) / rect.height
|
|
57993
57837
|
);
|
|
@@ -58155,7 +57999,6 @@ class Marshal {
|
|
|
58155
57999
|
}
|
|
58156
58000
|
// -------------------- SectionBox -------------------
|
|
58157
58001
|
writeSectionBoxState(data2) {
|
|
58158
|
-
this.writeBoolean(data2.enabled);
|
|
58159
58002
|
this.writeBoolean(data2.visible);
|
|
58160
58003
|
this.writeBoolean(data2.interactible);
|
|
58161
58004
|
this.writeBoolean(data2.clip);
|
|
@@ -58263,13 +58106,13 @@ class ReadMarshal {
|
|
|
58263
58106
|
readVector2() {
|
|
58264
58107
|
const x = this.readFloat();
|
|
58265
58108
|
const y = this.readFloat();
|
|
58266
|
-
return new
|
|
58109
|
+
return new Vector2(x, y);
|
|
58267
58110
|
}
|
|
58268
58111
|
readVector3() {
|
|
58269
58112
|
const x = this.readFloat();
|
|
58270
58113
|
const y = this.readFloat();
|
|
58271
58114
|
const z = this.readFloat();
|
|
58272
|
-
return new
|
|
58115
|
+
return new Vector3(x, y, z);
|
|
58273
58116
|
}
|
|
58274
58117
|
readVector4() {
|
|
58275
58118
|
const x = this.readFloat();
|
|
@@ -58303,7 +58146,7 @@ class ReadMarshal {
|
|
|
58303
58146
|
readBox3() {
|
|
58304
58147
|
const min2 = this.readVector3();
|
|
58305
58148
|
const max2 = this.readVector3();
|
|
58306
|
-
return new
|
|
58149
|
+
return new Box3(min2, max2);
|
|
58307
58150
|
}
|
|
58308
58151
|
readSegment() {
|
|
58309
58152
|
const position = this.readVector3();
|
|
@@ -58311,13 +58154,11 @@ class ReadMarshal {
|
|
|
58311
58154
|
return new Segment(position, target);
|
|
58312
58155
|
}
|
|
58313
58156
|
readSectionBoxState() {
|
|
58314
|
-
const enabled = this.readBoolean();
|
|
58315
58157
|
const visible2 = this.readBoolean();
|
|
58316
58158
|
const interactible = this.readBoolean();
|
|
58317
58159
|
const clip = this.readBoolean();
|
|
58318
58160
|
const box = this.readBox3();
|
|
58319
58161
|
return {
|
|
58320
|
-
enabled,
|
|
58321
58162
|
visible: visible2,
|
|
58322
58163
|
interactible,
|
|
58323
58164
|
clip,
|
|
@@ -58436,6 +58277,12 @@ class RpcClient {
|
|
|
58436
58277
|
marshal.writeUInt(componentHandle);
|
|
58437
58278
|
this._socket.sendRPC(marshal);
|
|
58438
58279
|
}
|
|
58280
|
+
RPCEnableSectionBox(value) {
|
|
58281
|
+
const marshal = new Marshal();
|
|
58282
|
+
marshal.writeString("RPCEnableSectionBox");
|
|
58283
|
+
marshal.writeBoolean(value);
|
|
58284
|
+
this._socket.sendRPC(marshal);
|
|
58285
|
+
}
|
|
58439
58286
|
async RPCFrameAll(blendTime) {
|
|
58440
58287
|
const marshal = new Marshal();
|
|
58441
58288
|
marshal.writeString("RPCFrameAll");
|
|
@@ -58869,17 +58716,14 @@ class Validation {
|
|
|
58869
58716
|
// VECTOR AND GEOMETRY VALIDATIONS
|
|
58870
58717
|
//= ===========================================================================
|
|
58871
58718
|
static isValidVector2(value) {
|
|
58872
|
-
if (!value.
|
|
58719
|
+
if (!Number.isFinite(value.x) || !Number.isFinite(value.y)) {
|
|
58873
58720
|
console.warn("Invalid value: must be a valid Vector2. Aborting operation.");
|
|
58874
58721
|
return false;
|
|
58875
58722
|
}
|
|
58876
58723
|
return true;
|
|
58877
58724
|
}
|
|
58878
58725
|
static isRelativeVector2(value) {
|
|
58879
|
-
if (!
|
|
58880
|
-
console.warn("Invalid value: must be a valid Vector2. Aborting operation.");
|
|
58881
|
-
return false;
|
|
58882
|
-
}
|
|
58726
|
+
if (!this.isValidVector2(value)) return false;
|
|
58883
58727
|
if (value.x < 0 || value.x > 1 || value.y < 0 || value.y > 1) {
|
|
58884
58728
|
console.warn("Invalid value: must be a relative Vector2 (0-1, 0-1). Aborting operation.");
|
|
58885
58729
|
return false;
|
|
@@ -58887,14 +58731,14 @@ class Validation {
|
|
|
58887
58731
|
return true;
|
|
58888
58732
|
}
|
|
58889
58733
|
static isValidVector3(value) {
|
|
58890
|
-
if (!value.
|
|
58734
|
+
if (!Number.isFinite(value.x) || !Number.isFinite(value.y) || !Number.isFinite(value.z)) {
|
|
58891
58735
|
console.warn("Invalid Vector3. Aborting operation.");
|
|
58892
58736
|
return false;
|
|
58893
58737
|
}
|
|
58894
58738
|
return true;
|
|
58895
58739
|
}
|
|
58896
58740
|
static isValidBox(box) {
|
|
58897
|
-
if (
|
|
58741
|
+
if (box.isEmpty()) {
|
|
58898
58742
|
console.warn("Box is invalid. Min values must be less than max values");
|
|
58899
58743
|
return false;
|
|
58900
58744
|
}
|
|
@@ -59142,6 +58986,12 @@ class RpcSafeClient {
|
|
|
59142
58986
|
RPCLockIblRotation(lock) {
|
|
59143
58987
|
this.rpc.RPCLockIblRotation(lock);
|
|
59144
58988
|
}
|
|
58989
|
+
RPCGetSceneAABB() {
|
|
58990
|
+
return this.safeCall(
|
|
58991
|
+
() => this.rpc.RPCGetSceneAABB(),
|
|
58992
|
+
void 0
|
|
58993
|
+
);
|
|
58994
|
+
}
|
|
59145
58995
|
/*******************************************************************************
|
|
59146
58996
|
* NODE VISIBILITY METHODS
|
|
59147
58997
|
* Methods for controlling node visibility, including show/hide, ghosting,
|
|
@@ -59276,6 +59126,9 @@ class RpcSafeClient {
|
|
|
59276
59126
|
* SECTION BOX METHODS
|
|
59277
59127
|
* Methods for controlling section box visibility and position.
|
|
59278
59128
|
******************************************************************************/
|
|
59129
|
+
RPCEnableSectionBox(enable) {
|
|
59130
|
+
this.rpc.RPCEnableSectionBox(enable);
|
|
59131
|
+
}
|
|
59279
59132
|
RPCSetSectionBox(state) {
|
|
59280
59133
|
this.rpc.RPCSetSectionBox(state);
|
|
59281
59134
|
}
|
|
@@ -59334,14 +59187,14 @@ class RpcSafeClient {
|
|
|
59334
59187
|
}
|
|
59335
59188
|
async getBoundingBoxBatched(componentHandle, nodes) {
|
|
59336
59189
|
if (nodes.length === 0) {
|
|
59337
|
-
return new
|
|
59190
|
+
return new Box3();
|
|
59338
59191
|
}
|
|
59339
59192
|
const batches = batchArray(nodes, this.batchSize);
|
|
59340
59193
|
const promises = batches.map(async (batch) => {
|
|
59341
59194
|
const aabb = await this.rpc.RPCGetBoundingBox(componentHandle, batch);
|
|
59342
|
-
const v1 = new
|
|
59343
|
-
const v2 = new
|
|
59344
|
-
return new
|
|
59195
|
+
const v1 = new Vector3(aabb.min.x, aabb.min.y, aabb.min.z);
|
|
59196
|
+
const v2 = new Vector3(aabb.max.x, aabb.max.y, aabb.max.z);
|
|
59197
|
+
return new Box3(v1, v2);
|
|
59345
59198
|
});
|
|
59346
59199
|
const boxes = await Promise.all(promises);
|
|
59347
59200
|
const box = boxes[0];
|
|
@@ -61426,10 +61279,14 @@ class ViewerSelection {
|
|
|
61426
61279
|
__publicField(this, "_rpc");
|
|
61427
61280
|
__publicField(this, "_vims");
|
|
61428
61281
|
__publicField(this, "_selectedNodes");
|
|
61282
|
+
__publicField(this, "_onValueChanged", new distExports$1.SignalDispatcher());
|
|
61429
61283
|
this._rpc = rpc;
|
|
61430
61284
|
this._vims = vims;
|
|
61431
61285
|
this._selectedNodes = /* @__PURE__ */ new Map();
|
|
61432
61286
|
}
|
|
61287
|
+
get onValueChanged() {
|
|
61288
|
+
return this._onValueChanged.asEvent();
|
|
61289
|
+
}
|
|
61433
61290
|
/**
|
|
61434
61291
|
* Gets the total number of selected nodes across all VIMs.
|
|
61435
61292
|
* @returns The total count of selected nodes.
|
|
@@ -61498,12 +61355,17 @@ class ViewerSelection {
|
|
|
61498
61355
|
nodeSet = /* @__PURE__ */ new Set();
|
|
61499
61356
|
this._selectedNodes.set(vim, nodeSet);
|
|
61500
61357
|
}
|
|
61358
|
+
let changed = false;
|
|
61501
61359
|
nodes.forEach((n) => {
|
|
61502
61360
|
if (!nodeSet.has(n)) {
|
|
61503
61361
|
nodeSet.add(n);
|
|
61504
61362
|
vim.highlight([n]);
|
|
61363
|
+
changed = true;
|
|
61505
61364
|
}
|
|
61506
61365
|
});
|
|
61366
|
+
if (changed) {
|
|
61367
|
+
this._onValueChanged.dispatch();
|
|
61368
|
+
}
|
|
61507
61369
|
}
|
|
61508
61370
|
/**
|
|
61509
61371
|
* Removes the specified node(s) from the current selection.
|
|
@@ -61515,27 +61377,37 @@ class ViewerSelection {
|
|
|
61515
61377
|
const nodeSet = this._selectedNodes.get(vim);
|
|
61516
61378
|
if (!nodeSet) return;
|
|
61517
61379
|
const nodes = Array.isArray(node) ? node : [node];
|
|
61380
|
+
let changed = false;
|
|
61518
61381
|
nodes.forEach((n) => {
|
|
61519
61382
|
if (nodeSet.has(n)) {
|
|
61520
61383
|
nodeSet.delete(n);
|
|
61521
61384
|
vim.removeHighlight([n], "visible");
|
|
61385
|
+
changed = true;
|
|
61522
61386
|
}
|
|
61523
61387
|
});
|
|
61524
61388
|
if (nodeSet.size === 0) {
|
|
61525
61389
|
this._selectedNodes.delete(vim);
|
|
61526
61390
|
}
|
|
61391
|
+
if (changed) {
|
|
61392
|
+
this._onValueChanged.dispatch();
|
|
61393
|
+
}
|
|
61527
61394
|
}
|
|
61528
61395
|
/**
|
|
61529
61396
|
* Clears all selections across all VIMs or for a specific VIM.
|
|
61530
61397
|
* @param vim - Optional. If provided, only clears selections for the specified VIM.
|
|
61531
61398
|
*/
|
|
61532
61399
|
clear(vim) {
|
|
61400
|
+
let changed = false;
|
|
61533
61401
|
this._selectedNodes.forEach((nodes, v) => {
|
|
61534
61402
|
if (vim === void 0 || v === vim) {
|
|
61535
61403
|
v.removeHighlight(Array.from(nodes), "visible");
|
|
61404
|
+
changed = true;
|
|
61536
61405
|
}
|
|
61537
61406
|
});
|
|
61538
61407
|
this._selectedNodes.clear();
|
|
61408
|
+
if (changed) {
|
|
61409
|
+
this._onValueChanged.dispatch();
|
|
61410
|
+
}
|
|
61539
61411
|
}
|
|
61540
61412
|
/**
|
|
61541
61413
|
* Calculates the bounding box encompassing all selected nodes.
|
|
@@ -61564,8 +61436,12 @@ class ViewerSelection {
|
|
|
61564
61436
|
class VimCollection {
|
|
61565
61437
|
constructor() {
|
|
61566
61438
|
__publicField(this, "_vims");
|
|
61439
|
+
__publicField(this, "_onChanged", new distExports$1.SignalDispatcher());
|
|
61567
61440
|
this._vims = [];
|
|
61568
61441
|
}
|
|
61442
|
+
get onChanged() {
|
|
61443
|
+
return this._onChanged.asEvent();
|
|
61444
|
+
}
|
|
61569
61445
|
get count() {
|
|
61570
61446
|
return this._vims.length;
|
|
61571
61447
|
}
|
|
@@ -61576,6 +61452,7 @@ class VimCollection {
|
|
|
61576
61452
|
add(vim) {
|
|
61577
61453
|
if (!this._vims.some((v) => v.handle === vim.handle)) {
|
|
61578
61454
|
this._vims.push(vim);
|
|
61455
|
+
this._onChanged.dispatch();
|
|
61579
61456
|
}
|
|
61580
61457
|
}
|
|
61581
61458
|
/**
|
|
@@ -61583,7 +61460,11 @@ class VimCollection {
|
|
|
61583
61460
|
* @param vim - The Vim instance to remove.
|
|
61584
61461
|
*/
|
|
61585
61462
|
remove(vim) {
|
|
61463
|
+
const count = this._vims.length;
|
|
61586
61464
|
this._vims = this._vims.filter((v) => v.handle !== vim.handle);
|
|
61465
|
+
if (this._vims.length !== count) {
|
|
61466
|
+
this._onChanged.dispatch();
|
|
61467
|
+
}
|
|
61587
61468
|
}
|
|
61588
61469
|
/**
|
|
61589
61470
|
* Gets a Vim instance by its handle.
|
|
@@ -61810,6 +61691,9 @@ class Renderer2 {
|
|
|
61810
61691
|
this._updateLighting = true;
|
|
61811
61692
|
this.requestSettingsUpdate();
|
|
61812
61693
|
}
|
|
61694
|
+
getBoundingBox() {
|
|
61695
|
+
return this._rpc.RPCGetSceneAABB();
|
|
61696
|
+
}
|
|
61813
61697
|
/**
|
|
61814
61698
|
* Requests an update to be performed on the next animation frame.
|
|
61815
61699
|
* Multiple setting changes will be batched into a single update.
|
|
@@ -61843,11 +61727,10 @@ class Renderer2 {
|
|
|
61843
61727
|
}
|
|
61844
61728
|
class SectionBox2 {
|
|
61845
61729
|
constructor(rpc) {
|
|
61846
|
-
__publicField(this, "_enabled", false);
|
|
61847
61730
|
__publicField(this, "_visible", true);
|
|
61848
61731
|
__publicField(this, "_interactible", true);
|
|
61849
61732
|
__publicField(this, "_clip", true);
|
|
61850
|
-
__publicField(this, "_box", new
|
|
61733
|
+
__publicField(this, "_box", new Box3());
|
|
61851
61734
|
__publicField(this, "_rpc");
|
|
61852
61735
|
__publicField(this, "_interval");
|
|
61853
61736
|
__publicField(this, "_animationFrame");
|
|
@@ -61862,6 +61745,7 @@ class SectionBox2 {
|
|
|
61862
61745
|
return this._animationFrame > 0;
|
|
61863
61746
|
}
|
|
61864
61747
|
async onConnect() {
|
|
61748
|
+
this._rpc.RPCEnableSectionBox(true);
|
|
61865
61749
|
this.push();
|
|
61866
61750
|
this._interval = setInterval(() => this.pull(), 1e3);
|
|
61867
61751
|
}
|
|
@@ -61876,10 +61760,9 @@ class SectionBox2 {
|
|
|
61876
61760
|
if (this.needUpdate) return;
|
|
61877
61761
|
const state = await this._rpc.RPCGetSectionBox();
|
|
61878
61762
|
let changed = false;
|
|
61879
|
-
if (state.
|
|
61763
|
+
if (state.visible !== this._visible || state.interactible !== this._interactible || state.clip !== this._clip || state.box !== this._box) {
|
|
61880
61764
|
changed = true;
|
|
61881
61765
|
}
|
|
61882
|
-
this._enabled = state.enabled;
|
|
61883
61766
|
this._visible = state.visible;
|
|
61884
61767
|
this._interactible = state.interactible;
|
|
61885
61768
|
this._clip = state.clip;
|
|
@@ -61890,20 +61773,12 @@ class SectionBox2 {
|
|
|
61890
61773
|
}
|
|
61891
61774
|
async push() {
|
|
61892
61775
|
await this._rpc.RPCSetSectionBox({
|
|
61893
|
-
enabled: this._enabled,
|
|
61894
61776
|
visible: this._visible,
|
|
61895
61777
|
interactible: this._interactible,
|
|
61896
61778
|
clip: this._clip,
|
|
61897
61779
|
box: this._box
|
|
61898
61780
|
});
|
|
61899
61781
|
}
|
|
61900
|
-
get enabled() {
|
|
61901
|
-
return this._enabled;
|
|
61902
|
-
}
|
|
61903
|
-
set enabled(value) {
|
|
61904
|
-
this._enabled = value;
|
|
61905
|
-
this.scheduleUpdate();
|
|
61906
|
-
}
|
|
61907
61782
|
get visible() {
|
|
61908
61783
|
return this._visible;
|
|
61909
61784
|
}
|
|
@@ -61911,10 +61786,10 @@ class SectionBox2 {
|
|
|
61911
61786
|
this._visible = value;
|
|
61912
61787
|
this.scheduleUpdate();
|
|
61913
61788
|
}
|
|
61914
|
-
get
|
|
61789
|
+
get interactive() {
|
|
61915
61790
|
return this._interactible;
|
|
61916
61791
|
}
|
|
61917
|
-
set
|
|
61792
|
+
set interactive(value) {
|
|
61918
61793
|
this._interactible = value;
|
|
61919
61794
|
this.scheduleUpdate();
|
|
61920
61795
|
}
|
|
@@ -62024,6 +61899,9 @@ class Viewer2 {
|
|
|
62024
61899
|
get decoder() {
|
|
62025
61900
|
return this._decoder;
|
|
62026
61901
|
}
|
|
61902
|
+
get selection() {
|
|
61903
|
+
return this._selection;
|
|
61904
|
+
}
|
|
62027
61905
|
/**
|
|
62028
61906
|
* Gets the current URL to which the viewer is connected.
|
|
62029
61907
|
* @returns The URL as a string, or undefined if not connected.
|
|
@@ -62179,7 +62057,7 @@ class Viewer2 {
|
|
|
62179
62057
|
}
|
|
62180
62058
|
const index$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
62181
62059
|
__proto__: null,
|
|
62182
|
-
Box3
|
|
62060
|
+
Box3,
|
|
62183
62061
|
ColorHandle,
|
|
62184
62062
|
INVALID_HANDLE,
|
|
62185
62063
|
Matrix44: Matrix4,
|
|
@@ -62187,10 +62065,11 @@ const index$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePrope
|
|
|
62187
62065
|
RGBA,
|
|
62188
62066
|
RGBA32,
|
|
62189
62067
|
Segment,
|
|
62190
|
-
Vector2
|
|
62191
|
-
Vector3
|
|
62068
|
+
Vector2,
|
|
62069
|
+
Vector3,
|
|
62192
62070
|
Viewer: Viewer2,
|
|
62193
62071
|
Vim: Vim2,
|
|
62072
|
+
almostEqual,
|
|
62194
62073
|
clamp: clamp$1,
|
|
62195
62074
|
remap,
|
|
62196
62075
|
utils: promise
|
|
@@ -66653,6 +66532,31 @@ var ReactTooltip = staticMethods(_class = windowListener(_class = customEvent(_c
|
|
|
66653
66532
|
wrapper: "div",
|
|
66654
66533
|
clickable: false
|
|
66655
66534
|
}), _defineProperty(_class2, "supportedWrappers", ["div", "span"]), _defineProperty(_class2, "displayName", "ReactTooltip"), _class2)) || _class) || _class) || _class) || _class) || _class) || _class) || _class;
|
|
66535
|
+
function slidersHoriz({ height, width, fill: fill2, className }) {
|
|
66536
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { className, height, width, viewBox: "0 0 256 256", children: [
|
|
66537
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
66538
|
+
"path",
|
|
66539
|
+
{
|
|
66540
|
+
fill: fill2,
|
|
66541
|
+
d: "M24,74h111.163c6.293,15.258,21.308,26,38.837,26s32.543-10.742,38.837-26h19.163c8.836,0,16-7.164,16-16s-7.164-16-16-16h-19.163c-6.293-15.258-21.308-26-38.837-26s-32.543,10.742-38.837,26H24c-8.836,0-16,7.164-16,16s7.164,16,16,16Zm132.083-17.637c.014-.151,.031-.301,.048-.451,.05-.435,.116-.864,.197-1.289,.021-.11,.037-.222,.06-.331,.106-.503,.236-.998,.383-1.484,.046-.153,.1-.303,.15-.455,.116-.35,.242-.694,.379-1.033,.067-.167,.132-.336,.204-.5,.189-.433,.393-.859,.615-1.273,.092-.173,.196-.339,.294-.508,.15-.26,.305-.517,.467-.768,.133-.205,.268-.409,.409-.608,.147-.208,.302-.41,.458-.611,.28-.362,.572-.713,.878-1.053,.13-.146,.259-.293,.395-.435,.212-.221,.432-.435,.656-.645,.116-.109,.234-.215,.354-.321,.787-.703,1.634-1.338,2.535-1.896,.1-.062,.199-.123,.3-.182,.304-.181,.612-.356,.928-.519,2.464-1.27,5.25-2,8.208-2s5.744,.73,8.208,2c.315,.163,.624,.338,.928,.519,.101,.06,.201,.121,.3,.182,.901,.558,1.749,1.193,2.535,1.896,.119,.106,.238,.212,.354,.321,.224,.21,.443,.424,.656,.645,.135,.142,.264,.289,.395,.435,.306,.34,.599,.691,.878,1.053,.155,.202,.311,.403,.458,.611,.141,.199,.276,.403,.409,.608,.163,.251,.317,.508,.467,.768,.098,.169,.202,.335,.294,.508,.222,.415,.425,.84,.615,1.273,.072,.165,.137,.333,.204,.5,.137,.339,.263,.684,.379,1.033,.05,.151,.104,.301,.15,.455,.147,.487,.277,.981,.383,1.484,.023,.109,.039,.221,.06,.331,.081,.425,.147,.854,.197,1.289,.018,.15,.035,.3,.048,.451,.049,.54,.083,1.084,.083,1.637s-.034,1.097-.083,1.637c-.014,.151-.031,.301-.048,.451-.05,.435-.116,.864-.197,1.289-.021,.11-.037,.222-.06,.331-.106,.503-.236,.998-.383,1.484-.046,.153-.1,.303-.15,.455-.116,.35-.242,.694-.379,1.033-.067,.167-.132,.336-.204,.5-.189,.433-.393,.859-.615,1.273-.092,.173-.196,.339-.294,.508-.15,.26-.305,.517-.467,.768-.133,.205-.268,.409-.409,.608-.147,.208-.302,.41-.458,.611-.28,.362-.572,.713-.878,1.053-.13,.146-.259,.293-.395,.435-.212,.221-.432,.435-.656,.645-.116,.109-.234,.215-.354,.321-.787,.703-1.634,1.338-2.535,1.896-.1,.062-.199,.123-.3,.182-.304,.181-.612,.356-.928,.519-2.464,1.27-5.25,2-8.208,2s-5.744-.73-8.208-2c-.315-.163-.624-.338-.928-.519-.101-.06-.201-.121-.3-.182-.901-.558-1.749-1.193-2.535-1.896-.119-.106-.238-.212-.354-.321-.224-.21-.443-.424-.656-.645-.135-.142-.264-.289-.395-.435-.306-.34-.599-.691-.878-1.053-.155-.202-.311-.403-.458-.611-.141-.199-.276-.403-.409-.608-.163-.251-.317-.508-.467-.768-.098-.169-.202-.335-.294-.508-.222-.415-.425-.84-.615-1.273-.072-.165-.137-.333-.204-.5-.137-.339-.263-.684-.379-1.033-.05-.151-.104-.301-.15-.455-.147-.487-.277-.981-.383-1.484-.023-.109-.039-.221-.06-.331-.081-.425-.147-.854-.197-1.289-.018-.15-.035-.3-.048-.451-.049-.54-.083-1.084-.083-1.637s.034-1.097,.083-1.637Z"
|
|
66542
|
+
}
|
|
66543
|
+
),
|
|
66544
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
66545
|
+
"path",
|
|
66546
|
+
{
|
|
66547
|
+
fill: fill2,
|
|
66548
|
+
d: "M232,112H120.837c-6.293-15.258-21.308-26-38.837-26s-32.543,10.742-38.837,26H24c-8.836,0-16,7.164-16,16s7.164,16,16,16h19.163c6.293,15.258,21.308,26,38.837,26s32.543-10.742,38.837-26h111.163c8.836,0,16-7.164,16-16s-7.164-16-16-16Zm-132.083,17.637c-.014,.151-.031,.301-.048,.451-.05,.435-.116,.864-.197,1.289-.021,.11-.037,.222-.06,.331-.106,.503-.236,.998-.383,1.484-.046,.153-.1,.303-.15,.455-.116,.35-.242,.694-.379,1.033-.067,.167-.132,.336-.204,.5-.189,.433-.393,.859-.615,1.273-.092,.173-.196,.339-.294,.508-.15,.26-.305,.517-.467,.768-.133,.205-.268,.409-.409,.608-.147,.208-.302,.41-.458,.611-.28,.362-.572,.713-.878,1.053-.13,.146-.259,.293-.395,.435-.212,.221-.432,.435-.656,.645-.116,.109-.234,.215-.354,.321-.787,.703-1.634,1.338-2.535,1.896-.1,.062-.199,.123-.3,.182-.304,.181-.612,.356-.928,.519-2.464,1.27-5.25,2-8.208,2s-5.744-.73-8.208-2c-.315-.163-.624-.338-.928-.519-.101-.06-.201-.121-.3-.182-.901-.558-1.749-1.193-2.535-1.896-.119-.106-.238-.212-.354-.321-.224-.21-.443-.424-.656-.645-.135-.142-.264-.289-.395-.435-.306-.34-.599-.691-.878-1.053-.155-.202-.311-.403-.458-.611-.141-.199-.276-.403-.409-.608-.163-.251-.317-.508-.467-.768-.098-.169-.202-.335-.294-.508-.222-.415-.425-.84-.615-1.273-.072-.165-.137-.333-.204-.5-.137-.339-.263-.684-.379-1.033-.05-.151-.104-.301-.15-.455-.147-.487-.277-.981-.383-1.484-.023-.109-.039-.221-.06-.331-.081-.425-.147-.854-.197-1.289-.018-.15-.035-.3-.048-.451-.049-.54-.083-1.084-.083-1.637s.034-1.097,.083-1.637c.014-.151,.031-.301,.048-.451,.05-.435,.116-.864,.197-1.289,.021-.11,.037-.222,.06-.331,.106-.503,.236-.998,.383-1.484,.046-.153,.1-.303,.15-.455,.116-.35,.242-.694,.379-1.033,.067-.167,.132-.336,.204-.5,.189-.433,.393-.859,.615-1.273,.092-.173,.196-.339,.294-.508,.15-.26,.305-.517,.467-.768,.133-.205,.268-.409,.409-.608,.147-.208,.302-.41,.458-.611,.28-.362,.572-.713,.878-1.053,.13-.146,.259-.293,.395-.435,.212-.221,.432-.435,.656-.645,.116-.109,.234-.215,.354-.321,.787-.703,1.634-1.338,2.535-1.896,.1-.062,.199-.123,.3-.182,.304-.181,.612-.356,.928-.519,2.464-1.27,5.25-2,8.208-2s5.744,.73,8.208,2c.315,.163,.624,.338,.928,.519,.101,.06,.201,.121,.3,.182,.901,.558,1.749,1.193,2.535,1.896,.119,.106,.238,.212,.354,.321,.224,.21,.443,.424,.656,.645,.135,.142,.264,.289,.395,.435,.306,.34,.599,.691,.878,1.053,.155,.202,.311,.403,.458,.611,.141,.199,.276,.403,.409,.608,.163,.251,.317,.508,.467,.768,.098,.169,.202,.335,.294,.508,.222,.415,.425,.84,.615,1.273,.072,.165,.137,.333,.204,.5,.137,.339,.263,.684,.379,1.033,.05,.151,.104,.301,.15,.455,.147,.487,.277,.981,.383,1.484,.023,.109,.039,.221,.06,.331,.081,.425,.147,.854,.197,1.289,.018,.15,.035,.3,.048,.451,.049,.54,.083,1.084,.083,1.637s-.034,1.097-.083,1.637Z"
|
|
66549
|
+
}
|
|
66550
|
+
),
|
|
66551
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
66552
|
+
"path",
|
|
66553
|
+
{
|
|
66554
|
+
fill: fill2,
|
|
66555
|
+
d: "M232,182h-19.163c-6.293-15.258-21.308-26-38.837-26s-32.543,10.742-38.837,26H24c-8.836,0-16,7.164-16,16s7.164,16,16,16h111.163c6.293,15.258,21.308,26,38.837,26s32.543-10.742,38.837-26h19.163c8.836,0,16-7.164,16-16s-7.164-16-16-16Zm-40.083,17.637c-.014,.151-.031,.301-.048,.451-.05,.435-.116,.864-.197,1.289-.021,.11-.037,.222-.06,.331-.106,.503-.236,.998-.383,1.484-.046,.153-.1,.303-.15,.455-.116,.35-.242,.694-.379,1.033-.067,.167-.132,.336-.204,.5-.189,.433-.393,.859-.615,1.273-.092,.173-.196,.339-.294,.508-.15,.26-.305,.517-.467,.768-.133,.205-.268,.409-.409,.608-.147,.208-.302,.41-.458,.611-.28,.362-.572,.713-.878,1.053-.13,.146-.259,.293-.395,.435-.212,.221-.432,.435-.656,.645-.116,.109-.234,.215-.354,.321-.787,.703-1.634,1.338-2.535,1.896-.1,.062-.199,.123-.3,.182-.304,.181-.612,.356-.928,.519-2.464,1.27-5.25,2-8.208,2s-5.744-.73-8.208-2c-.315-.163-.624-.338-.928-.519-.101-.06-.201-.121-.3-.182-.901-.558-1.749-1.193-2.535-1.896-.119-.106-.238-.212-.354-.321-.224-.21-.443-.424-.656-.645-.135-.142-.264-.289-.395-.435-.306-.34-.599-.691-.878-1.053-.155-.202-.311-.403-.458-.611-.141-.199-.276-.403-.409-.608-.163-.251-.317-.508-.467-.768-.098-.169-.202-.335-.294-.508-.222-.415-.425-.84-.615-1.273-.072-.165-.137-.333-.204-.5-.137-.339-.263-.684-.379-1.033-.05-.151-.104-.301-.15-.455-.147-.487-.277-.981-.383-1.484-.023-.109-.039-.221-.06-.331-.081-.425-.147-.854-.197-1.289-.018-.15-.035-.3-.048-.451-.049-.54-.083-1.084-.083-1.637s.034-1.097,.083-1.637c.014-.151,.031-.301,.048-.451,.05-.435,.116-.864,.197-1.289,.021-.11,.037-.222,.06-.331,.106-.503,.236-.998,.383-1.484,.046-.153,.1-.303,.15-.455,.116-.35,.242-.694,.379-1.033,.067-.167,.132-.336,.204-.5,.189-.433,.393-.859,.615-1.273,.092-.173,.196-.339,.294-.508,.15-.26,.305-.517,.467-.768,.133-.205,.268-.409,.409-.608,.147-.208,.302-.41,.458-.611,.28-.362,.572-.713,.878-1.053,.13-.146,.259-.293,.395-.435,.212-.221,.432-.435,.656-.645,.116-.109,.234-.215,.354-.321,.787-.703,1.634-1.338,2.535-1.896,.1-.062,.199-.123,.3-.182,.304-.181,.612-.356,.928-.519,2.464-1.27,5.25-2,8.208-2s5.744,.73,8.208,2c.315,.163,.624,.338,.928,.519,.101,.06,.201,.121,.3,.182,.901,.558,1.749,1.193,2.535,1.896,.119,.106,.238,.212,.354,.321,.224,.21,.443,.424,.656,.645,.135,.142,.264,.289,.395,.435,.306,.34,.599,.691,.878,1.053,.155,.202,.311,.403,.458,.611,.141,.199,.276,.403,.409,.608,.163,.251,.317,.508,.467,.768,.098,.169,.202,.335,.294,.508,.222,.415,.425,.84,.615,1.273,.072,.165,.137,.333,.204,.5,.137,.339,.263,.684,.379,1.033,.05,.151,.104,.301,.15,.455,.147,.487,.277,.981,.383,1.484,.023,.109,.039,.221,.06,.331,.081,.425,.147,.854,.197,1.289,.018,.15,.035,.3,.048,.451,.049,.54,.083,1.084,.083,1.637s-.034,1.097-.083,1.637Z"
|
|
66556
|
+
}
|
|
66557
|
+
)
|
|
66558
|
+
] });
|
|
66559
|
+
}
|
|
66656
66560
|
function settings({ height, width, fill: fill2, className }) {
|
|
66657
66561
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { className, height, width, viewBox: "0 0 256 256", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
66658
66562
|
"path",
|
|
@@ -67187,6 +67091,60 @@ function measure({ height, width, fill: fill2, className }) {
|
|
|
67187
67091
|
)
|
|
67188
67092
|
] });
|
|
67189
67093
|
}
|
|
67094
|
+
function sectionBoxSettings({ height, width, fill: fill2, className }) {
|
|
67095
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { className, height, width, viewBox: "0 0 256 256", children: [
|
|
67096
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
67097
|
+
"path",
|
|
67098
|
+
{
|
|
67099
|
+
fill: fill2,
|
|
67100
|
+
d: "M 109.70368,2.190587 17.447731,55.710016 A 16.213,16.213 0 0 0 9.3632977,69.780402 L 9.6706253,176.28696 a 16.215,16.215 0 0 0 8.1654987,14.0235 l 95.269706,54.51732 c 1.35625,0.77609 3.04643,-0.20379 3.04192,-1.76478 L 115.79652,121.3395 221.23346,60.173007 c 1.35174,-0.783903 1.34611,-2.734895 -0.0101,-3.511985 L 125.95362,2.1436974 a 16.278,16.278 0 0 0 -16.24994,0.04689 z M 95.74464,211.51674 29.976783,173.88635 29.714025,82.825734 l 65.768857,37.630376 0.262761,91.06162 z m 9.95507,-107.77018 -65.766855,-37.629382 77.949835,-45.221114 65.76886,37.62938 -77.95084,45.221116 z"
|
|
67101
|
+
}
|
|
67102
|
+
),
|
|
67103
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
67104
|
+
"path",
|
|
67105
|
+
{
|
|
67106
|
+
fill: fill2,
|
|
67107
|
+
d: "m 175.57713,226.38215 c -1.28316,3.98514 -5.40414,6.14971 -9.13315,4.86244 l -3.60809,-1.24739 c -3.76004,-1.29737 -5.86799,-5.60846 -4.70379,-9.64145 l 0.42438,-1.46966 c 0.96925,-3.3572 -0.3989,-7.74539 -3.07521,-9.81798 l -0.73032,-0.56682 c -2.66882,-2.0641 -7.02118,-2.10184 -9.7235,-0.0863 l -1.1842,0.8837 c -3.23919,2.42089 -7.76901,1.59565 -10.07644,-1.77642 l -2.23242,-3.26259 c -2.3254,-3.40131 -1.6226,-8.22657 1.51812,-10.73784 l 1.15669,-0.92571 c 2.63933,-2.1082 3.9555,-6.51288 2.93126,-9.86426 l -0.27844,-0.91558 c -1.01877,-3.33861 -4.52035,-6.09072 -7.821,-6.14815 l -1.44661,-0.0253 c -3.95551,-0.0693 -7.1652,-3.56724 -7.1652,-7.7374 v -4.03725 c 0,-4.20531 3.2372,-7.66991 7.1652,-7.73745 l 1.44661,-0.0251 c 3.30016,-0.0568 6.79826,-2.79894 7.821,-6.14974 l 0.27844,-0.91348 c 1.02023,-3.33859 -0.29193,-7.75605 -2.93126,-9.86586 l -1.15669,-0.9241 c -3.16419,-2.52987 -3.82354,-7.3652 -1.51812,-10.73784 l 2.23242,-3.2647 c 2.32739,-3.39921 6.86326,-4.17603 10.07644,-1.77645 l 1.1842,0.88372 c 2.70232,2.01782 7.04471,1.98645 9.7235,-0.086 l 0.73032,-0.56467 c 2.66683,-2.06414 4.04446,-6.46083 3.07521,-9.81803 l -0.42438,-1.47176 c -1.1627,-4.02504 0.97525,-8.35208 4.70379,-9.63935 l 3.60809,-1.24738 c 3.76004,-1.299493 7.84798,0.87146 9.13315,4.86086 l 0.46987,1.4569 c 1.07175,3.32157 4.60331,6.0152 7.91546,6.0152 h 0.90232 c 3.30011,0 6.84321,-2.69363 7.91345,-6.0152 l 0.46988,-1.4569 c 1.28517,-3.98301 5.40663,-6.148123 9.13516,-4.86033 l 3.60808,1.24739 c 3.76006,1.29738 5.86803,5.60632 4.70383,9.63932 l -0.42441,1.47179 c -0.96925,3.35722 0.39893,7.7454 3.07522,9.81798 l 0.73029,0.56467 c 2.66883,2.06622 7.02122,2.10401 9.72154,0.0862 l 1.1842,-0.88369 c 3.23916,-2.41874 7.77099,-1.59353 10.0764,1.77644 l 2.23444,3.26469 c 2.32542,3.40132 1.62261,8.22656 -1.51812,10.73784 l -1.15667,0.92409 c -2.63936,2.11036 -3.95552,6.51504 -2.93328,9.86586 l 0.28043,0.91346 c 1.01873,3.34022 4.52035,6.09284 7.82101,6.14975 l 1.44514,0.0251 c 3.95749,0.0671 7.16516,3.56725 7.16516,7.73741 v 4.03729 c 0,4.20314 -3.23717,7.66987 -7.16516,7.73739 l -1.44514,0.0254 c -3.30016,0.0568 -6.79828,2.79678 -7.82101,6.14812 l -0.28043,0.91562 c -1.01872,3.33856 0.29392,7.75601 2.93328,9.86424 l 1.15667,0.92571 c 3.16422,2.52985 3.82355,7.36522 1.51812,10.73786 l -2.23444,3.26254 c -2.32537,3.40135 -6.86123,4.17815 -10.0764,1.77645 l -1.1842,-0.88373 c -2.70032,-2.01569 -7.04322,-1.98646 -9.72154,0.086 l -0.73029,0.56681 c -2.66683,2.06412 -4.04447,6.46079 -3.07522,9.81801 l 0.42441,1.46964 c 1.1627,4.02717 -0.97526,8.3542 -4.70383,9.64146 l -3.60808,1.24739 c -3.76002,1.29736 -7.84798,-0.87146 -9.13516,-4.86248 l -0.46988,-1.45474 c -1.06973,-3.32157 -4.60133,-6.01523 -7.91345,-6.01523 h -0.90232 c -3.30013,0 -6.84323,2.69366 -7.91546,6.01523 l -0.46987,1.45474 z m 8.83473,-24.33631 c 18.77473,0 33.99232,-16.18681 33.99232,-36.15723 0,-19.97043 -15.21759,-36.1551 -33.99232,-36.1551 -18.77467,0 -33.9903,16.18681 -33.9903,36.1551 0,19.96828 15.21761,36.15723 33.9903,36.15723 z"
|
|
67108
|
+
}
|
|
67109
|
+
)
|
|
67110
|
+
] });
|
|
67111
|
+
}
|
|
67112
|
+
function sectionBoxAuto({ height, width, fill: fill2, className }) {
|
|
67113
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { className, height, width, viewBox: "0 0 256 256", children: [
|
|
67114
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
67115
|
+
"path",
|
|
67116
|
+
{
|
|
67117
|
+
fill: fill2,
|
|
67118
|
+
d: "M 109.70368,2.190587 17.447731,55.710016 A 16.213,16.213 0 0 0 9.3632977,69.780402 L 9.6706253,176.28696 a 16.215,16.215 0 0 0 8.1654987,14.0235 l 95.269706,54.51732 c 1.35625,0.77609 3.04643,-0.20379 3.04192,-1.76478 L 115.79652,121.3395 221.23346,60.173007 c 1.35174,-0.783903 1.34611,-2.734895 -0.0101,-3.511985 L 125.95362,2.1436974 a 16.278,16.278 0 0 0 -16.24994,0.04689 z M 95.74464,211.51674 29.976783,173.88635 29.714025,82.825734 l 65.768857,37.630376 0.262761,91.06162 z m 9.95507,-107.77018 -65.766855,-37.629382 77.949835,-45.221114 65.76886,37.62938 -77.95084,45.221116 z"
|
|
67119
|
+
}
|
|
67120
|
+
),
|
|
67121
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
67122
|
+
"path",
|
|
67123
|
+
{
|
|
67124
|
+
fill: fill2,
|
|
67125
|
+
d: "M 221.207314 217.240532 L 214.827314 200.469532 L 160.504314 200.469532 L 154.124314 217.604532 C 151.632314 224.288532 149.506314 228.815532 147.744314 231.186532 C 145.981314 233.494532 143.095314 234.649532 139.085314 234.649532 C 135.682314 234.649532 132.674314 233.403532 130.061314 230.912532 C 127.448314 228.420532 126.142314 225.595532 126.142314 222.435532 C 126.142314 220.612532 126.446314 218.729532 127.053314 216.784532 C 127.661314 214.840532 128.664314 212.137532 130.061314 208.672532 L 164.241314 121.901532 C 165.213314 119.410532 166.368314 116.432532 167.704314 112.969532 C 169.102314 109.444532 170.560314 106.528532 172.079314 104.219532 C 173.659314 101.911532 175.695314 100.057532 178.186314 98.660532 C 180.738314 97.201532 183.868314 96.471532 187.574314 96.471532 C 191.342314 96.471532 194.471314 97.201532 196.962314 98.660532 C 199.514314 100.057532 201.550314 101.879532 203.069314 104.128532 C 204.649314 106.376532 205.955314 108.807532 206.988314 111.419532 C 208.082314 113.971532 209.449314 117.405532 211.090314 121.719532 L 245.999314 207.943532 C 248.733314 214.505532 250.100314 219.275532 250.100314 222.253532 C 250.100314 225.352532 248.794314 228.209532 246.181314 230.822532 C 243.629314 233.373532 240.530314 234.649532 236.884314 234.649532 C 234.758314 234.649532 232.935314 234.254532 231.416314 233.464532 C 229.896314 232.735532 228.620314 231.732532 227.587314 230.456532 C 226.554314 229.119532 225.430314 227.115532 224.215314 224.440532 C 223.060314 221.706532 222.058314 219.306532 221.207314 217.240532 Z M 167.613314 180.143532 L 207.535314 180.143532 L 187.392314 125.000532 Z"
|
|
67126
|
+
}
|
|
67127
|
+
)
|
|
67128
|
+
] });
|
|
67129
|
+
}
|
|
67130
|
+
function sectionBoxVisible({ height, width, fill: fill2, className }) {
|
|
67131
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { className, height, width, viewBox: "0 0 256 256", children: [
|
|
67132
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
67133
|
+
"path",
|
|
67134
|
+
{
|
|
67135
|
+
fill: fill2,
|
|
67136
|
+
d: "M 109.70368,2.190587 17.447731,55.710016 A 16.213,16.213 0 0 0 9.3632977,69.780402 L 9.6706253,176.28696 a 16.215,16.215 0 0 0 8.1654987,14.0235 l 95.269706,54.51732 c 1.35625,0.77609 3.04643,-0.20379 3.04192,-1.76478 L 115.79652,121.3395 221.23346,60.173007 c 1.35174,-0.783903 1.34611,-2.734895 -0.0101,-3.511985 L 125.95362,2.1436974 a 16.278,16.278 0 0 0 -16.24994,0.04689 z M 95.74464,211.51674 29.976783,173.88635 29.714025,82.825734 l 65.768857,37.630376 0.262761,91.06162 z m 9.95507,-107.77018 -65.766855,-37.629382 77.949835,-45.221114 65.76886,37.62938 -77.95084,45.221116 z"
|
|
67137
|
+
}
|
|
67138
|
+
),
|
|
67139
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
67140
|
+
"path",
|
|
67141
|
+
{
|
|
67142
|
+
fill: fill2,
|
|
67143
|
+
d: "m 186.05204,115.30607 c -37.93016,0 -68.67906,39.581 -68.67906,59.64313 0,21.35677 30.7489,59.64312 68.67906,59.64312 37.93016,0 68.67906,-38.28635 68.67906,-59.64312 0,-20.06213 -30.7489,-59.64313 -68.67906,-59.64313 z m 40.42729,85.41349 c -6.9441,6.83951 -21.43002,18.31368 -40.42729,18.31368 -18.99727,0 -33.48265,-11.47417 -40.42728,-18.31368 -11.61642,-11.4411 -15.37445,-22.30263 -15.37445,-25.77036 0,-0.0305 0.0381,-3.14164 3.35186,-9.36916 2.8652,-5.38603 7.15818,-11.06056 12.08697,-15.97917 3.66628,-3.65833 9.40099,-8.61065 16.72067,-12.50626 -6.58514,7.55977 -10.6973,18.2333 -10.6973,30.07505 0,22.91463 15.37445,41.49087 34.33953,41.49087 18.96508,0 34.33953,-18.57624 34.33953,-41.49087 0,-5.71277 -0.95614,-11.15521 -2.68492,-16.10818 -0.0445,9.9792 -6.75148,18.05306 -15.0214,18.05306 -8.26992,0 -15.02354,-8.12702 -15.02354,-18.15225 0,-8.97953 5.39774,-16.43168 12.48617,-17.88905 11.9346,3.73548 21.13062,11.40091 26.2676,16.52763 4.92879,4.91861 9.22177,10.59379 12.08697,15.97917 3.31377,6.22752 3.35186,9.33869 3.35186,9.36916 0,3.46773 -3.75803,14.32926 -15.37445,25.77036 z"
|
|
67144
|
+
}
|
|
67145
|
+
)
|
|
67146
|
+
] });
|
|
67147
|
+
}
|
|
67190
67148
|
function sectionBox({ height, width, fill: fill2, className }) {
|
|
67191
67149
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { className, height, width, viewBox: "0 0 256 256", children: [
|
|
67192
67150
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -67205,6 +67163,31 @@ function sectionBox({ height, width, fill: fill2, className }) {
|
|
|
67205
67163
|
)
|
|
67206
67164
|
] });
|
|
67207
67165
|
}
|
|
67166
|
+
function sectionBoxDisable({ height, width, fill: fill2, className }) {
|
|
67167
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { className, height, width, viewBox: "0 0 256 256", children: [
|
|
67168
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
67169
|
+
"path",
|
|
67170
|
+
{
|
|
67171
|
+
fill: fill2,
|
|
67172
|
+
d: "M 109.70368,2.190587 17.447731,55.710016 A 16.213,16.213 0 0 0 9.3632977,69.780402 L 9.6706253,176.28696 a 16.215,16.215 0 0 0 8.1654987,14.0235 l 95.269706,54.51732 c 1.35625,0.77609 3.04643,-0.20379 3.04192,-1.76478 L 115.79652,121.3395 221.23346,60.173007 c 1.35174,-0.783903 1.34611,-2.734895 -0.0101,-3.511985 L 125.95362,2.1436974 a 16.278,16.278 0 0 0 -16.24994,0.04689 z M 95.74464,211.51674 29.976783,173.88635 29.714025,82.825734 l 65.768857,37.630376 0.262761,91.06162 z m 9.95507,-107.77018 -65.766855,-37.629382 77.949835,-45.221114 65.76886,37.62938 -77.95084,45.221116 z"
|
|
67173
|
+
}
|
|
67174
|
+
),
|
|
67175
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
67176
|
+
"path",
|
|
67177
|
+
{
|
|
67178
|
+
fill: fill2,
|
|
67179
|
+
d: "m 185.61601,192.28388 v -44.0883 c 0,-2.52838 -1.97182,-4.91709 -4.84542,-5.26996 -3.49833,-0.42965 -6.4956,1.9253 -6.4956,4.89027 v 44.08783 c 0,2.52885 1.97182,4.91756 4.84542,5.27043 3.49833,0.42965 6.4956,-1.92531 6.4956,-4.89027 z m 22.68149,0 v -44.0883 c 0,-2.52838 -1.97182,-4.91709 -4.84542,-5.26996 -3.49832,-0.42965 -6.49559,1.9253 -6.49559,4.89027 v 44.08783 c 0,2.52885 1.97182,4.91756 4.84542,5.27043 3.49832,0.42965 6.49559,-1.92531 6.49559,-4.89027 z m 38.18908,-71.6429 H 225.42553 V 105.9623 c 0,-2.80818 -2.61299,-5.08498 -5.83584,-5.08498 h -56.43703 c -3.22285,0 -5.83585,2.2768 -5.83585,5.08498 v 14.67868 h -21.23089 c -4.69044,0 -8.49236,3.31275 -8.49236,7.39969 v 0.0231 c 0,4.08694 3.80192,7.39969 8.49236,7.39969 h 110.40066 c 4.69044,0 8.49236,-3.31275 8.49236,-7.39969 v -0.0231 c 0,-4.08694 -3.80192,-7.39969 -8.49236,-7.39969 z m -35.23745,-6.4863 v 6.4863 h -39.75592 v -6.4863 a 1.0615448,0.92496161 0 0 1 1.06155,-0.92496 h 37.63282 a 1.0615448,0.92496161 0 0 1 1.06155,0.92496 z"
|
|
67180
|
+
}
|
|
67181
|
+
),
|
|
67182
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
67183
|
+
"path",
|
|
67184
|
+
{
|
|
67185
|
+
fill: fill2,
|
|
67186
|
+
d: "m 227.42894,215.76405 c 0,5.6549 -4.47215,10.23953 -9.98832,10.23953 h -49.76957 c -5.51617,0 -9.98832,-4.58463 -9.98832,-10.23953 v -69.72083 a 4.9863693,5.1117785 0 0 0 -4.98637,-5.11178 h -10.00391 a 4.9863693,5.1117785 0 0 0 -4.98637,5.11178 v 73.13422 c 0,15.08038 11.92553,27.30584 26.63594,27.30584 h 56.42825 c 14.71041,0 26.63594,-12.22546 26.63594,-27.30584 v -73.13422 a 4.9863693,5.1117785 0 0 0 -4.98637,-5.11178 h -10.0039 a 4.9863693,5.1117785 0 0 0 -4.98637,5.11178 v 69.72147 z"
|
|
67187
|
+
}
|
|
67188
|
+
)
|
|
67189
|
+
] });
|
|
67190
|
+
}
|
|
67208
67191
|
function sectionBoxClip({ height, width, fill: fill2, className }) {
|
|
67209
67192
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { className, height, width, viewBox: "0 0 256 256", children: [
|
|
67210
67193
|
/* @__PURE__ */ jsxRuntimeExports.jsx("path", { fill: "none", d: "M0 0h256v256H0z" }),
|
|
@@ -67286,6 +67269,24 @@ function sectionBoxShrink({ height, width, fill: fill2, className }) {
|
|
|
67286
67269
|
) })
|
|
67287
67270
|
] });
|
|
67288
67271
|
}
|
|
67272
|
+
function sectionBoxShrink2({ height, width, fill: fill2, className }) {
|
|
67273
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { className, height, width, viewBox: "0 0 256 256", children: [
|
|
67274
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
67275
|
+
"path",
|
|
67276
|
+
{
|
|
67277
|
+
fill: fill2,
|
|
67278
|
+
d: "M 109.70368,2.190587 17.447731,55.710016 A 16.213,16.213 0 0 0 9.3632977,69.780402 L 9.6706253,176.28696 a 16.215,16.215 0 0 0 8.1654987,14.0235 l 95.269706,54.51732 c 1.35625,0.77609 3.04643,-0.20379 3.04192,-1.76478 L 115.79652,121.3395 221.23346,60.173007 c 1.35174,-0.783903 1.34611,-2.734895 -0.0101,-3.511985 L 125.95362,2.1436974 a 16.278,16.278 0 0 0 -16.24994,0.04689 z M 95.74464,211.51674 29.976783,173.88635 29.714025,82.825734 l 65.768857,37.630376 0.262761,91.06162 z m 9.95507,-107.77018 -65.766855,-37.629382 77.949835,-45.221114 65.76886,37.62938 -77.95084,45.221116 z"
|
|
67279
|
+
}
|
|
67280
|
+
),
|
|
67281
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
67282
|
+
"path",
|
|
67283
|
+
{
|
|
67284
|
+
fill: fill2,
|
|
67285
|
+
d: "m 223.41166,231.92815 -50.05,-51.82677 -21.39562,22.15515 -21.52251,-81.36695 78.57748,22.28655 -21.39561,22.15516 50.05002,51.82676 z"
|
|
67286
|
+
}
|
|
67287
|
+
)
|
|
67288
|
+
] });
|
|
67289
|
+
}
|
|
67289
67290
|
function ghost({ height, width, fill: fill2, className }) {
|
|
67290
67291
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { className, width: height, height: width, viewBox: "0 0 20 20", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("g", { "data-name": "ICONS", children: [
|
|
67291
67292
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -67345,11 +67346,17 @@ const icons = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
|
|
|
67345
67346
|
pan,
|
|
67346
67347
|
perspective,
|
|
67347
67348
|
sectionBox,
|
|
67349
|
+
sectionBoxAuto,
|
|
67348
67350
|
sectionBoxClip,
|
|
67351
|
+
sectionBoxDisable,
|
|
67349
67352
|
sectionBoxIgnore,
|
|
67350
67353
|
sectionBoxReset,
|
|
67354
|
+
sectionBoxSettings,
|
|
67351
67355
|
sectionBoxShrink,
|
|
67356
|
+
sectionBoxShrink2,
|
|
67357
|
+
sectionBoxVisible,
|
|
67352
67358
|
settings,
|
|
67359
|
+
slidersHoriz,
|
|
67353
67360
|
toggleIsolation,
|
|
67354
67361
|
trash,
|
|
67355
67362
|
treeView,
|
|
@@ -67369,9 +67376,6 @@ function anyUiAxesButton(settings2) {
|
|
|
67369
67376
|
function anyUiCursorButton(settings2) {
|
|
67370
67377
|
return isTrue(settings2.ui.orbit) || isTrue(settings2.ui.lookAround) || isTrue(settings2.ui.pan) || isTrue(settings2.ui.zoom) || isTrue(settings2.ui.zoomWindow) || isTrue(settings2.ui.zoomToFit);
|
|
67371
67378
|
}
|
|
67372
|
-
function anyUiToolButton(settings2) {
|
|
67373
|
-
return isTrue(settings2.ui.sectioningMode) || isTrue(settings2.ui.measuringMode) || isTrue(settings2.ui.toggleIsolation);
|
|
67374
|
-
}
|
|
67375
67379
|
function anyUiSettingButton(settings2) {
|
|
67376
67380
|
return isTrue(settings2.ui.projectInspector) || isTrue(settings2.ui.settings) || isTrue(settings2.ui.help) || isTrue(settings2.ui.maximise);
|
|
67377
67381
|
}
|
|
@@ -67503,7 +67507,7 @@ function AxesPanel(props) {
|
|
|
67503
67507
|
}
|
|
67504
67508
|
);
|
|
67505
67509
|
const hidden2 = isTrue(props.settings.value.ui.axesPanel) ? "" : " vc-hidden";
|
|
67506
|
-
const
|
|
67510
|
+
const createBar = () => {
|
|
67507
67511
|
if (!anyUiAxesButton(props.settings.value)) {
|
|
67508
67512
|
return (
|
|
67509
67513
|
// Keeps layout when all buttons are disabled.
|
|
@@ -67525,7 +67529,7 @@ function AxesPanel(props) {
|
|
|
67525
67529
|
className: "vim-axes-panel vc-pointer-events-none vc-absolute vc-overflow-hidden vc-z-20 vc-flex vc-flex-col vc-border vc-border-white vc-opacity-50 vc-shadow-lg vc-saturate-0 vc-transition-all hover:vc-opacity-100 hover:vc-saturate-100" + hidden2,
|
|
67526
67530
|
children: [
|
|
67527
67531
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: gizmoDiv, className: "vim-axes-panel-gizmo vc-absolute vc-pointer-events-auto" }),
|
|
67528
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "vim-axes-panel-bar vc-absolute vc-top-[75%] vc-bottom-0 vc-right-0 vc-left-0", children:
|
|
67532
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "vim-axes-panel-bar vc-absolute vc-top-[75%] vc-bottom-0 vc-right-0 vc-left-0", children: createBar() })
|
|
67529
67533
|
]
|
|
67530
67534
|
}
|
|
67531
67535
|
);
|
|
@@ -67534,22 +67538,96 @@ const btnStyle = "vim-control-bar-button vc-rounded-full vc-items-center vc-just
|
|
|
67534
67538
|
function buttonDefaultStyle(on) {
|
|
67535
67539
|
return on ? btnStyle + " vc-text-primary" : btnStyle + " vc-text-gray-medium";
|
|
67536
67540
|
}
|
|
67541
|
+
function buttonExpandStyle(on) {
|
|
67542
|
+
return on ? btnStyle + " vc-text-white vc-bg-primary" : btnStyle + " vc-text-gray-medium";
|
|
67543
|
+
}
|
|
67544
|
+
function buttonDisableStyle(on) {
|
|
67545
|
+
return on ? btnStyle + " vc-text-gray-medium" : btnStyle + " vc-text-gray vc-pointer-events-none";
|
|
67546
|
+
}
|
|
67537
67547
|
function buttonBlueStyle(on) {
|
|
67538
67548
|
return btnStyle + " vc-text-white";
|
|
67539
67549
|
}
|
|
67540
67550
|
function createButton(button) {
|
|
67541
67551
|
var _a2;
|
|
67542
67552
|
if (button.enabled !== void 0 && !button.enabled()) return null;
|
|
67543
|
-
const style = button.style((_a2 = button.isOn) == null ? void 0 : _a2.call(button));
|
|
67544
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("button", { "data-tip": button.tip, onClick: button.action, className: style, type: "button", children: button.icon({ height: "20", width: "20", fill: "currentColor", className: "vc-max-h-[80%]" }) }, button.id);
|
|
67553
|
+
const style = (button.style ?? buttonDefaultStyle)((_a2 = button.isOn) == null ? void 0 : _a2.call(button));
|
|
67554
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("button", { id: button.id, "data-tip": button.tip, onClick: button.action, className: style, type: "button", children: button.icon({ height: "20", width: "20", fill: "currentColor", className: "vc-max-h-[80%]" }) }, button.id);
|
|
67545
67555
|
}
|
|
67546
|
-
const sectionStyle = "vc-flex vc-items-center vc-rounded-full vc-mb-2 vc-
|
|
67556
|
+
const sectionStyle = "vc-flex vc-items-center vc-rounded-full vc-mb-2 vc-shadow-md";
|
|
67547
67557
|
const sectionDefaultStyle = sectionStyle + " vc-bg-white";
|
|
67548
67558
|
const sectionBlueStyle = sectionStyle + " vc-bg-primary";
|
|
67559
|
+
const sectionNoPadStyle = sectionStyle.replace("vc-px-2", "") + " vc-bg-white";
|
|
67549
67560
|
function createSection$1(section) {
|
|
67550
67561
|
if (section.enable !== void 0 && !section.enable()) return null;
|
|
67551
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `vim-control-bar-section ${section.style}`, children: section.buttons.map((b) => createButton(b)) }, section.id);
|
|
67562
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `vim-control-bar-section ${section.style ?? sectionDefaultStyle}`, children: section.buttons.map((b) => createButton(b)) }, section.id);
|
|
67552
67563
|
}
|
|
67564
|
+
const elementIds = {
|
|
67565
|
+
// Sections
|
|
67566
|
+
sectionCamera: "controlBar.sectionCamera",
|
|
67567
|
+
sectionActions: "controlBar.sectionActions",
|
|
67568
|
+
sectionTools: "controlBar.sectionTools",
|
|
67569
|
+
sectionSettings: "controlBar.sectionSettings",
|
|
67570
|
+
sectionMeasure: "controlBar.sectionMeasure",
|
|
67571
|
+
sectionSectionBox: "controlBar.sectionSectionBox",
|
|
67572
|
+
// Camera buttons
|
|
67573
|
+
buttonCameraOrbit: "controlBar.camera.orbit",
|
|
67574
|
+
buttonCameraLook: "controlBarcamera.look",
|
|
67575
|
+
buttonCameraPan: "controlBar.camera.pan",
|
|
67576
|
+
buttonCameraZoom: "controlBar.camera.zoom",
|
|
67577
|
+
buttonCameraZoomWindow: "controlBar.camera.zoomWindow",
|
|
67578
|
+
// Settings buttons
|
|
67579
|
+
buttonProjectInspector: "controlBar.projectInspector",
|
|
67580
|
+
buttonSettings: "controlBar.settings",
|
|
67581
|
+
buttonHelp: "controlBar.help",
|
|
67582
|
+
buttonMaximize: "controlBar.maximize",
|
|
67583
|
+
// Action Buttons
|
|
67584
|
+
buttonToggleIsolation: "controlBar.action.toggleIsolation",
|
|
67585
|
+
buttonZoomToFit: "controlBar.action.zoomToFit",
|
|
67586
|
+
// Tools buttons
|
|
67587
|
+
buttonSectionBox: "controlBar.sectionBox",
|
|
67588
|
+
buttonMeasure: "controlBar.measure",
|
|
67589
|
+
// Section box buttons
|
|
67590
|
+
buttonSectionBoxEnable: "controlBar.sectionBox.enable",
|
|
67591
|
+
buttonSectionBoxVisible: "controlBar.sectionBox.visible",
|
|
67592
|
+
buttonSectionBoxShrinkToSelection: "controlBar.sectionBox.shrinkToSelection",
|
|
67593
|
+
buttonSectionBoxAuto: "controlBar.sectionBox.auto",
|
|
67594
|
+
buttonSectionBoxClip: "controlBar.sectionBox.clip",
|
|
67595
|
+
buttonSectionBoxSettings: "controlBar.sectionBox.settings"
|
|
67596
|
+
};
|
|
67597
|
+
function ControlBar(props) {
|
|
67598
|
+
useEffect(() => {
|
|
67599
|
+
ReactTooltip.rebuild();
|
|
67600
|
+
});
|
|
67601
|
+
if (!props.show) {
|
|
67602
|
+
return null;
|
|
67603
|
+
}
|
|
67604
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
67605
|
+
"div",
|
|
67606
|
+
{
|
|
67607
|
+
style: {
|
|
67608
|
+
gap: "min(10px, 2%)",
|
|
67609
|
+
bottom: "min(36px, 10%)"
|
|
67610
|
+
},
|
|
67611
|
+
id: "vim-control-bar",
|
|
67612
|
+
className: "vim-control-bar vc-pointer-events-auto vc-flex-wrap vc-mx-2 vc-min-w-0 vc-absolute vc-left-0 vc-right-0 vc-z-20 vc-flex vc-items-center vc-justify-center transition-all",
|
|
67613
|
+
children: props.content.map(createSection$1)
|
|
67614
|
+
}
|
|
67615
|
+
);
|
|
67616
|
+
}
|
|
67617
|
+
const controlBar = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
67618
|
+
__proto__: null,
|
|
67619
|
+
ControlBar,
|
|
67620
|
+
buttonBlueStyle,
|
|
67621
|
+
buttonDefaultStyle,
|
|
67622
|
+
buttonDisableStyle,
|
|
67623
|
+
buttonExpandStyle,
|
|
67624
|
+
createButton,
|
|
67625
|
+
createSection: createSection$1,
|
|
67626
|
+
elementIds,
|
|
67627
|
+
sectionBlueStyle,
|
|
67628
|
+
sectionDefaultStyle,
|
|
67629
|
+
sectionNoPadStyle
|
|
67630
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
67553
67631
|
function getPointerState(viewer) {
|
|
67554
67632
|
const [mode, setMode] = useState(viewer.inputs.pointerActive);
|
|
67555
67633
|
useEffect(() => {
|
|
@@ -67611,52 +67689,6 @@ function getFullScreenState() {
|
|
|
67611
67689
|
}
|
|
67612
67690
|
};
|
|
67613
67691
|
}
|
|
67614
|
-
function getSectionBoxState(viewer) {
|
|
67615
|
-
const sectionGizmo = viewer.gizmos.section;
|
|
67616
|
-
const first = useRef(true);
|
|
67617
|
-
const [section, setSection] = useState({
|
|
67618
|
-
clip: sectionGizmo.clip,
|
|
67619
|
-
active: sectionGizmo.visible && sectionGizmo.interactive
|
|
67620
|
-
});
|
|
67621
|
-
useEffect(() => {
|
|
67622
|
-
const subSection = sectionGizmo.onStateChanged.subscribe(
|
|
67623
|
-
() => setSection({
|
|
67624
|
-
clip: sectionGizmo.clip,
|
|
67625
|
-
active: sectionGizmo.visible && sectionGizmo.interactive
|
|
67626
|
-
})
|
|
67627
|
-
);
|
|
67628
|
-
return () => subSection();
|
|
67629
|
-
}, []);
|
|
67630
|
-
const toggle = () => {
|
|
67631
|
-
ReactTooltip.hide();
|
|
67632
|
-
if (viewer.inputs.pointerActive === "rect") {
|
|
67633
|
-
viewer.inputs.pointerActive = viewer.inputs.pointerFallback;
|
|
67634
|
-
}
|
|
67635
|
-
const next = !(sectionGizmo.visible && sectionGizmo.interactive);
|
|
67636
|
-
sectionGizmo.interactive = next;
|
|
67637
|
-
sectionGizmo.visible = next;
|
|
67638
|
-
if (next && first.current) {
|
|
67639
|
-
sectionGizmo.clip = true;
|
|
67640
|
-
sectionGizmo.fitBox(viewer.renderer.getBoundingBox());
|
|
67641
|
-
first.current = false;
|
|
67642
|
-
}
|
|
67643
|
-
};
|
|
67644
|
-
return {
|
|
67645
|
-
clip: section.clip,
|
|
67646
|
-
active: section.active,
|
|
67647
|
-
set: setSection,
|
|
67648
|
-
toggle,
|
|
67649
|
-
hide: () => {
|
|
67650
|
-
sectionGizmo.visible = false;
|
|
67651
|
-
sectionGizmo.interactive = false;
|
|
67652
|
-
},
|
|
67653
|
-
reset: () => sectionGizmo.fitBox(viewer.renderer.getBoundingBox()),
|
|
67654
|
-
shrinkToSelection: () => sectionGizmo.fitBox(viewer.selection.getBoundingBox()),
|
|
67655
|
-
toggleClip: () => {
|
|
67656
|
-
sectionGizmo.clip = !section.clip;
|
|
67657
|
-
}
|
|
67658
|
-
};
|
|
67659
|
-
}
|
|
67660
67692
|
function pointerToCursor(pointer) {
|
|
67661
67693
|
switch (pointer) {
|
|
67662
67694
|
case "orbit":
|
|
@@ -67708,13 +67740,13 @@ class CursorManager {
|
|
|
67708
67740
|
const sub2 = this._viewer.inputs.onPointerOverrideChanged.subscribe(
|
|
67709
67741
|
() => this._updateCursor()
|
|
67710
67742
|
);
|
|
67711
|
-
const sub3 = this._viewer.gizmos.
|
|
67712
|
-
if (!this._viewer.gizmos.
|
|
67743
|
+
const sub3 = this._viewer.gizmos.sectionBox.onStateChanged.subscribe(() => {
|
|
67744
|
+
if (!this._viewer.gizmos.sectionBox.visible) {
|
|
67713
67745
|
this._boxHover = false;
|
|
67714
67746
|
this._updateCursor();
|
|
67715
67747
|
}
|
|
67716
67748
|
});
|
|
67717
|
-
const sub4 = this._viewer.gizmos.
|
|
67749
|
+
const sub4 = this._viewer.gizmos.sectionBox.onHover.subscribe((hover) => {
|
|
67718
67750
|
this._boxHover = hover;
|
|
67719
67751
|
this._updateCursor();
|
|
67720
67752
|
});
|
|
@@ -67777,59 +67809,77 @@ function getMeasureState(viewer, cursor) {
|
|
|
67777
67809
|
clear
|
|
67778
67810
|
};
|
|
67779
67811
|
}
|
|
67780
|
-
|
|
67781
|
-
|
|
67782
|
-
|
|
67783
|
-
|
|
67784
|
-
|
|
67785
|
-
|
|
67786
|
-
|
|
67787
|
-
|
|
67788
|
-
|
|
67789
|
-
|
|
67790
|
-
|
|
67791
|
-
|
|
67792
|
-
|
|
67793
|
-
|
|
67794
|
-
|
|
67795
|
-
|
|
67796
|
-
|
|
67797
|
-
|
|
67798
|
-
|
|
67799
|
-
|
|
67800
|
-
|
|
67801
|
-
|
|
67802
|
-
|
|
67803
|
-
|
|
67804
|
-
|
|
67805
|
-
|
|
67806
|
-
|
|
67807
|
-
|
|
67808
|
-
|
|
67809
|
-
|
|
67810
|
-
|
|
67811
|
-
|
|
67812
|
-
|
|
67813
|
-
|
|
67814
|
-
|
|
67815
|
-
|
|
67816
|
-
|
|
67817
|
-
|
|
67818
|
-
|
|
67819
|
-
|
|
67820
|
-
|
|
67821
|
-
|
|
67822
|
-
|
|
67823
|
-
|
|
67824
|
-
|
|
67825
|
-
|
|
67812
|
+
function controlBarSectionBox(section, hasSelection) {
|
|
67813
|
+
return {
|
|
67814
|
+
id: elementIds.sectionSectionBox,
|
|
67815
|
+
style: section.enable.get() ? sectionNoPadStyle : sectionDefaultStyle,
|
|
67816
|
+
//enable: () => section.getEnable(),
|
|
67817
|
+
buttons: [
|
|
67818
|
+
{
|
|
67819
|
+
id: elementIds.buttonSectionBoxEnable,
|
|
67820
|
+
tip: "Enable Section Box",
|
|
67821
|
+
isOn: () => section.enable.get(),
|
|
67822
|
+
style: (on) => buttonExpandStyle(on),
|
|
67823
|
+
action: () => section.enable.set(!section.enable.get()),
|
|
67824
|
+
icon: sectionBox
|
|
67825
|
+
},
|
|
67826
|
+
{
|
|
67827
|
+
id: elementIds.buttonSectionBoxShrinkToSelection,
|
|
67828
|
+
tip: "Fit Section",
|
|
67829
|
+
enabled: () => section.enable.get(),
|
|
67830
|
+
isOn: () => hasSelection,
|
|
67831
|
+
style: (on) => buttonDisableStyle(on),
|
|
67832
|
+
action: () => section.sectionSelection(),
|
|
67833
|
+
icon: sectionBoxShrink
|
|
67834
|
+
},
|
|
67835
|
+
{
|
|
67836
|
+
id: elementIds.buttonSectionBoxClip,
|
|
67837
|
+
tip: "Reset Section",
|
|
67838
|
+
enabled: () => section.enable.get(),
|
|
67839
|
+
style: (on) => buttonDefaultStyle(on),
|
|
67840
|
+
action: () => section.sectionReset(),
|
|
67841
|
+
icon: sectionBoxReset
|
|
67842
|
+
},
|
|
67843
|
+
{
|
|
67844
|
+
id: elementIds.buttonSectionBoxVisible,
|
|
67845
|
+
tip: "Show Section Box",
|
|
67846
|
+
enabled: () => section.enable.get(),
|
|
67847
|
+
isOn: () => section.visible.get(),
|
|
67848
|
+
style: (on) => buttonDefaultStyle(on),
|
|
67849
|
+
action: () => section.visible.set(!section.visible.get()),
|
|
67850
|
+
icon: visible
|
|
67851
|
+
},
|
|
67852
|
+
{
|
|
67853
|
+
id: elementIds.buttonSectionBoxAuto,
|
|
67854
|
+
tip: "Auto Section",
|
|
67855
|
+
enabled: () => section.enable.get(),
|
|
67856
|
+
isOn: () => section.auto.get(),
|
|
67857
|
+
style: (on) => buttonDefaultStyle(on),
|
|
67858
|
+
action: () => section.auto.set(!section.auto.get()),
|
|
67859
|
+
icon: sectionBoxAuto
|
|
67860
|
+
},
|
|
67861
|
+
{
|
|
67862
|
+
id: elementIds.buttonSectionBoxSettings,
|
|
67863
|
+
tip: "Section Settings",
|
|
67864
|
+
enabled: () => section.enable.get(),
|
|
67865
|
+
isOn: () => section.showOffsetPanel.get(),
|
|
67866
|
+
style: (on) => buttonDefaultStyle(on),
|
|
67867
|
+
action: () => section.showOffsetPanel.set(!section.showOffsetPanel.get()),
|
|
67868
|
+
icon: slidersHoriz
|
|
67869
|
+
}
|
|
67870
|
+
]
|
|
67871
|
+
};
|
|
67872
|
+
}
|
|
67873
|
+
function controlBarPointer(viewer, camera2, settings2, section) {
|
|
67874
|
+
const pointer = getPointerState(viewer);
|
|
67875
|
+
return {
|
|
67826
67876
|
id: elementIds.sectionCamera,
|
|
67827
|
-
enable: () => anyUiCursorButton(
|
|
67877
|
+
enable: () => anyUiCursorButton(settings2),
|
|
67828
67878
|
style: sectionDefaultStyle,
|
|
67829
67879
|
buttons: [
|
|
67830
67880
|
{
|
|
67831
67881
|
id: elementIds.buttonCameraOrbit,
|
|
67832
|
-
enabled: () => isTrue(
|
|
67882
|
+
enabled: () => isTrue(settings2.ui.orbit),
|
|
67833
67883
|
tip: "Orbit",
|
|
67834
67884
|
action: () => pointer.onButton("orbit"),
|
|
67835
67885
|
icon: orbit,
|
|
@@ -67838,7 +67888,7 @@ function ControlBar(props) {
|
|
|
67838
67888
|
},
|
|
67839
67889
|
{
|
|
67840
67890
|
id: elementIds.buttonCameraLook,
|
|
67841
|
-
enabled: () => isTrue(
|
|
67891
|
+
enabled: () => isTrue(settings2.ui.lookAround),
|
|
67842
67892
|
tip: "Look Around",
|
|
67843
67893
|
action: () => pointer.onButton("look"),
|
|
67844
67894
|
icon: look,
|
|
@@ -67847,7 +67897,7 @@ function ControlBar(props) {
|
|
|
67847
67897
|
},
|
|
67848
67898
|
{
|
|
67849
67899
|
id: elementIds.buttonCameraPan,
|
|
67850
|
-
enabled: () => isTrue(
|
|
67900
|
+
enabled: () => isTrue(settings2.ui.pan),
|
|
67851
67901
|
tip: "Pan",
|
|
67852
67902
|
action: () => pointer.onButton("pan"),
|
|
67853
67903
|
icon: pan,
|
|
@@ -67856,7 +67906,7 @@ function ControlBar(props) {
|
|
|
67856
67906
|
},
|
|
67857
67907
|
{
|
|
67858
67908
|
id: elementIds.buttonCameraZoom,
|
|
67859
|
-
enabled: () => isTrue(
|
|
67909
|
+
enabled: () => isTrue(settings2.ui.zoom),
|
|
67860
67910
|
tip: "Zoom",
|
|
67861
67911
|
action: () => pointer.onButton("zoom"),
|
|
67862
67912
|
icon: zoom,
|
|
@@ -67865,59 +67915,87 @@ function ControlBar(props) {
|
|
|
67865
67915
|
},
|
|
67866
67916
|
{
|
|
67867
67917
|
id: elementIds.buttonCameraZoomWindow,
|
|
67868
|
-
enabled: () => isTrue(
|
|
67918
|
+
enabled: () => isTrue(settings2.ui.zoomWindow),
|
|
67869
67919
|
tip: "Zoom Window",
|
|
67870
67920
|
action: () => {
|
|
67871
67921
|
pointer.onButton("rect");
|
|
67872
|
-
section.hide();
|
|
67873
67922
|
},
|
|
67874
67923
|
icon: frameRect,
|
|
67875
67924
|
isOn: () => pointer.mode === "rect",
|
|
67876
67925
|
style: buttonDefaultStyle
|
|
67877
|
-
}
|
|
67926
|
+
}
|
|
67927
|
+
]
|
|
67928
|
+
};
|
|
67929
|
+
}
|
|
67930
|
+
function controlBarActions(camera2, settings2, isolation, measure$1) {
|
|
67931
|
+
return {
|
|
67932
|
+
id: elementIds.sectionActions,
|
|
67933
|
+
enable: () => true,
|
|
67934
|
+
style: sectionDefaultStyle,
|
|
67935
|
+
buttons: [
|
|
67878
67936
|
{
|
|
67879
|
-
id: elementIds.
|
|
67880
|
-
enabled: () => isTrue(
|
|
67937
|
+
id: elementIds.buttonZoomToFit,
|
|
67938
|
+
enabled: () => isTrue(settings2.ui.zoomToFit),
|
|
67881
67939
|
tip: "Zoom to Fit",
|
|
67882
|
-
action: () =>
|
|
67940
|
+
action: () => camera2.frameContext(),
|
|
67883
67941
|
icon: frameSelection,
|
|
67884
67942
|
isOn: () => false,
|
|
67885
67943
|
style: buttonDefaultStyle
|
|
67944
|
+
},
|
|
67945
|
+
{
|
|
67946
|
+
id: elementIds.buttonToggleIsolation,
|
|
67947
|
+
enabled: () => isTrue(settings2.ui.toggleIsolation),
|
|
67948
|
+
tip: "Toggle Isolation",
|
|
67949
|
+
action: () => isolation.toggle("controlBar"),
|
|
67950
|
+
icon: toggleIsolation,
|
|
67951
|
+
style: buttonDefaultStyle
|
|
67952
|
+
},
|
|
67953
|
+
{
|
|
67954
|
+
id: elementIds.buttonMeasure,
|
|
67955
|
+
enabled: () => isTrue(settings2.ui.measuringMode),
|
|
67956
|
+
isOn: () => measure$1.active,
|
|
67957
|
+
tip: "Measuring Mode",
|
|
67958
|
+
action: () => measure$1.toggle(),
|
|
67959
|
+
icon: measure,
|
|
67960
|
+
style: buttonDefaultStyle
|
|
67886
67961
|
}
|
|
67887
67962
|
]
|
|
67888
67963
|
};
|
|
67889
|
-
|
|
67964
|
+
}
|
|
67965
|
+
function controlBarSettings(modal, side, settings$1) {
|
|
67966
|
+
const fullScreen = getFullScreenState();
|
|
67967
|
+
return {
|
|
67890
67968
|
id: elementIds.sectionSettings,
|
|
67891
|
-
enable: () => anyUiSettingButton(
|
|
67969
|
+
enable: () => anyUiSettingButton(settings$1),
|
|
67892
67970
|
style: sectionDefaultStyle,
|
|
67893
67971
|
buttons: [
|
|
67894
67972
|
{
|
|
67895
67973
|
id: elementIds.buttonProjectInspector,
|
|
67896
|
-
enabled: () => isTrue(
|
|
67974
|
+
enabled: () => isTrue(settings$1.ui.projectInspector) && (isTrue(settings$1.ui.bimTreePanel) || isTrue(settings$1.ui.bimInfoPanel)),
|
|
67897
67975
|
tip: "Project Inspector",
|
|
67898
|
-
action: () =>
|
|
67976
|
+
action: () => side.toggleContent("bim"),
|
|
67899
67977
|
icon: treeView,
|
|
67900
67978
|
style: buttonDefaultStyle
|
|
67901
67979
|
},
|
|
67902
67980
|
{
|
|
67903
67981
|
id: elementIds.buttonSettings,
|
|
67904
|
-
enabled: () => isTrue(
|
|
67982
|
+
enabled: () => isTrue(settings$1.ui.settings),
|
|
67905
67983
|
tip: "Settings",
|
|
67906
|
-
action: () =>
|
|
67984
|
+
action: () => side.toggleContent("settings"),
|
|
67907
67985
|
icon: settings,
|
|
67908
67986
|
style: buttonDefaultStyle
|
|
67909
67987
|
},
|
|
67910
67988
|
{
|
|
67911
67989
|
id: elementIds.buttonHelp,
|
|
67912
|
-
enabled: () => isTrue(
|
|
67990
|
+
enabled: () => isTrue(settings$1.ui.help),
|
|
67913
67991
|
tip: "Help",
|
|
67914
|
-
action: () =>
|
|
67992
|
+
action: () => modal.help(true),
|
|
67915
67993
|
icon: help,
|
|
67916
67994
|
style: buttonDefaultStyle
|
|
67917
67995
|
},
|
|
67918
67996
|
{
|
|
67919
67997
|
id: elementIds.buttonMaximize,
|
|
67920
|
-
enabled: () => isTrue(
|
|
67998
|
+
enabled: () => isTrue(settings$1.ui.maximise) && settings$1.capacity.canGoFullScreen,
|
|
67921
67999
|
tip: fullScreen.get() ? "Minimize" : "Fullscreen",
|
|
67922
68000
|
action: () => fullScreen.toggle(),
|
|
67923
68001
|
icon: fullScreen.get() ? minimize : fullsScreen,
|
|
@@ -67925,112 +68003,23 @@ function ControlBar(props) {
|
|
|
67925
68003
|
}
|
|
67926
68004
|
]
|
|
67927
68005
|
};
|
|
67928
|
-
const sectionBoxSection = {
|
|
67929
|
-
id: elementIds.sectionSectionBox,
|
|
67930
|
-
enable: () => !measure$1.active && section.active,
|
|
67931
|
-
style: sectionBlueStyle,
|
|
67932
|
-
buttons: [
|
|
67933
|
-
{
|
|
67934
|
-
id: elementIds.buttonSectionBoxReset,
|
|
67935
|
-
tip: "Reset Section Box",
|
|
67936
|
-
action: () => section.reset(),
|
|
67937
|
-
icon: sectionBoxReset,
|
|
67938
|
-
style: buttonBlueStyle
|
|
67939
|
-
},
|
|
67940
|
-
{
|
|
67941
|
-
id: elementIds.buttonSectionBoxShrinkToSelection,
|
|
67942
|
-
tip: "Shrink to Selection",
|
|
67943
|
-
action: () => section.shrinkToSelection(),
|
|
67944
|
-
icon: sectionBoxShrink,
|
|
67945
|
-
style: buttonBlueStyle
|
|
67946
|
-
},
|
|
67947
|
-
{
|
|
67948
|
-
id: elementIds.buttonSectionBoxClip,
|
|
67949
|
-
tip: section.clip ? "Ignore Section Box" : "Clip Section Box",
|
|
67950
|
-
action: () => section.toggleClip(),
|
|
67951
|
-
icon: section.clip ? sectionBoxIgnore : sectionBoxClip,
|
|
67952
|
-
style: buttonBlueStyle
|
|
67953
|
-
},
|
|
67954
|
-
{
|
|
67955
|
-
id: elementIds.buttonSectionBoxDone,
|
|
67956
|
-
tip: "Done",
|
|
67957
|
-
action: () => section.toggle(),
|
|
67958
|
-
icon: checkmark,
|
|
67959
|
-
style: buttonBlueStyle
|
|
67960
|
-
}
|
|
67961
|
-
]
|
|
67962
|
-
};
|
|
67963
|
-
const measureSection = {
|
|
67964
|
-
id: elementIds.sectionMeasure,
|
|
67965
|
-
enable: () => measure$1.active && !section.active,
|
|
67966
|
-
style: sectionBlueStyle,
|
|
67967
|
-
buttons: [
|
|
67968
|
-
{
|
|
67969
|
-
id: elementIds.buttonMeasureDelete,
|
|
67970
|
-
tip: "Delete",
|
|
67971
|
-
action: () => measure$1.clear(),
|
|
67972
|
-
icon: trash,
|
|
67973
|
-
style: buttonBlueStyle
|
|
67974
|
-
},
|
|
67975
|
-
{
|
|
67976
|
-
id: elementIds.buttonMeasureDone,
|
|
67977
|
-
tip: "Done",
|
|
67978
|
-
action: () => measure$1.toggle(),
|
|
67979
|
-
icon: checkmark,
|
|
67980
|
-
style: buttonBlueStyle
|
|
67981
|
-
}
|
|
67982
|
-
]
|
|
67983
|
-
};
|
|
67984
|
-
const toolSections = {
|
|
67985
|
-
id: elementIds.sectionTools,
|
|
67986
|
-
enable: () => anyUiToolButton(props.settings) && !measure$1.active && !section.active,
|
|
67987
|
-
style: measure$1.active || section.active ? sectionBlueStyle : sectionDefaultStyle,
|
|
67988
|
-
buttons: [
|
|
67989
|
-
{
|
|
67990
|
-
id: elementIds.buttonSectionBox,
|
|
67991
|
-
enabled: () => isTrue(props.settings.ui.sectioningMode),
|
|
67992
|
-
tip: "Sectioning Mode",
|
|
67993
|
-
action: () => section.toggle(),
|
|
67994
|
-
icon: sectionBox,
|
|
67995
|
-
style: buttonDefaultStyle
|
|
67996
|
-
},
|
|
67997
|
-
{
|
|
67998
|
-
id: elementIds.buttonMeasure,
|
|
67999
|
-
enabled: () => isTrue(props.settings.ui.measuringMode),
|
|
68000
|
-
tip: "Measuring Mode",
|
|
68001
|
-
action: () => measure$1.toggle(),
|
|
68002
|
-
icon: measure,
|
|
68003
|
-
style: buttonDefaultStyle
|
|
68004
|
-
},
|
|
68005
|
-
{
|
|
68006
|
-
id: elementIds.buttonToggleIsolation,
|
|
68007
|
-
enabled: () => isTrue(props.settings.ui.toggleIsolation),
|
|
68008
|
-
tip: "Toggle Isolation",
|
|
68009
|
-
action: () => props.isolation.toggle("controlBar"),
|
|
68010
|
-
icon: toggleIsolation,
|
|
68011
|
-
style: buttonDefaultStyle
|
|
68012
|
-
}
|
|
68013
|
-
]
|
|
68014
|
-
};
|
|
68015
|
-
let controlBar2 = [cameraSection, toolSections, measureSection, sectionBoxSection, settingsSection];
|
|
68016
|
-
controlBar2 = ((_a2 = props.customization) == null ? void 0 : _a2.call(props, controlBar2)) ?? controlBar2;
|
|
68017
|
-
return createBar(controlBar2);
|
|
68018
68006
|
}
|
|
68019
|
-
function
|
|
68020
|
-
|
|
68021
|
-
|
|
68022
|
-
|
|
68023
|
-
|
|
68007
|
+
function useControlBar(viewer, camera2, modal, side, isolation, cursor, settings2, section, customization) {
|
|
68008
|
+
const measure2 = getMeasureState(viewer, cursor);
|
|
68009
|
+
const pointerSection = controlBarPointer(viewer, camera2, settings2);
|
|
68010
|
+
const actionSection = controlBarActions(camera2, settings2, isolation, measure2);
|
|
68011
|
+
const sectionBoxSection = controlBarSectionBox(section, viewer.selection.count > 0);
|
|
68012
|
+
const settingsSection = controlBarSettings(modal, side, settings2);
|
|
68013
|
+
let controlBarSections = [
|
|
68014
|
+
pointerSection,
|
|
68015
|
+
actionSection,
|
|
68016
|
+
sectionBoxSection,
|
|
68017
|
+
// Optional section
|
|
68018
|
+
settingsSection
|
|
68019
|
+
];
|
|
68020
|
+
controlBarSections = (customization == null ? void 0 : customization(controlBarSections)) ?? controlBarSections;
|
|
68021
|
+
return controlBarSections;
|
|
68024
68022
|
}
|
|
68025
|
-
const controlBar = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
68026
|
-
__proto__: null,
|
|
68027
|
-
ControlBar,
|
|
68028
|
-
buttonBlueStyle,
|
|
68029
|
-
buttonDefaultStyle,
|
|
68030
|
-
elementIds,
|
|
68031
|
-
sectionBlueStyle,
|
|
68032
|
-
sectionDefaultStyle
|
|
68033
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
68034
68023
|
function RestOfScreen(props) {
|
|
68035
68024
|
const [, setVersion] = useState(0);
|
|
68036
68025
|
const resizeObserver = useRef();
|
|
@@ -72019,23 +72008,23 @@ function VimContextMenu(props) {
|
|
|
72019
72008
|
const viewer = props.viewer;
|
|
72020
72009
|
const camera2 = props.camera;
|
|
72021
72010
|
const [section, setSection] = useState({
|
|
72022
|
-
visible: viewer.gizmos.
|
|
72023
|
-
clip: viewer.gizmos.
|
|
72011
|
+
visible: viewer.gizmos.sectionBox.visible,
|
|
72012
|
+
clip: viewer.gizmos.sectionBox.clip
|
|
72024
72013
|
});
|
|
72025
72014
|
const isClipping = () => {
|
|
72026
|
-
return !viewer.gizmos.
|
|
72015
|
+
return !viewer.gizmos.sectionBox.box.containsBox(viewer.renderer.getBoundingBox());
|
|
72027
72016
|
};
|
|
72028
72017
|
const [clipping, setClipping] = useState(isClipping());
|
|
72029
72018
|
const [, setVersion] = useState(0);
|
|
72030
72019
|
const hidden2 = props.isolation.isActive();
|
|
72031
72020
|
useEffect(() => {
|
|
72032
|
-
const subState = viewer.gizmos.
|
|
72021
|
+
const subState = viewer.gizmos.sectionBox.onStateChanged.subscribe(() => {
|
|
72033
72022
|
setSection({
|
|
72034
|
-
visible: viewer.gizmos.
|
|
72035
|
-
clip: viewer.gizmos.
|
|
72023
|
+
visible: viewer.gizmos.sectionBox.visible,
|
|
72024
|
+
clip: viewer.gizmos.sectionBox.clip
|
|
72036
72025
|
});
|
|
72037
72026
|
});
|
|
72038
|
-
const subConfirm = viewer.gizmos.
|
|
72027
|
+
const subConfirm = viewer.gizmos.sectionBox.onBoxConfirm.subscribe(
|
|
72039
72028
|
() => setClipping(isClipping())
|
|
72040
72029
|
);
|
|
72041
72030
|
props.isolation.onChanged.subscribe(() => setVersion((v) => v + 1));
|
|
@@ -72087,10 +72076,10 @@ function VimContextMenu(props) {
|
|
|
72087
72076
|
e.stopPropagation();
|
|
72088
72077
|
};
|
|
72089
72078
|
const onSectionToggleBtn = (e) => {
|
|
72090
|
-
viewer.gizmos.
|
|
72079
|
+
viewer.gizmos.sectionBox.clip = !viewer.gizmos.sectionBox.clip;
|
|
72091
72080
|
};
|
|
72092
72081
|
const onSectionResetBtn = (e) => {
|
|
72093
|
-
viewer.gizmos.
|
|
72082
|
+
viewer.gizmos.sectionBox.fitBox(viewer.renderer.getBoundingBox());
|
|
72094
72083
|
e.stopPropagation();
|
|
72095
72084
|
};
|
|
72096
72085
|
const onMeasureDeleteBtn = (e) => {
|
|
@@ -72099,7 +72088,7 @@ function VimContextMenu(props) {
|
|
|
72099
72088
|
const onFitSectionToSelectionBtn = (e) => {
|
|
72100
72089
|
const box = viewer.selection.getBoundingBox();
|
|
72101
72090
|
if (box) {
|
|
72102
|
-
viewer.gizmos.
|
|
72091
|
+
viewer.gizmos.sectionBox.fitBox(box);
|
|
72103
72092
|
}
|
|
72104
72093
|
};
|
|
72105
72094
|
const createButton2 = (button) => {
|
|
@@ -75057,7 +75046,7 @@ class ComponentCamera {
|
|
|
75057
75046
|
frameSelection(duration = 1) {
|
|
75058
75047
|
if (this._viewer.selection.count === 0) return;
|
|
75059
75048
|
const box = this._viewer.selection.getBoundingBox();
|
|
75060
|
-
if (box && this._viewer.gizmos.
|
|
75049
|
+
if (box && this._viewer.gizmos.sectionBox.box.intersectsBox(box)) {
|
|
75061
75050
|
const movement = duration === 0 ? this._viewer.camera.snap() : this._viewer.camera.lerp(duration);
|
|
75062
75051
|
movement.frame(box);
|
|
75063
75052
|
}
|
|
@@ -75706,6 +75695,254 @@ function setComponentBehind(value) {
|
|
|
75706
75695
|
component.classList.remove("behind");
|
|
75707
75696
|
}
|
|
75708
75697
|
}
|
|
75698
|
+
function SectionBoxPanel(props) {
|
|
75699
|
+
const [panelPosition, setPanelPosition] = useState({
|
|
75700
|
+
top: 0,
|
|
75701
|
+
left: 0
|
|
75702
|
+
});
|
|
75703
|
+
const panelRef = useRef(null);
|
|
75704
|
+
useLayoutEffect(() => {
|
|
75705
|
+
const updatePosition = () => {
|
|
75706
|
+
const { top, left } = computePosition(panelRef);
|
|
75707
|
+
setPanelPosition({ top, left });
|
|
75708
|
+
};
|
|
75709
|
+
updatePosition();
|
|
75710
|
+
let resizeObserver = null;
|
|
75711
|
+
if (panelRef.current) {
|
|
75712
|
+
resizeObserver = new ResizeObserver(updatePosition);
|
|
75713
|
+
resizeObserver.observe(panelRef.current.parentElement);
|
|
75714
|
+
}
|
|
75715
|
+
return () => {
|
|
75716
|
+
if (resizeObserver) {
|
|
75717
|
+
resizeObserver.disconnect();
|
|
75718
|
+
}
|
|
75719
|
+
};
|
|
75720
|
+
}, [props.state.showOffsetPanel.get()]);
|
|
75721
|
+
if (!props.state.showOffsetPanel.get()) return null;
|
|
75722
|
+
const renderField = (id2, label, field) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "vim-sectionbox-offsets-entry vc-text-xs vc-flex vc-items-center vc-justify-center vc-justify-between vc-my-2", children: [
|
|
75723
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("dt", { className: "vc-w-1/2 vc-inline", children: label }),
|
|
75724
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("dd", { className: "vc-w-1/3 vc-inline", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
75725
|
+
"input",
|
|
75726
|
+
{
|
|
75727
|
+
id: id2,
|
|
75728
|
+
type: "text",
|
|
75729
|
+
value: field.get(),
|
|
75730
|
+
onChange: (e) => field.set(e.target.value),
|
|
75731
|
+
className: "vc-border vc-inline vc-border-gray-300 vc-py-1 vc-w-full vc-px-1",
|
|
75732
|
+
onBlur: () => field.confirm()
|
|
75733
|
+
}
|
|
75734
|
+
) })
|
|
75735
|
+
] });
|
|
75736
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
75737
|
+
"div",
|
|
75738
|
+
{
|
|
75739
|
+
className: "vc-fixed vc-inset-0 vc-flex vc-pointer-events-none",
|
|
75740
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
75741
|
+
"div",
|
|
75742
|
+
{
|
|
75743
|
+
ref: panelRef,
|
|
75744
|
+
style: { position: "absolute", top: panelPosition.top, left: panelPosition.left, width: "min(200px, 60%)" },
|
|
75745
|
+
className: "vim-sectionbox-offsets vc-pointer-events-auto vc-bg-white vc-relative",
|
|
75746
|
+
onClick: (e) => e.stopPropagation(),
|
|
75747
|
+
children: [
|
|
75748
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "vim-sectionbox-header vc-px-2 vc-bg-gray-light vc-flex vc-items-center vc-justify-between ", children: [
|
|
75749
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "vc-flex vim-sectionbox-offsets-title vc-title vc-block", children: "Section Box Offsets" }),
|
|
75750
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
75751
|
+
"button",
|
|
75752
|
+
{
|
|
75753
|
+
className: "vc-flex vc-border-none vc-bg-transparent vc-text-sm vc-cursor-pointer",
|
|
75754
|
+
onClick: () => props.state.showOffsetPanel.set(false),
|
|
75755
|
+
children: close({ height: 12, width: 12, fill: "currentColor" })
|
|
75756
|
+
}
|
|
75757
|
+
)
|
|
75758
|
+
] }),
|
|
75759
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("dl", { className: "vc-text-xl vc-text-gray-darker vc-mb-2 vc-mx-2 ", children: [
|
|
75760
|
+
renderField("topOffset", "Top Offset", props.state.topOffset),
|
|
75761
|
+
renderField("sideOffseet", "Side Offset", props.state.sideOffset),
|
|
75762
|
+
renderField("bottomOffset", "Bottom Offset", props.state.bottomOffset)
|
|
75763
|
+
] })
|
|
75764
|
+
]
|
|
75765
|
+
}
|
|
75766
|
+
)
|
|
75767
|
+
}
|
|
75768
|
+
);
|
|
75769
|
+
}
|
|
75770
|
+
function computePosition(panelRef) {
|
|
75771
|
+
const origin = document.getElementById("vim-control-bar");
|
|
75772
|
+
if (origin && panelRef.current) {
|
|
75773
|
+
const originRect = origin.getBoundingClientRect();
|
|
75774
|
+
const panelRect = panelRef.current.getBoundingClientRect();
|
|
75775
|
+
let left = originRect.left + originRect.width / 2 - panelRect.width / 2;
|
|
75776
|
+
let top = originRect.top - 10 - panelRect.height;
|
|
75777
|
+
if (top < 10) {
|
|
75778
|
+
top = originRect.bottom + 10;
|
|
75779
|
+
}
|
|
75780
|
+
if (left < 10) {
|
|
75781
|
+
left = 10;
|
|
75782
|
+
}
|
|
75783
|
+
if (left + panelRect.width > window.innerWidth - 10) {
|
|
75784
|
+
left = window.innerWidth - panelRect.width - 10;
|
|
75785
|
+
}
|
|
75786
|
+
return { top, left };
|
|
75787
|
+
}
|
|
75788
|
+
return { top: 0, left: 0 };
|
|
75789
|
+
}
|
|
75790
|
+
function addBox(b1, b2) {
|
|
75791
|
+
const r = b1.clone();
|
|
75792
|
+
r.min.x += b2.min.x;
|
|
75793
|
+
r.min.y += b2.min.y;
|
|
75794
|
+
r.min.z += b2.min.z;
|
|
75795
|
+
r.max.x += b2.max.x;
|
|
75796
|
+
r.max.y += b2.max.y;
|
|
75797
|
+
r.max.z += b2.max.z;
|
|
75798
|
+
return r;
|
|
75799
|
+
}
|
|
75800
|
+
function useStateRef(initialValue) {
|
|
75801
|
+
const [value, setValue] = useState(initialValue);
|
|
75802
|
+
const ref = useRef(initialValue);
|
|
75803
|
+
const event = useRef(new distExports.SimpleEventDispatcher());
|
|
75804
|
+
const validate = useRef((value2) => value2);
|
|
75805
|
+
const confirm = useRef((value2) => value2);
|
|
75806
|
+
const set3 = (value2) => {
|
|
75807
|
+
const finalValue = validate.current(value2) ?? value2;
|
|
75808
|
+
if (finalValue === void 0) return;
|
|
75809
|
+
if (finalValue === ref.current) return;
|
|
75810
|
+
ref.current = finalValue;
|
|
75811
|
+
setValue(finalValue);
|
|
75812
|
+
event.current.dispatch(finalValue);
|
|
75813
|
+
};
|
|
75814
|
+
return {
|
|
75815
|
+
get() {
|
|
75816
|
+
return ref.current;
|
|
75817
|
+
},
|
|
75818
|
+
set: set3,
|
|
75819
|
+
confirm() {
|
|
75820
|
+
set3(confirm.current(ref.current));
|
|
75821
|
+
},
|
|
75822
|
+
useRegister(on) {
|
|
75823
|
+
useEffect(() => {
|
|
75824
|
+
return event.current.subscribe(on);
|
|
75825
|
+
}, []);
|
|
75826
|
+
},
|
|
75827
|
+
useMemo(on, deps) {
|
|
75828
|
+
return useMemo(() => on(value), [...deps || [], value]);
|
|
75829
|
+
},
|
|
75830
|
+
useValidate(on) {
|
|
75831
|
+
useEffect(() => {
|
|
75832
|
+
validate.current = on;
|
|
75833
|
+
}, []);
|
|
75834
|
+
},
|
|
75835
|
+
useConfirm(on) {
|
|
75836
|
+
useEffect(() => {
|
|
75837
|
+
confirm.current = on;
|
|
75838
|
+
}, []);
|
|
75839
|
+
}
|
|
75840
|
+
};
|
|
75841
|
+
}
|
|
75842
|
+
function useSectionBox(adapter) {
|
|
75843
|
+
const enable = useStateRef(false);
|
|
75844
|
+
const visible2 = useStateRef(false);
|
|
75845
|
+
const showOffsetPanel = useStateRef(false);
|
|
75846
|
+
const auto = useStateRef(false);
|
|
75847
|
+
const topOffset = useStateRef("1");
|
|
75848
|
+
const sideOffset = useStateRef("1");
|
|
75849
|
+
const bottomOffset = useStateRef("1");
|
|
75850
|
+
const boxRef = useRef(adapter.getBox());
|
|
75851
|
+
enable.useRegister((v) => {
|
|
75852
|
+
visible2.set(v);
|
|
75853
|
+
auto.set(false);
|
|
75854
|
+
showOffsetPanel.set(false);
|
|
75855
|
+
topOffset.set("1");
|
|
75856
|
+
sideOffset.set("1");
|
|
75857
|
+
bottomOffset.set("1");
|
|
75858
|
+
void sectionReset();
|
|
75859
|
+
});
|
|
75860
|
+
topOffset.useValidate((v) => sanitize(v, false));
|
|
75861
|
+
sideOffset.useValidate((v) => sanitize(v, false));
|
|
75862
|
+
bottomOffset.useValidate((v) => sanitize(v, false));
|
|
75863
|
+
topOffset.useConfirm((v) => sanitize(v, true));
|
|
75864
|
+
sideOffset.useConfirm((v) => sanitize(v, true));
|
|
75865
|
+
bottomOffset.useConfirm((v) => sanitize(v, true));
|
|
75866
|
+
const offsetBox = useMemo(
|
|
75867
|
+
() => offsetsToBox3(topOffset.get(), sideOffset.get(), bottomOffset.get()),
|
|
75868
|
+
[topOffset.get(), sideOffset.get(), bottomOffset.get()]
|
|
75869
|
+
);
|
|
75870
|
+
useEffect(() => section(boxRef.current), [offsetBox]);
|
|
75871
|
+
auto.useRegister((v) => {
|
|
75872
|
+
if (v) sectionSelection();
|
|
75873
|
+
});
|
|
75874
|
+
useEffect(() => {
|
|
75875
|
+
return adapter.onSelectionChanged.sub(() => {
|
|
75876
|
+
if (auto.get()) sectionSelection();
|
|
75877
|
+
});
|
|
75878
|
+
}, []);
|
|
75879
|
+
visible2.useRegister((v) => adapter.setVisible(v));
|
|
75880
|
+
const section = (baseBox) => {
|
|
75881
|
+
boxRef.current = baseBox;
|
|
75882
|
+
const newBox = addBox(baseBox, offsetBox);
|
|
75883
|
+
adapter.fitBox(newBox);
|
|
75884
|
+
};
|
|
75885
|
+
const sectionSelection = async () => {
|
|
75886
|
+
try {
|
|
75887
|
+
const box = await adapter.getSelectionBox() ?? await adapter.getRendererBox();
|
|
75888
|
+
section(box);
|
|
75889
|
+
} catch (e) {
|
|
75890
|
+
console.error(e);
|
|
75891
|
+
}
|
|
75892
|
+
};
|
|
75893
|
+
const sectionReset = async () => {
|
|
75894
|
+
const box = await adapter.getRendererBox();
|
|
75895
|
+
section(box);
|
|
75896
|
+
};
|
|
75897
|
+
return {
|
|
75898
|
+
enable,
|
|
75899
|
+
visible: visible2,
|
|
75900
|
+
auto,
|
|
75901
|
+
showOffsetPanel,
|
|
75902
|
+
topOffset,
|
|
75903
|
+
sideOffset,
|
|
75904
|
+
bottomOffset,
|
|
75905
|
+
sectionSelection,
|
|
75906
|
+
sectionReset,
|
|
75907
|
+
section
|
|
75908
|
+
};
|
|
75909
|
+
}
|
|
75910
|
+
const sanitize = (value, strict) => {
|
|
75911
|
+
if (!strict) {
|
|
75912
|
+
if (value === "" || value === "-") return value;
|
|
75913
|
+
}
|
|
75914
|
+
const num = parseFloat(value);
|
|
75915
|
+
if (isNaN(num)) {
|
|
75916
|
+
return strict ? "1" : void 0;
|
|
75917
|
+
}
|
|
75918
|
+
return String(num);
|
|
75919
|
+
};
|
|
75920
|
+
function offsetsToBox3(top, side, bottom) {
|
|
75921
|
+
const getNumber = (s) => {
|
|
75922
|
+
const num = parseFloat(s);
|
|
75923
|
+
return isNaN(num) ? 0 : num;
|
|
75924
|
+
};
|
|
75925
|
+
return new Box3(
|
|
75926
|
+
new Vector3(-getNumber(side), -getNumber(side), -getNumber(bottom)),
|
|
75927
|
+
new Vector3(getNumber(side), getNumber(side), getNumber(top))
|
|
75928
|
+
);
|
|
75929
|
+
}
|
|
75930
|
+
function useWebglSectionBox(viewer) {
|
|
75931
|
+
const vimAdapter = {
|
|
75932
|
+
setVisible: (b) => {
|
|
75933
|
+
viewer.gizmos.sectionBox.visible = b;
|
|
75934
|
+
viewer.gizmos.sectionBox.interactive = b;
|
|
75935
|
+
},
|
|
75936
|
+
getBox: () => viewer.gizmos.sectionBox.box.clone(),
|
|
75937
|
+
fitBox: (box) => viewer.gizmos.sectionBox.fitBox(box),
|
|
75938
|
+
getSelectionBox: () => Promise.resolve(viewer.selection.getBoundingBox()),
|
|
75939
|
+
getRendererBox: () => Promise.resolve(viewer.renderer.getBoundingBox()),
|
|
75940
|
+
onSceneChanged: viewer.renderer.onBoxUpdated,
|
|
75941
|
+
onSelectionChanged: viewer.selection.onValueChanged
|
|
75942
|
+
};
|
|
75943
|
+
viewer.gizmos.sectionBox.clip = true;
|
|
75944
|
+
return useSectionBox(vimAdapter);
|
|
75945
|
+
}
|
|
75709
75946
|
function createWebglComponent(container, componentSettings = {}, viewerSettings = {}) {
|
|
75710
75947
|
const promise2 = new DeferredPromise2();
|
|
75711
75948
|
const cmpContainer = container instanceof HTMLElement ? createContainer(container) : container ?? createContainer();
|
|
@@ -75747,11 +75984,13 @@ function VimComponent(props) {
|
|
|
75747
75984
|
Math.min(props.container.root.clientWidth * 0.25, 340)
|
|
75748
75985
|
);
|
|
75749
75986
|
const [contextMenu2, setcontextMenu] = useState();
|
|
75750
|
-
const [
|
|
75987
|
+
const [controlBarCustom, setControlBarCustom] = useState();
|
|
75751
75988
|
const bimInfoRef = useBimInfo();
|
|
75752
75989
|
const viewerState = useViewerState(props.viewer);
|
|
75753
75990
|
const treeRef = useRef();
|
|
75754
75991
|
const performanceRef = useRef(null);
|
|
75992
|
+
const sectionBox2 = useWebglSectionBox(props.viewer);
|
|
75993
|
+
const controlBar2 = useControlBar(props.viewer, camera2, modal, side, isolation, cursor, settings2.value, sectionBox2, controlBarCustom);
|
|
75755
75994
|
useEffect(() => {
|
|
75756
75995
|
var _a3;
|
|
75757
75996
|
side.setHasBim(((_a3 = viewerState.vim) == null ? void 0 : _a3.bim) !== void 0);
|
|
@@ -75776,11 +76015,14 @@ function VimComponent(props) {
|
|
|
75776
76015
|
isolation,
|
|
75777
76016
|
camera: camera2,
|
|
75778
76017
|
settings: settings2,
|
|
76018
|
+
get sectionBox() {
|
|
76019
|
+
return sectionBox2;
|
|
76020
|
+
},
|
|
75779
76021
|
contextMenu: {
|
|
75780
76022
|
customize: (v) => setcontextMenu(() => v)
|
|
75781
76023
|
},
|
|
75782
76024
|
controlBar: {
|
|
75783
|
-
customize: (v) =>
|
|
76025
|
+
customize: (v) => setControlBarCustom(() => v)
|
|
75784
76026
|
},
|
|
75785
76027
|
modal,
|
|
75786
76028
|
bimInfo: bimInfoRef,
|
|
@@ -75834,16 +76076,11 @@ function VimComponent(props) {
|
|
|
75834
76076
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
75835
76077
|
ControlBar,
|
|
75836
76078
|
{
|
|
75837
|
-
|
|
75838
|
-
|
|
75839
|
-
modal,
|
|
75840
|
-
side,
|
|
75841
|
-
isolation,
|
|
75842
|
-
cursor,
|
|
75843
|
-
settings: settings2.value,
|
|
75844
|
-
customization: controlBar2
|
|
76079
|
+
content: controlBar2,
|
|
76080
|
+
show: isTrue(settings2.value.ui.controlBar)
|
|
75845
76081
|
}
|
|
75846
76082
|
),
|
|
76083
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SectionBoxPanel, { state: sectionBox2 }),
|
|
75847
76084
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
75848
76085
|
AxesPanelMemo,
|
|
75849
76086
|
{
|
|
@@ -76169,12 +76406,53 @@ function getRequestErrorMessage(source, error) {
|
|
|
76169
76406
|
return serverConnectionError(source.url);
|
|
76170
76407
|
}
|
|
76171
76408
|
}
|
|
76409
|
+
function updateModal(modal, state) {
|
|
76410
|
+
if (state.status === "connected") {
|
|
76411
|
+
modal.loading(void 0);
|
|
76412
|
+
modal.message(void 0);
|
|
76413
|
+
}
|
|
76414
|
+
if (state.status === "connecting") {
|
|
76415
|
+
if (modal.current === void 0 || modal.current.type === "loading") {
|
|
76416
|
+
modal.loading({ message: "Connecting to VIM Ultra server..." });
|
|
76417
|
+
}
|
|
76418
|
+
}
|
|
76419
|
+
if (state.status === "error") {
|
|
76420
|
+
console.log("Error loading vim", state);
|
|
76421
|
+
modal.message(getErrorMessage(state));
|
|
76422
|
+
}
|
|
76423
|
+
}
|
|
76424
|
+
async function updateProgress(request2, modal) {
|
|
76425
|
+
for await (const progress of request2.getProgress()) {
|
|
76426
|
+
if (request2.isCompleted) break;
|
|
76427
|
+
modal.loading({ message: "Loading File in VIM Ultra mode", progress });
|
|
76428
|
+
}
|
|
76429
|
+
}
|
|
76430
|
+
function useUltraSectionBox(viewer) {
|
|
76431
|
+
const ultraAdapter = {
|
|
76432
|
+
setVisible: (b) => {
|
|
76433
|
+
viewer.sectionBox.visible = b;
|
|
76434
|
+
viewer.sectionBox.interactive = b;
|
|
76435
|
+
},
|
|
76436
|
+
getBox: () => viewer.sectionBox.getBox().clone(),
|
|
76437
|
+
fitBox: (box) => viewer.sectionBox.fitBox(box),
|
|
76438
|
+
getSelectionBox: () => viewer.selection.getBoundingBox(),
|
|
76439
|
+
getRendererBox: () => viewer.renderer.getBoundingBox(),
|
|
76440
|
+
onSelectionChanged: viewer.selection.onValueChanged,
|
|
76441
|
+
onSceneChanged: viewer.vims.onChanged
|
|
76442
|
+
};
|
|
76443
|
+
return useSectionBox(ultraAdapter);
|
|
76444
|
+
}
|
|
76445
|
+
function useUltraControlBar(viewer, section, customization) {
|
|
76446
|
+
let controlBar2 = [controlBarSectionBox(section, viewer.selection.count > 0)];
|
|
76447
|
+
controlBar2 = (customization == null ? void 0 : customization(controlBar2)) ?? controlBar2;
|
|
76448
|
+
return controlBar2;
|
|
76449
|
+
}
|
|
76172
76450
|
function createUltraComponent(container) {
|
|
76173
76451
|
const promise2 = new DeferredPromise2();
|
|
76174
76452
|
const cmpContainer = container instanceof HTMLElement ? createContainer(container) : container ?? createContainer();
|
|
76175
76453
|
const viewer = Viewer2.createWithCanvas(cmpContainer.gfx);
|
|
76176
76454
|
const reactRoot = clientExports.createRoot(cmpContainer.ui);
|
|
76177
|
-
const
|
|
76455
|
+
const attachDispose = (cmp) => {
|
|
76178
76456
|
cmp.dispose = () => {
|
|
76179
76457
|
viewer.dispose();
|
|
76180
76458
|
cmpContainer.dispose();
|
|
@@ -76188,7 +76466,7 @@ function createUltraComponent(container) {
|
|
|
76188
76466
|
{
|
|
76189
76467
|
container: cmpContainer,
|
|
76190
76468
|
viewer,
|
|
76191
|
-
onMount: (cmp) => promise2.resolve(
|
|
76469
|
+
onMount: (cmp) => promise2.resolve(attachDispose(cmp))
|
|
76192
76470
|
}
|
|
76193
76471
|
)
|
|
76194
76472
|
);
|
|
@@ -76196,31 +76474,36 @@ function createUltraComponent(container) {
|
|
|
76196
76474
|
}
|
|
76197
76475
|
function UltraComponent(props) {
|
|
76198
76476
|
const modal = useModal(true);
|
|
76477
|
+
const sectionBox2 = useUltraSectionBox(props.viewer);
|
|
76478
|
+
const controlBar2 = useUltraControlBar(props.viewer, sectionBox2, (_2) => _2);
|
|
76479
|
+
const side = useSideState(true, 400);
|
|
76480
|
+
const [_, setSelectState] = useState(0);
|
|
76199
76481
|
useEffect(() => {
|
|
76200
76482
|
props.viewer.onStateChanged.subscribe((state) => updateModal(modal, state));
|
|
76201
|
-
props.
|
|
76483
|
+
props.viewer.selection.onValueChanged.subscribe(() => {
|
|
76484
|
+
setSelectState((i) => (i + 1) % 2);
|
|
76485
|
+
});
|
|
76486
|
+
props.onMount(createComponentRef(props.viewer, modal, sectionBox2));
|
|
76202
76487
|
}, []);
|
|
76203
76488
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
76204
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
76489
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(RestOfScreen, { side, content: () => {
|
|
76490
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
76491
|
+
whenTrue(true, /* @__PURE__ */ jsxRuntimeExports.jsx(LogoMemo, {})),
|
|
76492
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Overlay, { canvas: props.viewer.viewport.canvas }),
|
|
76493
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
76494
|
+
ControlBar,
|
|
76495
|
+
{
|
|
76496
|
+
content: controlBar2,
|
|
76497
|
+
show: true
|
|
76498
|
+
}
|
|
76499
|
+
),
|
|
76500
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SectionBoxPanel, { state: sectionBox2 })
|
|
76501
|
+
] });
|
|
76502
|
+
} }),
|
|
76205
76503
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Modal, { state: modal })
|
|
76206
76504
|
] });
|
|
76207
76505
|
}
|
|
76208
|
-
function
|
|
76209
|
-
if (state.status === "connected") {
|
|
76210
|
-
modal.loading(void 0);
|
|
76211
|
-
modal.message(void 0);
|
|
76212
|
-
}
|
|
76213
|
-
if (state.status === "connecting") {
|
|
76214
|
-
if (modal.current === void 0 || modal.current.type === "loading") {
|
|
76215
|
-
modal.loading({ message: "Connecting to VIM Ultra server..." });
|
|
76216
|
-
}
|
|
76217
|
-
}
|
|
76218
|
-
if (state.status === "error") {
|
|
76219
|
-
console.log("Error loading vim", state);
|
|
76220
|
-
modal.message(getErrorMessage(state));
|
|
76221
|
-
}
|
|
76222
|
-
}
|
|
76223
|
-
function ToRef(viewer, modal) {
|
|
76506
|
+
function createComponentRef(viewer, modal, sectionBox2) {
|
|
76224
76507
|
function load(source) {
|
|
76225
76508
|
const request2 = viewer.loadVim(source);
|
|
76226
76509
|
void updateProgress(request2, modal);
|
|
@@ -76240,17 +76523,12 @@ function ToRef(viewer, modal) {
|
|
|
76240
76523
|
return {
|
|
76241
76524
|
viewer,
|
|
76242
76525
|
modal,
|
|
76526
|
+
sectionBox: sectionBox2,
|
|
76243
76527
|
dispose: () => {
|
|
76244
76528
|
},
|
|
76245
76529
|
load
|
|
76246
76530
|
};
|
|
76247
76531
|
}
|
|
76248
|
-
async function updateProgress(request2, modal) {
|
|
76249
|
-
for await (const progress of request2.getProgress()) {
|
|
76250
|
-
if (request2.isCompleted) break;
|
|
76251
|
-
modal.loading({ message: "Loading File in VIM Ultra mode", progress });
|
|
76252
|
-
}
|
|
76253
|
-
}
|
|
76254
76532
|
const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
76255
76533
|
__proto__: null,
|
|
76256
76534
|
UltraComponent,
|