gl-draw 0.16.0-beta.6 → 0.16.0-beta.8
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/core/Lead/Lead.d.ts +2 -0
- package/dist/index.js +2 -2
- package/dist/index.module.js +131 -131
- package/dist/objects/extrudePolygon/ExtrudeGeometry.d.ts +1 -22
- package/dist/objects/index.js +1 -1
- package/dist/objects/index.module.js +28 -28
- package/dist/plugins/index.js +1 -1
- package/dist/plugins/index.module.js +21 -21
- package/package.json +8 -8
package/dist/index.module.js
CHANGED
|
@@ -121,21 +121,21 @@ function ce(h, e, t, s, i = 1 / 0, r) {
|
|
|
121
121
|
d = k(d, -p, p), e = h - d;
|
|
122
122
|
const v = (t.value + o * d) * r;
|
|
123
123
|
t.value = (t.value - o * v) * a;
|
|
124
|
-
let
|
|
125
|
-
return m - h > 0 ==
|
|
124
|
+
let g = e + (d + v) * a;
|
|
125
|
+
return m - h > 0 == g > m && (g = m, t.value = (g - m) / r), g;
|
|
126
126
|
}
|
|
127
127
|
function Be(h, e, t, s, i = 1 / 0, r, o) {
|
|
128
128
|
s = Math.max(1e-4, s);
|
|
129
129
|
const n = 2 / s, a = n * r, d = 1 / (1 + a + 0.48 * a * a + 0.235 * a * a * a);
|
|
130
|
-
let m = e.x, p = e.y, v = e.z,
|
|
131
|
-
const y = m, l = p, _ = v, O = i * s, C = O * O, w =
|
|
130
|
+
let m = e.x, p = e.y, v = e.z, g = h.x - m, u = h.y - p, f = h.z - v;
|
|
131
|
+
const y = m, l = p, _ = v, O = i * s, C = O * O, w = g * g + u * u + f * f;
|
|
132
132
|
if (w > C) {
|
|
133
133
|
const ve = Math.sqrt(w);
|
|
134
|
-
|
|
134
|
+
g = g / ve * O, u = u / ve * O, f = f / ve * O;
|
|
135
135
|
}
|
|
136
|
-
m = h.x -
|
|
137
|
-
const E = (t.x + n *
|
|
138
|
-
t.x = (t.x - n * E) * d, t.y = (t.y - n * x) * d, t.z = (t.z - n * R) * d, o.x = m + (
|
|
136
|
+
m = h.x - g, p = h.y - u, v = h.z - f;
|
|
137
|
+
const E = (t.x + n * g) * r, x = (t.y + n * u) * r, R = (t.z + n * f) * r;
|
|
138
|
+
t.x = (t.x - n * E) * d, t.y = (t.y - n * x) * d, t.z = (t.z - n * R) * d, o.x = m + (g + E) * d, o.y = p + (u + x) * d, o.z = v + (f + R) * d;
|
|
139
139
|
const V = y - h.x, le = l - h.y, bt = _ - h.z, xt = o.x - y, Lt = o.y - l, Pt = o.z - _;
|
|
140
140
|
return V * xt + le * Lt + bt * Pt > 0 && (o.x = y, o.y = l, o.z = _, t.x = (o.x - y) / r, t.y = (o.y - l) / r, t.z = (o.z - _) / r), o;
|
|
141
141
|
}
|
|
@@ -354,7 +354,7 @@ class J extends ws {
|
|
|
354
354
|
}
|
|
355
355
|
else
|
|
356
356
|
(!this._isDragging && this._lockedPointer || this._isDragging && (l.buttons & M.LEFT) === M.LEFT) && (this._state = this._state | this.mouseButtons.left), this._isDragging && (l.buttons & M.MIDDLE) === M.MIDDLE && (this._state = this._state | this.mouseButtons.middle), this._isDragging && (l.buttons & M.RIGHT) === M.RIGHT && (this._state = this._state | this.mouseButtons.right);
|
|
357
|
-
|
|
357
|
+
g();
|
|
358
358
|
}
|
|
359
359
|
}, a = (l) => {
|
|
360
360
|
const _ = this._findPointerById(l.pointerId);
|
|
@@ -376,7 +376,7 @@ class J extends ws {
|
|
|
376
376
|
}
|
|
377
377
|
else
|
|
378
378
|
this._state = c.NONE;
|
|
379
|
-
|
|
379
|
+
u();
|
|
380
380
|
}
|
|
381
381
|
};
|
|
382
382
|
let d = -1;
|
|
@@ -460,7 +460,7 @@ class J extends ws {
|
|
|
460
460
|
else
|
|
461
461
|
!this._lockedPointer && (l.buttons & M.LEFT) === M.LEFT && (this._state = this._state | this.mouseButtons.left), (l.buttons & M.MIDDLE) === M.MIDDLE && (this._state = this._state | this.mouseButtons.middle), (l.buttons & M.RIGHT) === M.RIGHT && (this._state = this._state | this.mouseButtons.right);
|
|
462
462
|
((this._state & c.ROTATE) === c.ROTATE || (this._state & c.TOUCH_ROTATE) === c.TOUCH_ROTATE || (this._state & c.TOUCH_DOLLY_ROTATE) === c.TOUCH_DOLLY_ROTATE || (this._state & c.TOUCH_ZOOM_ROTATE) === c.TOUCH_ZOOM_ROTATE) && (this._sphericalEnd.theta = this._spherical.theta, this._sphericalEnd.phi = this._spherical.phi, this._thetaVelocity.value = 0, this._phiVelocity.value = 0), ((this._state & c.TRUCK) === c.TRUCK || (this._state & c.SCREEN_PAN) === c.SCREEN_PAN || (this._state & c.TOUCH_TRUCK) === c.TOUCH_TRUCK || (this._state & c.TOUCH_SCREEN_PAN) === c.TOUCH_SCREEN_PAN || (this._state & c.TOUCH_DOLLY_TRUCK) === c.TOUCH_DOLLY_TRUCK || (this._state & c.TOUCH_DOLLY_SCREEN_PAN) === c.TOUCH_DOLLY_SCREEN_PAN || (this._state & c.TOUCH_ZOOM_TRUCK) === c.TOUCH_ZOOM_TRUCK || (this._state & c.TOUCH_ZOOM_SCREEN_PAN) === c.TOUCH_DOLLY_SCREEN_PAN) && (this._targetEnd.copy(this._target), this._targetVelocity.set(0, 0, 0)), ((this._state & c.DOLLY) === c.DOLLY || (this._state & c.TOUCH_DOLLY) === c.TOUCH_DOLLY || (this._state & c.TOUCH_DOLLY_TRUCK) === c.TOUCH_DOLLY_TRUCK || (this._state & c.TOUCH_DOLLY_SCREEN_PAN) === c.TOUCH_DOLLY_SCREEN_PAN || (this._state & c.TOUCH_DOLLY_OFFSET) === c.TOUCH_DOLLY_OFFSET || (this._state & c.TOUCH_DOLLY_ROTATE) === c.TOUCH_DOLLY_ROTATE) && (this._sphericalEnd.radius = this._spherical.radius, this._radiusVelocity.value = 0), ((this._state & c.ZOOM) === c.ZOOM || (this._state & c.TOUCH_ZOOM) === c.TOUCH_ZOOM || (this._state & c.TOUCH_ZOOM_TRUCK) === c.TOUCH_ZOOM_TRUCK || (this._state & c.TOUCH_ZOOM_SCREEN_PAN) === c.TOUCH_ZOOM_SCREEN_PAN || (this._state & c.TOUCH_ZOOM_OFFSET) === c.TOUCH_ZOOM_OFFSET || (this._state & c.TOUCH_ZOOM_ROTATE) === c.TOUCH_ZOOM_ROTATE) && (this._zoomEnd = this._zoom, this._zoomVelocity.value = 0), ((this._state & c.OFFSET) === c.OFFSET || (this._state & c.TOUCH_OFFSET) === c.TOUCH_OFFSET || (this._state & c.TOUCH_DOLLY_OFFSET) === c.TOUCH_DOLLY_OFFSET || (this._state & c.TOUCH_ZOOM_OFFSET) === c.TOUCH_ZOOM_OFFSET) && (this._focalOffsetEnd.copy(this._focalOffset), this._focalOffsetVelocity.set(0, 0, 0)), this.dispatchEvent({ type: "controlstart" });
|
|
463
|
-
},
|
|
463
|
+
}, g = () => {
|
|
464
464
|
if (!this._enabled || !this._dragNeedsUpdate) return;
|
|
465
465
|
this._dragNeedsUpdate = !1, Ee(this._activePointers, D);
|
|
466
466
|
const _ = this._domElement && this._domElement.ownerDocument.pointerLockElement === this._domElement ? this._lockedPointer || this._activePointers[0] : null, O = _ ? -_.deltaX : i.x - D.x, C = _ ? -_.deltaY : i.y - D.y;
|
|
@@ -483,7 +483,7 @@ class J extends ws {
|
|
|
483
483
|
(this._state & c.TOUCH_DOLLY) === c.TOUCH_DOLLY || (this._state & c.TOUCH_DOLLY_ROTATE) === c.TOUCH_DOLLY_ROTATE || (this._state & c.TOUCH_DOLLY_TRUCK) === c.TOUCH_DOLLY_TRUCK || (this._state & c.TOUCH_DOLLY_SCREEN_PAN) === c.TOUCH_DOLLY_SCREEN_PAN || (this._state & c.TOUCH_DOLLY_OFFSET) === c.TOUCH_DOLLY_OFFSET ? (this._dollyInternal(R * de, V, le), this._isUserControllingDolly = !0) : (this._zoomInternal(R * de, V, le), this._isUserControllingZoom = !0);
|
|
484
484
|
}
|
|
485
485
|
((this._state & c.TRUCK) === c.TRUCK || (this._state & c.TOUCH_TRUCK) === c.TOUCH_TRUCK || (this._state & c.TOUCH_DOLLY_TRUCK) === c.TOUCH_DOLLY_TRUCK || (this._state & c.TOUCH_ZOOM_TRUCK) === c.TOUCH_ZOOM_TRUCK) && (this._truckInternal(O, C, !1, !1), this._isUserControllingTruck = !0), ((this._state & c.SCREEN_PAN) === c.SCREEN_PAN || (this._state & c.TOUCH_SCREEN_PAN) === c.TOUCH_SCREEN_PAN || (this._state & c.TOUCH_DOLLY_SCREEN_PAN) === c.TOUCH_DOLLY_SCREEN_PAN || (this._state & c.TOUCH_ZOOM_SCREEN_PAN) === c.TOUCH_ZOOM_SCREEN_PAN) && (this._truckInternal(O, C, !1, !0), this._isUserControllingTruck = !0), ((this._state & c.OFFSET) === c.OFFSET || (this._state & c.TOUCH_OFFSET) === c.TOUCH_OFFSET || (this._state & c.TOUCH_DOLLY_OFFSET) === c.TOUCH_DOLLY_OFFSET || (this._state & c.TOUCH_ZOOM_OFFSET) === c.TOUCH_ZOOM_OFFSET) && (this._truckInternal(O, C, !0, !1), this._isUserControllingOffset = !0), this.dispatchEvent({ type: "control" });
|
|
486
|
-
},
|
|
486
|
+
}, u = () => {
|
|
487
487
|
Ee(this._activePointers, D), i.copy(D), this._dragNeedsUpdate = !1, (this._activePointers.length === 0 || this._activePointers.length === 1 && this._activePointers[0] === this._lockedPointer) && (this._isDragging = !1), this._activePointers.length === 0 && this._domElement && (this._domElement.ownerDocument.removeEventListener(
|
|
488
488
|
"pointermove",
|
|
489
489
|
n,
|
|
@@ -510,7 +510,7 @@ class J extends ws {
|
|
|
510
510
|
a
|
|
511
511
|
), this._domElement.requestPointerLock(), this._domElement.ownerDocument.addEventListener(
|
|
512
512
|
"pointerlockchange",
|
|
513
|
-
|
|
513
|
+
f
|
|
514
514
|
), this._domElement.ownerDocument.addEventListener(
|
|
515
515
|
"pointerlockerror",
|
|
516
516
|
y
|
|
@@ -523,13 +523,13 @@ class J extends ws {
|
|
|
523
523
|
var l, _, O;
|
|
524
524
|
this._lockedPointer !== null && (this._disposePointer(this._lockedPointer), this._lockedPointer = null), (l = this._domElement) === null || l === void 0 || l.ownerDocument.exitPointerLock(), (_ = this._domElement) === null || _ === void 0 || _.ownerDocument.removeEventListener(
|
|
525
525
|
"pointerlockchange",
|
|
526
|
-
|
|
526
|
+
f
|
|
527
527
|
), (O = this._domElement) === null || O === void 0 || O.ownerDocument.removeEventListener(
|
|
528
528
|
"pointerlockerror",
|
|
529
529
|
y
|
|
530
530
|
), this.cancel();
|
|
531
531
|
};
|
|
532
|
-
const
|
|
532
|
+
const f = () => {
|
|
533
533
|
this._domElement && this._domElement.ownerDocument.pointerLockElement === this._domElement || this.unlockPointer();
|
|
534
534
|
}, y = () => {
|
|
535
535
|
this.unlockPointer();
|
|
@@ -550,13 +550,13 @@ class J extends ws {
|
|
|
550
550
|
a
|
|
551
551
|
), this._domElement.ownerDocument.removeEventListener(
|
|
552
552
|
"pointerlockchange",
|
|
553
|
-
|
|
553
|
+
f
|
|
554
554
|
), this._domElement.ownerDocument.removeEventListener(
|
|
555
555
|
"pointerlockerror",
|
|
556
556
|
y
|
|
557
557
|
));
|
|
558
558
|
}, this.cancel = () => {
|
|
559
|
-
this._state !== c.NONE && (this._state = c.NONE, this._activePointers.length = 0,
|
|
559
|
+
this._state !== c.NONE && (this._state = c.NONE, this._activePointers.length = 0, u());
|
|
560
560
|
}, t && this.connect(t), this.update(0);
|
|
561
561
|
}
|
|
562
562
|
/**
|
|
@@ -987,11 +987,11 @@ class J extends ws {
|
|
|
987
987
|
), Promise.resolve());
|
|
988
988
|
const m = He(this._sphericalEnd.theta, je), p = He(this._sphericalEnd.phi, je);
|
|
989
989
|
a.push(this.rotateTo(m, p, t));
|
|
990
|
-
const v = b.setFromSpherical(this._sphericalEnd).normalize(),
|
|
991
|
-
|
|
992
|
-
const
|
|
993
|
-
L.copy(d.min).applyQuaternion(
|
|
994
|
-
const y =
|
|
990
|
+
const v = b.setFromSpherical(this._sphericalEnd).normalize(), g = Ke.setFromUnitVectors(v, we), u = P(Math.abs(v.y), 1);
|
|
991
|
+
u && g.multiply(xe.setFromAxisAngle(pe, m)), g.multiply(this._yAxisUpSpaceInverse);
|
|
992
|
+
const f = We.makeEmpty();
|
|
993
|
+
L.copy(d.min).applyQuaternion(g), f.expandByPoint(L), L.copy(d.min).setX(d.max.x).applyQuaternion(g), f.expandByPoint(L), L.copy(d.min).setY(d.max.y).applyQuaternion(g), f.expandByPoint(L), L.copy(d.max).setZ(d.min.z).applyQuaternion(g), f.expandByPoint(L), L.copy(d.min).setZ(d.max.z).applyQuaternion(g), f.expandByPoint(L), L.copy(d.max).setY(d.min.y).applyQuaternion(g), f.expandByPoint(L), L.copy(d.max).setX(d.min.x).applyQuaternion(g), f.expandByPoint(L), L.copy(d.max).applyQuaternion(g), f.expandByPoint(L), f.min.x -= i, f.min.y -= o, f.max.x += r, f.max.y += n, g.setFromUnitVectors(we, v), u && g.premultiply(xe.invert()), g.premultiply(this._yAxisUpSpace);
|
|
994
|
+
const y = f.getSize(b), l = f.getCenter(L).applyQuaternion(g);
|
|
995
995
|
if (Y(this._camera)) {
|
|
996
996
|
const _ = this.getDistanceToFitBox(
|
|
997
997
|
y.x,
|
|
@@ -1084,23 +1084,23 @@ class J extends ws {
|
|
|
1084
1084
|
* @param enableTransition
|
|
1085
1085
|
* @category Methods
|
|
1086
1086
|
*/
|
|
1087
|
-
lerpLookAt(e, t, s, i, r, o, n, a, d, m, p, v,
|
|
1087
|
+
lerpLookAt(e, t, s, i, r, o, n, a, d, m, p, v, g, u = !1) {
|
|
1088
1088
|
this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._lastDollyDirection = K.NONE, this._changedDolly = 0;
|
|
1089
|
-
const
|
|
1089
|
+
const f = b.set(i, r, o), y = L.set(e, t, s);
|
|
1090
1090
|
z.setFromVector3(
|
|
1091
|
-
y.sub(
|
|
1091
|
+
y.sub(f).applyQuaternion(this._yAxisUpSpace)
|
|
1092
1092
|
);
|
|
1093
1093
|
const l = G.set(m, p, v), _ = L.set(n, a, d);
|
|
1094
1094
|
ae.setFromVector3(
|
|
1095
1095
|
_.sub(l).applyQuaternion(this._yAxisUpSpace)
|
|
1096
|
-
), this._targetEnd.copy(
|
|
1096
|
+
), this._targetEnd.copy(f.lerp(l, g));
|
|
1097
1097
|
const O = ae.theta - z.theta, C = ae.phi - z.phi, w = ae.radius - z.radius;
|
|
1098
1098
|
this._sphericalEnd.set(
|
|
1099
|
-
z.radius + w *
|
|
1100
|
-
z.phi + C *
|
|
1101
|
-
z.theta + O *
|
|
1102
|
-
), this.normalizeRotations(), this._needsUpdate = !0,
|
|
1103
|
-
const E = !
|
|
1099
|
+
z.radius + w * g,
|
|
1100
|
+
z.phi + C * g,
|
|
1101
|
+
z.theta + O * g
|
|
1102
|
+
), this.normalizeRotations(), this._needsUpdate = !0, u || (this._target.copy(this._targetEnd), this._spherical.copy(this._sphericalEnd));
|
|
1103
|
+
const E = !u || P(this._target.x, this._targetEnd.x, this.restThreshold) && P(this._target.y, this._targetEnd.y, this.restThreshold) && P(this._target.z, this._targetEnd.z, this.restThreshold) && P(
|
|
1104
1104
|
this._spherical.theta,
|
|
1105
1105
|
this._sphericalEnd.theta,
|
|
1106
1106
|
this.restThreshold
|
|
@@ -1454,29 +1454,29 @@ class J extends ws {
|
|
|
1454
1454
|
}
|
|
1455
1455
|
if (this.dollyToCursor) {
|
|
1456
1456
|
if (Y(this._camera) && this._changedDolly !== 0) {
|
|
1457
|
-
const p = this._spherical.radius - this._lastDistance, v = this._camera,
|
|
1458
|
-
|
|
1459
|
-
const
|
|
1460
|
-
|
|
1457
|
+
const p = this._spherical.radius - this._lastDistance, v = this._camera, g = this._getCameraDirection(ne), u = b.copy(g).cross(v.up).normalize();
|
|
1458
|
+
u.lengthSq() === 0 && (u.x = 1);
|
|
1459
|
+
const f = L.crossVectors(u, g), y = this._sphericalEnd.radius * Math.tan(v.getEffectiveFOV() * ie * 0.5), _ = (this._sphericalEnd.radius - p - this._sphericalEnd.radius) / this._sphericalEnd.radius, O = G.copy(this._targetEnd).add(
|
|
1460
|
+
u.multiplyScalar(
|
|
1461
1461
|
this._dollyControlCoord.x * y * v.aspect
|
|
1462
1462
|
)
|
|
1463
1463
|
).add(
|
|
1464
|
-
|
|
1464
|
+
f.multiplyScalar(this._dollyControlCoord.y * y)
|
|
1465
1465
|
), C = b.copy(this._targetEnd).lerp(O, _), w = this._lastDollyDirection === K.IN && this._spherical.radius <= this.minDistance, E = this._lastDollyDirection === K.OUT && this.maxDistance <= this._spherical.radius;
|
|
1466
1466
|
if (this.infinityDolly && (w || E)) {
|
|
1467
1467
|
this._sphericalEnd.radius -= p, this._spherical.radius -= p;
|
|
1468
|
-
const R = L.copy(
|
|
1468
|
+
const R = L.copy(g).multiplyScalar(-p);
|
|
1469
1469
|
C.add(R);
|
|
1470
1470
|
}
|
|
1471
1471
|
this._boundary.clampPoint(C, C);
|
|
1472
1472
|
const x = L.subVectors(C, this._targetEnd);
|
|
1473
1473
|
this._targetEnd.copy(C), this._target.add(x), this._changedDolly -= p, A(this._changedDolly) && (this._changedDolly = 0);
|
|
1474
1474
|
} else if (H(this._camera) && this._changedZoom !== 0) {
|
|
1475
|
-
const p = this._zoom - this._lastZoom, v = this._camera,
|
|
1475
|
+
const p = this._zoom - this._lastZoom, v = this._camera, g = b.set(
|
|
1476
1476
|
this._dollyControlCoord.x,
|
|
1477
1477
|
this._dollyControlCoord.y,
|
|
1478
1478
|
(v.near + v.far) / (v.near - v.far)
|
|
1479
|
-
).unproject(v),
|
|
1479
|
+
).unproject(v), u = L.set(0, 0, -1).applyQuaternion(v.quaternion), f = G.copy(g).add(u.multiplyScalar(-g.dot(v.up))), l = -(this._zoom - p - this._zoom) / this._zoom, _ = this._getCameraDirection(ne), O = this._targetEnd.dot(_), C = b.copy(this._targetEnd).lerp(f, l), w = C.dot(_), E = _.multiplyScalar(
|
|
1480
1480
|
w - O
|
|
1481
1481
|
);
|
|
1482
1482
|
C.sub(E), this._boundary.clampPoint(C, C);
|
|
@@ -2267,14 +2267,14 @@ class Ws {
|
|
|
2267
2267
|
}
|
|
2268
2268
|
), p = new ke(o, m), v = this.getSize();
|
|
2269
2269
|
p.setSize(v.width, v.height);
|
|
2270
|
-
const
|
|
2270
|
+
const g = new hs(
|
|
2271
2271
|
s.scene,
|
|
2272
2272
|
i.camera
|
|
2273
2273
|
);
|
|
2274
|
-
p.addPass(
|
|
2275
|
-
this.changeCamera(
|
|
2276
|
-
}), s.event.on("pageChange", (
|
|
2277
|
-
this.changeScene(
|
|
2274
|
+
p.addPass(g), this.scene = s.scene, this.camera = i.camera, this.finalComposer = p, this.renderPass = g, i.event.on("pageChange", (u) => {
|
|
2275
|
+
this.changeCamera(u);
|
|
2276
|
+
}), s.event.on("pageChange", (u) => {
|
|
2277
|
+
this.changeScene(u);
|
|
2278
2278
|
});
|
|
2279
2279
|
}
|
|
2280
2280
|
changeCamera(e) {
|
|
@@ -2472,7 +2472,7 @@ class Xs {
|
|
|
2472
2472
|
let O, C;
|
|
2473
2473
|
l.isOrthographicCamera && (O = -(l.right + l.left) / 2, C = (l.top + l.bottom) / 2);
|
|
2474
2474
|
const w = l.view && l.view.enabled ? l.view.height / l.view.fullHeight : 1, E = l.isOrthographicCamera ? `scale( ${w} )scale(` + _ + ")translate(" + p(O) + "px," + p(C) + "px)" + v(l.matrixWorldInverse) : `scale( ${w} )translateZ(` + _ + "px)" + v(l.matrixWorldInverse), R = (l.isPerspectiveCamera ? "perspective(" + _ + "px) " : "") + E + "translate(" + r + "px," + o + "px)";
|
|
2475
|
-
n.camera.style !== R && (m.style.transform = R, n.camera.style = R),
|
|
2475
|
+
n.camera.style !== R && (m.style.transform = R, n.camera.style = R), f(y, y, l);
|
|
2476
2476
|
}, this.setSize = function(y, l) {
|
|
2477
2477
|
s = y, i = l, r = s / 2, o = i / 2, a.style.width = y + "px", a.style.height = l + "px", d.style.width = y + "px", d.style.height = l + "px", m.style.width = y + "px", m.style.height = l + "px";
|
|
2478
2478
|
};
|
|
@@ -2483,18 +2483,18 @@ class Xs {
|
|
|
2483
2483
|
const l = y.elements;
|
|
2484
2484
|
return "matrix3d(" + p(l[0]) + "," + p(-l[1]) + "," + p(l[2]) + "," + p(l[3]) + "," + p(l[4]) + "," + p(-l[5]) + "," + p(l[6]) + "," + p(l[7]) + "," + p(l[8]) + "," + p(-l[9]) + "," + p(l[10]) + "," + p(l[11]) + "," + p(l[12]) + "," + p(-l[13]) + "," + p(l[14]) + "," + p(l[15]) + ")";
|
|
2485
2485
|
}
|
|
2486
|
-
function
|
|
2486
|
+
function g(y) {
|
|
2487
2487
|
const l = y.elements;
|
|
2488
2488
|
return "translate(-50%,-50%)" + ("matrix3d(" + p(l[0]) + "," + p(l[1]) + "," + p(l[2]) + "," + p(l[3]) + "," + p(-l[4]) + "," + p(-l[5]) + "," + p(-l[6]) + "," + p(-l[7]) + "," + p(l[8]) + "," + p(l[9]) + "," + p(l[10]) + "," + p(l[11]) + "," + p(l[12]) + "," + p(l[13]) + "," + p(l[14]) + "," + p(l[15]) + ")");
|
|
2489
2489
|
}
|
|
2490
|
-
function
|
|
2490
|
+
function u(y) {
|
|
2491
2491
|
y.isCSS3DObject && (y.element.style.display = "none");
|
|
2492
2492
|
for (let l = 0, _ = y.children.length; l < _; l++)
|
|
2493
|
-
|
|
2493
|
+
u(y.children[l]);
|
|
2494
2494
|
}
|
|
2495
|
-
function
|
|
2495
|
+
function f(y, l, _, O) {
|
|
2496
2496
|
if (y.visible === !1) {
|
|
2497
|
-
|
|
2497
|
+
u(y);
|
|
2498
2498
|
return;
|
|
2499
2499
|
}
|
|
2500
2500
|
if (y.isCSS3DObject) {
|
|
@@ -2502,7 +2502,7 @@ class Xs {
|
|
|
2502
2502
|
if (w.style.display = C === !0 ? "" : "none", C === !0) {
|
|
2503
2503
|
y.onBeforeRender(t, l, _);
|
|
2504
2504
|
let E;
|
|
2505
|
-
y.isCSS3DSprite ? (I.copy(_.matrixWorldInverse), I.transpose(), y.rotation2D !== 0 && I.multiply(Gs.makeRotationZ(y.rotation2D)), y.matrixWorld.decompose(qe, $s, Qe), I.setPosition(qe), I.scale(Qe), I.elements[3] = 0, I.elements[7] = 0, I.elements[11] = 0, I.elements[15] = 1, E =
|
|
2505
|
+
y.isCSS3DSprite ? (I.copy(_.matrixWorldInverse), I.transpose(), y.rotation2D !== 0 && I.multiply(Gs.makeRotationZ(y.rotation2D)), y.matrixWorld.decompose(qe, $s, Qe), I.setPosition(qe), I.scale(Qe), I.elements[3] = 0, I.elements[7] = 0, I.elements[11] = 0, I.elements[15] = 1, E = g(I)) : E = g(y.matrixWorld);
|
|
2506
2506
|
const x = n.objects.get(y);
|
|
2507
2507
|
if (x === void 0 || x.style !== E) {
|
|
2508
2508
|
w.style.transform = E;
|
|
@@ -2513,7 +2513,7 @@ class Xs {
|
|
|
2513
2513
|
}
|
|
2514
2514
|
}
|
|
2515
2515
|
for (let C = 0, w = y.children.length; C < w; C++)
|
|
2516
|
-
|
|
2516
|
+
f(y.children[C], l, _);
|
|
2517
2517
|
}
|
|
2518
2518
|
}
|
|
2519
2519
|
}
|
|
@@ -2535,51 +2535,51 @@ class qs {
|
|
|
2535
2535
|
width: s,
|
|
2536
2536
|
height: i
|
|
2537
2537
|
};
|
|
2538
|
-
}, this.render = function(
|
|
2539
|
-
|
|
2540
|
-
}, this.setSize = function(
|
|
2541
|
-
s =
|
|
2538
|
+
}, this.render = function(u, f) {
|
|
2539
|
+
u.matrixWorldAutoUpdate === !0 && u.updateMatrixWorld(), f.parent === null && f.matrixWorldAutoUpdate === !0 && f.updateMatrixWorld(), Je.copy(f.matrixWorldInverse), et.multiplyMatrices(f.projectionMatrix, Je), m(u, u, f), g(u);
|
|
2540
|
+
}, this.setSize = function(u, f) {
|
|
2541
|
+
s = u, i = f, r = s / 2, o = i / 2, a.style.width = u + "px", a.style.height = f + "px";
|
|
2542
2542
|
};
|
|
2543
|
-
function d(
|
|
2544
|
-
|
|
2545
|
-
for (let
|
|
2546
|
-
d(
|
|
2543
|
+
function d(u) {
|
|
2544
|
+
u.isCSS2DObject && (u.element.style.display = "none");
|
|
2545
|
+
for (let f = 0, y = u.children.length; f < y; f++)
|
|
2546
|
+
d(u.children[f]);
|
|
2547
2547
|
}
|
|
2548
|
-
function m(
|
|
2549
|
-
if (
|
|
2550
|
-
d(
|
|
2548
|
+
function m(u, f, y) {
|
|
2549
|
+
if (u.visible === !1) {
|
|
2550
|
+
d(u);
|
|
2551
2551
|
return;
|
|
2552
2552
|
}
|
|
2553
|
-
if (
|
|
2554
|
-
q.setFromMatrixPosition(
|
|
2555
|
-
const l = q.z >= -1 && q.z <= 1 &&
|
|
2556
|
-
_.style.display = l === !0 ? "" : "none", l === !0 && (
|
|
2553
|
+
if (u.isCSS2DObject) {
|
|
2554
|
+
q.setFromMatrixPosition(u.matrixWorld), q.applyMatrix4(et);
|
|
2555
|
+
const l = q.z >= -1 && q.z <= 1 && u.layers.test(y.layers) === !0, _ = u.element;
|
|
2556
|
+
_.style.display = l === !0 ? "" : "none", l === !0 && (u.onBeforeRender(t, f, y), _.style.transform = "translate(" + -100 * u.center.x + "%," + -100 * u.center.y + "%)translate(" + (q.x * r + r) + "px," + (-q.y * o + o) + "px)", _.parentNode !== a && a.appendChild(_), u.onAfterRender(t, f, y));
|
|
2557
2557
|
const O = {
|
|
2558
|
-
distanceToCameraSquared: p(y,
|
|
2558
|
+
distanceToCameraSquared: p(y, u)
|
|
2559
2559
|
};
|
|
2560
|
-
n.objects.set(
|
|
2560
|
+
n.objects.set(u, O);
|
|
2561
2561
|
}
|
|
2562
|
-
for (let l = 0, _ =
|
|
2563
|
-
m(
|
|
2562
|
+
for (let l = 0, _ = u.children.length; l < _; l++)
|
|
2563
|
+
m(u.children[l], f, y);
|
|
2564
2564
|
}
|
|
2565
|
-
function p(
|
|
2566
|
-
return tt.setFromMatrixPosition(
|
|
2565
|
+
function p(u, f) {
|
|
2566
|
+
return tt.setFromMatrixPosition(u.matrixWorld), st.setFromMatrixPosition(f.matrixWorld), tt.distanceToSquared(st);
|
|
2567
2567
|
}
|
|
2568
|
-
function v(
|
|
2569
|
-
const
|
|
2570
|
-
return
|
|
2571
|
-
y.isCSS2DObject &&
|
|
2572
|
-
}),
|
|
2568
|
+
function v(u) {
|
|
2569
|
+
const f = [];
|
|
2570
|
+
return u.traverseVisible(function(y) {
|
|
2571
|
+
y.isCSS2DObject && f.push(y);
|
|
2572
|
+
}), f;
|
|
2573
2573
|
}
|
|
2574
|
-
function u
|
|
2575
|
-
const
|
|
2574
|
+
function g(u) {
|
|
2575
|
+
const f = v(u).sort(function(l, _) {
|
|
2576
2576
|
if (l.renderOrder !== _.renderOrder)
|
|
2577
2577
|
return _.renderOrder - l.renderOrder;
|
|
2578
2578
|
const O = n.objects.get(l).distanceToCameraSquared, C = n.objects.get(_).distanceToCameraSquared;
|
|
2579
2579
|
return O - C;
|
|
2580
|
-
}), y =
|
|
2581
|
-
for (let l = 0, _ =
|
|
2582
|
-
|
|
2580
|
+
}), y = f.length;
|
|
2581
|
+
for (let l = 0, _ = f.length; l < _; l++)
|
|
2582
|
+
f[l].element.style.zIndex = y - l;
|
|
2583
2583
|
}
|
|
2584
2584
|
}
|
|
2585
2585
|
}
|
|
@@ -2715,27 +2715,27 @@ class ei {
|
|
|
2715
2715
|
return;
|
|
2716
2716
|
r.preventDefault();
|
|
2717
2717
|
const o = e === "move" ? t : s, n = [];
|
|
2718
|
-
if (this.pickFunctionsMap.forEach((
|
|
2719
|
-
o.has(
|
|
2720
|
-
objArr:
|
|
2718
|
+
if (this.pickFunctionsMap.forEach((g) => {
|
|
2719
|
+
o.has(g.type) && n.push(te(U({}, g), {
|
|
2720
|
+
objArr: g.objArr instanceof Function ? g.objArr() : g.objArr
|
|
2721
2721
|
}));
|
|
2722
2722
|
}), n.length === 0) return;
|
|
2723
2723
|
this.activeObjects.clear(), this.objCallbackMap.clear(), this.activeObject = null;
|
|
2724
2724
|
const a = this.objCallbackMap;
|
|
2725
|
-
for (const
|
|
2726
|
-
for (const
|
|
2727
|
-
if (!
|
|
2728
|
-
a.has(
|
|
2729
|
-
const
|
|
2730
|
-
|
|
2725
|
+
for (const g of n)
|
|
2726
|
+
for (const u of g.objArr) {
|
|
2727
|
+
if (!u.object3d || !u.visibleWithAncestors) continue;
|
|
2728
|
+
a.has(u) || a.set(u, /* @__PURE__ */ new Map());
|
|
2729
|
+
const f = a.get(u);
|
|
2730
|
+
f.has(g.type) || f.set(g.type, []), f.get(g.type).push(g.cb);
|
|
2731
2731
|
}
|
|
2732
2732
|
if (a.size === 0) return;
|
|
2733
|
-
const d = [...a.keys()].map((
|
|
2733
|
+
const d = [...a.keys()].map((g) => g.object3d), m = (v = this.pencil.pick(r, d, !0)) == null ? void 0 : v.intersects;
|
|
2734
2734
|
if (!m || m.length === 0)
|
|
2735
2735
|
e === "down" ? this.handleDownOutside(r) : e === "move" && this.handleLeaveEvents(r);
|
|
2736
2736
|
else {
|
|
2737
|
-
const
|
|
2738
|
-
this.processIntersection(
|
|
2737
|
+
const g = m[0];
|
|
2738
|
+
this.processIntersection(g, r, e);
|
|
2739
2739
|
}
|
|
2740
2740
|
const p = this.prevActiveObjects;
|
|
2741
2741
|
this.prevActiveObjects = this.activeObjects, this.activeObjects = p, this.activeObjects.clear();
|
|
@@ -2801,10 +2801,10 @@ class ei {
|
|
|
2801
2801
|
if (m) {
|
|
2802
2802
|
const p = (v) => {
|
|
2803
2803
|
v.preventDefault();
|
|
2804
|
-
const
|
|
2805
|
-
if (!r && Math.abs(v.clientX - e.clientX) <=
|
|
2806
|
-
for (const
|
|
2807
|
-
|
|
2804
|
+
const g = 5;
|
|
2805
|
+
if (!r && Math.abs(v.clientX - e.clientX) <= g && Math.abs(v.clientY - e.clientY) <= g)
|
|
2806
|
+
for (const u of m)
|
|
2807
|
+
u({
|
|
2808
2808
|
baseObject: n,
|
|
2809
2809
|
realBaseObject: this.activeObject,
|
|
2810
2810
|
mouseEvent: e,
|
|
@@ -2954,23 +2954,23 @@ class ti extends ei {
|
|
|
2954
2954
|
}
|
|
2955
2955
|
draw(e, t, s) {
|
|
2956
2956
|
return se(this, null, function* () {
|
|
2957
|
-
var r, o, n;
|
|
2957
|
+
var r, o, n, a;
|
|
2958
2958
|
const i = this.objectNamesToFactories.get(e);
|
|
2959
2959
|
if (i) {
|
|
2960
2960
|
t || (t = {}), t.target === void 0 && (t.target = s);
|
|
2961
|
-
const
|
|
2962
|
-
let
|
|
2963
|
-
return
|
|
2964
|
-
} :
|
|
2965
|
-
|
|
2966
|
-
}),
|
|
2967
|
-
|
|
2961
|
+
const d = (r = t.objectType) != null ? r : e, m = t.target, p = (o = t.onTop) != null ? o : 0, v = (n = t.prefab) != null ? n : !1, g = (a = t.create) != null ? a : !0, u = new i().create(t);
|
|
2962
|
+
let f;
|
|
2963
|
+
return m === null ? f = null : typeof m == "string" ? f = this.objects.get(m) : m != null && m.isBaseObject || m ? f = m : v ? f = this.prefabGroup : f = this.group, g === !1 ? u.create = () => {
|
|
2964
|
+
} : g !== !0 && (u.create = () => {
|
|
2965
|
+
g(u);
|
|
2966
|
+
}), u.pencil = this.pencil, u.lead = this, u.mList = this.mList, u.isPrefab = v, u.objectType = `${d}`, u.objectOptions = t, this.setBaseObjectKey(
|
|
2967
|
+
u,
|
|
2968
2968
|
t.key ? `$t:#${t.key}` : "$t:",
|
|
2969
|
-
|
|
2969
|
+
f == null ? void 0 : f.key
|
|
2970
2970
|
), this.objectsPm.set(
|
|
2971
|
-
|
|
2972
|
-
this.addBaseObject(
|
|
2973
|
-
), yield this.objectsPm.get(
|
|
2971
|
+
u,
|
|
2972
|
+
this.addBaseObject(u, f, p)
|
|
2973
|
+
), yield this.objectsPm.get(u), this.objectsPm.delete(u), u;
|
|
2974
2974
|
}
|
|
2975
2975
|
throw new Error(`Unrecognized:${e}`);
|
|
2976
2976
|
});
|
|
@@ -3119,15 +3119,15 @@ class ot extends mt {
|
|
|
3119
3119
|
const m = e.split(".").pop(), p = this.options.type === "image" ? `image/${m || "png"}` : `video/${m || "mp4"}`;
|
|
3120
3120
|
d = d.slice(0, a.size, p);
|
|
3121
3121
|
const v = () => {
|
|
3122
|
-
o.removeEventListener("load",
|
|
3123
|
-
},
|
|
3122
|
+
o.removeEventListener("load", g, !1), o.removeEventListener("error", u, !1);
|
|
3123
|
+
}, g = () => {
|
|
3124
3124
|
v(), r.needsUpdate = !0, t && t(r);
|
|
3125
|
-
},
|
|
3125
|
+
}, u = (y) => {
|
|
3126
3126
|
v(), i && i(y), this.manager.itemError(e), this.manager.itemEnd(e);
|
|
3127
3127
|
};
|
|
3128
|
-
o.addEventListener("load",
|
|
3129
|
-
const
|
|
3130
|
-
o.src =
|
|
3128
|
+
o.addEventListener("load", g, !1), o.addEventListener("error", u, !1);
|
|
3129
|
+
const f = window.URL.createObjectURL(d);
|
|
3130
|
+
o.src = f;
|
|
3131
3131
|
},
|
|
3132
3132
|
s,
|
|
3133
3133
|
i
|
|
@@ -3585,18 +3585,18 @@ class di {
|
|
|
3585
3585
|
outputColorSpace: m,
|
|
3586
3586
|
logarithmicDepthBuffer: p,
|
|
3587
3587
|
preserveDrawingBuffer: v,
|
|
3588
|
-
stencil:
|
|
3589
|
-
depth:
|
|
3590
|
-
} = i,
|
|
3588
|
+
stencil: g,
|
|
3589
|
+
depth: u
|
|
3590
|
+
} = i, f = new rs({
|
|
3591
3591
|
alpha: r,
|
|
3592
3592
|
antialias: n,
|
|
3593
3593
|
powerPreference: a,
|
|
3594
3594
|
logarithmicDepthBuffer: p,
|
|
3595
3595
|
preserveDrawingBuffer: v,
|
|
3596
|
-
stencil:
|
|
3597
|
-
depth:
|
|
3596
|
+
stencil: g,
|
|
3597
|
+
depth: u
|
|
3598
3598
|
});
|
|
3599
|
-
|
|
3599
|
+
f.setSize(t, s), f.setPixelRatio(o), f.toneMappingExposure = d, f.outputColorSpace = m, this.renderer = f;
|
|
3600
3600
|
}
|
|
3601
3601
|
setSize(e, t) {
|
|
3602
3602
|
this.renderer.setSize(e, t);
|
|
@@ -3841,20 +3841,20 @@ const _e = class _e {
|
|
|
3841
3841
|
const p = new Ds({
|
|
3842
3842
|
width: a,
|
|
3843
3843
|
height: d
|
|
3844
|
-
}), v = new mi({}),
|
|
3844
|
+
}), v = new mi({}), g = new Ks({
|
|
3845
3845
|
controlsParams: {
|
|
3846
3846
|
domElement: (_ = o == null ? void 0 : o.domElement) != null ? _ : m.renderer.domElement
|
|
3847
3847
|
}
|
|
3848
|
-
}),
|
|
3848
|
+
}), u = new ai({
|
|
3849
3849
|
loaderParams: U({
|
|
3850
3850
|
anisotropy: this.maxAnisotropy
|
|
3851
3851
|
}, n)
|
|
3852
|
-
}),
|
|
3852
|
+
}), f = new hi({
|
|
3853
3853
|
pencil: this
|
|
3854
3854
|
}), y = new si({
|
|
3855
3855
|
pencil: this
|
|
3856
3856
|
});
|
|
3857
|
-
this.sceneController = v, this.cameraController = p, this.controlsController =
|
|
3857
|
+
this.sceneController = v, this.cameraController = p, this.controlsController = g, this.loaderController = u, this.mListController = f, this.leadController = y;
|
|
3858
3858
|
const l = this.addPage({
|
|
3859
3859
|
sceneOptions: this.options.scene,
|
|
3860
3860
|
cameraOptions: this.options.camera
|
|
@@ -4036,11 +4036,11 @@ const _e = class _e {
|
|
|
4036
4036
|
}
|
|
4037
4037
|
}
|
|
4038
4038
|
dispose() {
|
|
4039
|
-
var e, t, s, i, r, o, n, a, d, m, p, v,
|
|
4040
|
-
this.handeleResize(1, 1, !1), this.stop(), this.timer.dispose(), Ce.removeAll(), this.event.removeAllListeners(), (e = this.resizeObserver) == null || e.unobserve(this.options.container), this.installPlugins.forEach((
|
|
4039
|
+
var e, t, s, i, r, o, n, a, d, m, p, v, g, u;
|
|
4040
|
+
this.handeleResize(1, 1, !1), this.stop(), this.timer.dispose(), Ce.removeAll(), this.event.removeAllListeners(), (e = this.resizeObserver) == null || e.unobserve(this.options.container), this.installPlugins.forEach((f) => {
|
|
4041
4041
|
var y;
|
|
4042
|
-
(y =
|
|
4043
|
-
}), (t = this.controlsController) == null || t.dispose(), (s = this.transformController) == null || s.dispose(), (i = this.cssRendererController) == null || i.dispose(), (r = this.sceneController) == null || r.dispose(), (o = this.cameraController) == null || o.dispose(), (n = this.helperController) == null || n.dispose(), (a = this.composerController) == null || a.dispose(), (d = this.rendererController) == null || d.dispose(), (m = this.loaderController) == null || m.dispose(), (p = this.leadController) == null || p.dispose(), (v = this.mListController) == null || v.dispose(), this.cssRendererController = void 0, this.installPlugins.clear(), (
|
|
4042
|
+
(y = f.dispose) == null || y.call(f);
|
|
4043
|
+
}), (t = this.controlsController) == null || t.dispose(), (s = this.transformController) == null || s.dispose(), (i = this.cssRendererController) == null || i.dispose(), (r = this.sceneController) == null || r.dispose(), (o = this.cameraController) == null || o.dispose(), (n = this.helperController) == null || n.dispose(), (a = this.composerController) == null || a.dispose(), (d = this.rendererController) == null || d.dispose(), (m = this.loaderController) == null || m.dispose(), (p = this.leadController) == null || p.dispose(), (v = this.mListController) == null || v.dispose(), this.cssRendererController = void 0, this.installPlugins.clear(), (g = this.stats) == null || g.dom.remove(), (u = this.renderer) == null || u.domElement.remove(), this._isDispose = !0;
|
|
4044
4044
|
}
|
|
4045
4045
|
};
|
|
4046
4046
|
_e.options = {
|
|
@@ -37,33 +37,12 @@ export type ExtrudeGeometry = {
|
|
|
37
37
|
/**
|
|
38
38
|
* - A 3D spline path along which the shape should be extruded. Bevels not supported for path extrusion.
|
|
39
39
|
*/
|
|
40
|
-
extrudePath?:
|
|
41
|
-
ArcCurve: typeof ArcCurve;
|
|
42
|
-
CatmullRomCurve3: typeof CatmullRomCurve3;
|
|
43
|
-
CubicBezierCurve: typeof CubicBezierCurve;
|
|
44
|
-
CubicBezierCurve3: typeof CubicBezierCurve3;
|
|
45
|
-
EllipseCurve: typeof EllipseCurve;
|
|
46
|
-
LineCurve: typeof LineCurve;
|
|
47
|
-
LineCurve3: typeof LineCurve3;
|
|
48
|
-
QuadraticBezierCurve: typeof QuadraticBezierCurve;
|
|
49
|
-
QuadraticBezierCurve3: typeof QuadraticBezierCurve3;
|
|
50
|
-
SplineCurve: typeof SplineCurve;
|
|
51
|
-
} | null | undefined;
|
|
40
|
+
extrudePath?: Curve | null;
|
|
52
41
|
/**
|
|
53
42
|
* - An object that provides UV generator functions for custom UV generation.
|
|
54
43
|
*/
|
|
55
44
|
UVGenerator?: Object | undefined;
|
|
56
45
|
};
|
|
57
|
-
import { ArcCurve } from 'three';
|
|
58
|
-
import { CatmullRomCurve3 } from 'three';
|
|
59
|
-
import { CubicBezierCurve } from 'three';
|
|
60
|
-
import { CubicBezierCurve3 } from 'three';
|
|
61
|
-
import { EllipseCurve } from 'three';
|
|
62
|
-
import { LineCurve } from 'three';
|
|
63
|
-
import { LineCurve3 } from 'three';
|
|
64
|
-
import { QuadraticBezierCurve } from 'three';
|
|
65
|
-
import { QuadraticBezierCurve3 } from 'three';
|
|
66
|
-
import { SplineCurve } from 'three';
|
|
67
46
|
/**
|
|
68
47
|
* Creates extruded geometry from a path shape.
|
|
69
48
|
*
|