fl-web-component 1.3.12 → 1.3.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/fl-web-component.common.js +135 -222
- package/dist/fl-web-component.common.js.map +1 -1
- package/dist/fl-web-component.css +1 -1
- package/package.json +1 -1
- package/packages/components/com-flcanvas/index.vue +234 -327
- package/packages/components/com-graphics/index.vue +164 -3
- package/patches/camera-controls+2.9.0.patch +63 -63
|
@@ -939,9 +939,9 @@
|
|
|
939
939
|
renderer.clippingPlanes = clippingPlanes;
|
|
940
940
|
if (flag) {
|
|
941
941
|
guiParams = {
|
|
942
|
-
x轴: clippingPlanes[0].constant,
|
|
943
|
-
y轴: clippingPlanes[2].constant,
|
|
944
|
-
z轴: clippingPlanes[1].constant,
|
|
942
|
+
x轴: Math.ceil(clippingPlanes[0].constant),
|
|
943
|
+
y轴: Math.ceil(clippingPlanes[2].constant),
|
|
944
|
+
z轴: Math.ceil(clippingPlanes[1].constant),
|
|
945
945
|
};
|
|
946
946
|
this.addClippingGui(
|
|
947
947
|
'全局剖切',
|
|
@@ -1061,6 +1061,7 @@
|
|
|
1061
1061
|
});
|
|
1062
1062
|
gui
|
|
1063
1063
|
.add(guiParams, 'x轴')
|
|
1064
|
+
.step(0.01)
|
|
1064
1065
|
.min(minValue.x)
|
|
1065
1066
|
.max(guiParams['x轴'])
|
|
1066
1067
|
.onChange(d => {
|
|
@@ -1069,6 +1070,7 @@
|
|
|
1069
1070
|
});
|
|
1070
1071
|
gui
|
|
1071
1072
|
.add(guiParams, 'y轴')
|
|
1073
|
+
.step(0.01)
|
|
1072
1074
|
.min(minValue.y)
|
|
1073
1075
|
.max(guiParams['y轴'])
|
|
1074
1076
|
.onChange(d => {
|
|
@@ -1077,6 +1079,7 @@
|
|
|
1077
1079
|
});
|
|
1078
1080
|
gui
|
|
1079
1081
|
.add(guiParams, 'z轴')
|
|
1082
|
+
.step(0.01)
|
|
1080
1083
|
.min(minValue.z)
|
|
1081
1084
|
.max(guiParams['z轴'])
|
|
1082
1085
|
.onChange(d => {
|
|
@@ -1608,3 +1611,161 @@
|
|
|
1608
1611
|
height: 20px;
|
|
1609
1612
|
}
|
|
1610
1613
|
</style>
|
|
1614
|
+
<style>
|
|
1615
|
+
/* 自定义lil-gui样式 - 浅色主题 */
|
|
1616
|
+
.lil-gui {
|
|
1617
|
+
background: rgba(255, 255, 255, 0.95) !important;
|
|
1618
|
+
border: 1px solid #e0e0e0 !important;
|
|
1619
|
+
border-radius: 8px !important;
|
|
1620
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
|
|
1621
|
+
backdrop-filter: blur(10px) !important;
|
|
1622
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
|
|
1623
|
+
}
|
|
1624
|
+
|
|
1625
|
+
.lil-gui .title {
|
|
1626
|
+
background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
|
|
1627
|
+
color: #495057 !important;
|
|
1628
|
+
border-bottom: 1px solid #dee2e6 !important;
|
|
1629
|
+
font-weight: 600 !important;
|
|
1630
|
+
padding: 0px 12px !important;
|
|
1631
|
+
border-radius: 8px 8px 0 0 !important;
|
|
1632
|
+
}
|
|
1633
|
+
|
|
1634
|
+
.lil-gui .controller {
|
|
1635
|
+
border-bottom: 1px solid #f1f3f4 !important;
|
|
1636
|
+
background: transparent !important;
|
|
1637
|
+
}
|
|
1638
|
+
|
|
1639
|
+
.lil-gui .controller:last-child {
|
|
1640
|
+
border-bottom: none !important;
|
|
1641
|
+
}
|
|
1642
|
+
|
|
1643
|
+
.lil-gui .controller .name {
|
|
1644
|
+
color: #495057 !important;
|
|
1645
|
+
font-weight: 500 !important;
|
|
1646
|
+
font-size: 12px !important;
|
|
1647
|
+
}
|
|
1648
|
+
|
|
1649
|
+
.lil-gui .controller .widget {
|
|
1650
|
+
background: #f8f9fa !important;
|
|
1651
|
+
border: 1px solid #ced4da !important;
|
|
1652
|
+
border-radius: 4px !important;
|
|
1653
|
+
color: #495057 !important;
|
|
1654
|
+
}
|
|
1655
|
+
|
|
1656
|
+
.lil-gui .controller .widget:hover {
|
|
1657
|
+
border-color: #80bdff !important;
|
|
1658
|
+
box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25) !important;
|
|
1659
|
+
}
|
|
1660
|
+
|
|
1661
|
+
.lil-gui .controller .widget:focus {
|
|
1662
|
+
border-color: #80bdff !important;
|
|
1663
|
+
box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25) !important;
|
|
1664
|
+
outline: none !important;
|
|
1665
|
+
}
|
|
1666
|
+
|
|
1667
|
+
.lil-gui .controller input[type='range'] {
|
|
1668
|
+
background: #e9ecef !important;
|
|
1669
|
+
height: 4px !important;
|
|
1670
|
+
-webkit-appearance: none !important;
|
|
1671
|
+
appearance: none !important;
|
|
1672
|
+
border-radius: 2px !important;
|
|
1673
|
+
}
|
|
1674
|
+
.lil-gui .controller.number .fill {
|
|
1675
|
+
border-right: solid #008de9;
|
|
1676
|
+
}
|
|
1677
|
+
.lil-gui .controller input[type='range']::-webkit-slider-thumb {
|
|
1678
|
+
background: #007bff !important;
|
|
1679
|
+
border: 2px solid #ffffff !important;
|
|
1680
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
|
|
1681
|
+
width: 16px !important;
|
|
1682
|
+
height: 16px !important;
|
|
1683
|
+
border-radius: 50% !important;
|
|
1684
|
+
-webkit-appearance: none !important;
|
|
1685
|
+
appearance: none !important;
|
|
1686
|
+
cursor: pointer !important;
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1689
|
+
.lil-gui .controller input[type='range']::-moz-range-thumb {
|
|
1690
|
+
background: #007bff !important;
|
|
1691
|
+
border: 2px solid #ffffff !important;
|
|
1692
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
|
|
1693
|
+
width: 16px !important;
|
|
1694
|
+
height: 16px !important;
|
|
1695
|
+
border-radius: 50% !important;
|
|
1696
|
+
cursor: pointer !important;
|
|
1697
|
+
}
|
|
1698
|
+
|
|
1699
|
+
.lil-gui .controller .option {
|
|
1700
|
+
background: #ffffff !important;
|
|
1701
|
+
color: #495057 !important;
|
|
1702
|
+
border-bottom: 1px solid #f1f3f4 !important;
|
|
1703
|
+
}
|
|
1704
|
+
|
|
1705
|
+
.lil-gui .controller .option:hover {
|
|
1706
|
+
background: #f8f9fa !important;
|
|
1707
|
+
}
|
|
1708
|
+
|
|
1709
|
+
.lil-gui .controller .option:last-child {
|
|
1710
|
+
border-bottom: none !important;
|
|
1711
|
+
}
|
|
1712
|
+
.lil-gui input:active {
|
|
1713
|
+
background: #e6eff4;
|
|
1714
|
+
}
|
|
1715
|
+
.lil-gui .controller button {
|
|
1716
|
+
background: linear-gradient(135deg, #007bff 0%, #0056b3 100%) !important;
|
|
1717
|
+
color: #ffffff !important;
|
|
1718
|
+
border: none !important;
|
|
1719
|
+
border-radius: 4px !important;
|
|
1720
|
+
font-weight: 500 !important;
|
|
1721
|
+
transition: all 0.2s ease !important;
|
|
1722
|
+
}
|
|
1723
|
+
|
|
1724
|
+
.lil-gui .controller button:hover {
|
|
1725
|
+
background: linear-gradient(135deg, #0056b3 0%, #004085 100%) !important;
|
|
1726
|
+
transform: translateY(-1px) !important;
|
|
1727
|
+
box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3) !important;
|
|
1728
|
+
}
|
|
1729
|
+
|
|
1730
|
+
.lil-gui .controller .color {
|
|
1731
|
+
border: 2px solid #ffffff !important;
|
|
1732
|
+
border-radius: 4px !important;
|
|
1733
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
|
|
1734
|
+
}
|
|
1735
|
+
.lil-gui .controller.number .slider {
|
|
1736
|
+
background-color: #e6eff4;
|
|
1737
|
+
}
|
|
1738
|
+
.lil-gui .controller.number .slider:hover {
|
|
1739
|
+
background-color: #e6eff4;
|
|
1740
|
+
}
|
|
1741
|
+
.lil-gui input:hover {
|
|
1742
|
+
background: #e6eff4;
|
|
1743
|
+
}
|
|
1744
|
+
.lil-gui input[type='number']:focus,
|
|
1745
|
+
.lil-gui input[type='text']:focus,
|
|
1746
|
+
.lil-gui input {
|
|
1747
|
+
background: #e6eff4;
|
|
1748
|
+
}
|
|
1749
|
+
.lil-gui .controller > .name {
|
|
1750
|
+
min-width: 25px;
|
|
1751
|
+
}
|
|
1752
|
+
.lil-gui .controller.number input {
|
|
1753
|
+
color: #2e3136;
|
|
1754
|
+
}
|
|
1755
|
+
.lil-gui .controller.number .slider:active {
|
|
1756
|
+
background-color: #e6eff4;
|
|
1757
|
+
}
|
|
1758
|
+
.lil-gui .folder > .title {
|
|
1759
|
+
background: linear-gradient(135deg, #f1f3f4 0%, #e9ecef 100%) !important;
|
|
1760
|
+
color: #495057 !important;
|
|
1761
|
+
border-bottom: 1px solid #dee2e6 !important;
|
|
1762
|
+
}
|
|
1763
|
+
|
|
1764
|
+
.lil-gui .folder > .title:before {
|
|
1765
|
+
color: #6c757d !important;
|
|
1766
|
+
}
|
|
1767
|
+
|
|
1768
|
+
.lil-gui .folder.closed > .children {
|
|
1769
|
+
display: none !important;
|
|
1770
|
+
}
|
|
1771
|
+
</style>
|
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
diff --git a/node_modules/camera-controls/dist/camera-controls.module.js b/node_modules/camera-controls/dist/camera-controls.module.js
|
|
2
|
-
index 08a8fd6..76089cb 100644
|
|
3
|
-
--- a/node_modules/camera-controls/dist/camera-controls.module.js
|
|
4
|
-
+++ b/node_modules/camera-controls/dist/camera-controls.module.js
|
|
5
|
-
@@ -1395,7 +1395,7 @@ class CameraControls extends EventDispatcher {
|
|
6
|
-
* @category Methods
|
|
7
|
-
*/
|
|
8
|
-
dolly(distance, enableTransition = false) {
|
|
9
|
-
- return this.dollyTo(this._sphericalEnd.radius - distance, enableTransition);
|
|
10
|
-
+ return this.dollyTo(this._sphericalEnd.radius - distance, this.minDistance, enableTransition);
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Dolly in/out camera position to given distance.
|
|
14
|
-
@@ -1403,11 +1403,11 @@ class CameraControls extends EventDispatcher {
|
|
15
|
-
* @param enableTransition Whether to move smoothly or immediately.
|
|
16
|
-
* @category Methods
|
|
17
|
-
*/
|
|
18
|
-
- dollyTo(distance, enableTransition = false) {
|
|
19
|
-
+ dollyTo(distance, minDistance, enableTransition = false) {
|
|
20
|
-
this._isUserControllingDolly = false;
|
|
21
|
-
this._lastDollyDirection = DOLLY_DIRECTION.NONE;
|
|
22
|
-
this._changedDolly = 0;
|
|
23
|
-
- return this._dollyToNoClamp(clamp(distance, this.minDistance, this.maxDistance), enableTransition);
|
|
24
|
-
+ return this._dollyToNoClamp(clamp(distance, minDistance, this.maxDistance), enableTransition);
|
|
25
|
-
}
|
|
26
|
-
_dollyToNoClamp(distance, enableTransition = false) {
|
|
27
|
-
const lastRadius = this._sphericalEnd.radius;
|
|
28
|
-
@@ -1635,7 +1635,7 @@ class CameraControls extends EventDispatcher {
|
|
29
|
-
if (isPerspectiveCamera(this._camera)) {
|
|
30
|
-
const distance = this.getDistanceToFitBox(bbSize.x, bbSize.y, bbSize.z, cover);
|
|
31
|
-
promises.push(this.moveTo(center.x, center.y, center.z, enableTransition));
|
|
32
|
-
- promises.push(this.dollyTo(distance, enableTransition));
|
|
33
|
-
+ promises.push(this.dollyTo(distance, this.minDistance, enableTransition));
|
|
34
|
-
promises.push(this.setFocalOffset(0, 0, 0, enableTransition));
|
|
35
|
-
}
|
|
36
|
-
else if (isOrthographicCamera(this._camera)) {
|
|
37
|
-
@@ -1664,7 +1664,7 @@ class CameraControls extends EventDispatcher {
|
|
38
|
-
promises.push(this.moveTo(boundingSphere.center.x, boundingSphere.center.y, boundingSphere.center.z, enableTransition));
|
|
39
|
-
if (isPerspectiveCamera(this._camera)) {
|
|
40
|
-
const distanceToFit = this.getDistanceToFitSphere(boundingSphere.radius);
|
|
41
|
-
- promises.push(this.dollyTo(distanceToFit, enableTransition));
|
|
42
|
-
+ promises.push(this.dollyTo(distanceToFit, this.minDistance, enableTransition));
|
|
43
|
-
}
|
|
44
|
-
else if (isOrthographicCamera(this._camera)) {
|
|
45
|
-
const width = this._camera.right - this._camera.left;
|
|
46
|
-
@@ -1831,7 +1831,7 @@ class CameraControls extends EventDispatcher {
|
|
47
|
-
_zColumn.multiplyScalar(cameraToPoint.z);
|
|
48
|
-
_v3A.copy(_xColumn).add(_yColumn).add(_zColumn);
|
|
49
|
-
_v3A.z = _v3A.z + distance;
|
|
50
|
-
- this.dollyTo(distance, false);
|
|
51
|
-
+ this.dollyTo(distance, Number.EPSILON, false);
|
|
52
|
-
this.setFocalOffset(-_v3A.x, _v3A.y, -_v3A.z, false);
|
|
53
|
-
this.moveTo(targetX, targetY, targetZ, false);
|
|
54
|
-
}
|
|
55
|
-
@@ -2283,7 +2283,7 @@ class CameraControls extends EventDispatcher {
|
|
56
|
-
this.moveTo(obj.target[0], obj.target[1], obj.target[2], enableTransition);
|
|
57
|
-
_sphericalA.setFromVector3(_v3A.fromArray(obj.position).sub(this._targetEnd).applyQuaternion(this._yAxisUpSpace));
|
|
58
|
-
this.rotateTo(_sphericalA.theta, _sphericalA.phi, enableTransition);
|
|
59
|
-
- this.dollyTo(_sphericalA.radius, enableTransition);
|
|
60
|
-
+ this.dollyTo(_sphericalA.radius, this.minDistance, enableTransition);
|
|
61
|
-
this.zoomTo(obj.zoom, enableTransition);
|
|
62
|
-
this.setFocalOffset(obj.focalOffset[0], obj.focalOffset[1], obj.focalOffset[2], enableTransition);
|
|
63
|
-
this._needsUpdate = true;
|
|
1
|
+
diff --git a/node_modules/camera-controls/dist/camera-controls.module.js b/node_modules/camera-controls/dist/camera-controls.module.js
|
|
2
|
+
index 08a8fd6..76089cb 100644
|
|
3
|
+
--- a/node_modules/camera-controls/dist/camera-controls.module.js
|
|
4
|
+
+++ b/node_modules/camera-controls/dist/camera-controls.module.js
|
|
5
|
+
@@ -1395,7 +1395,7 @@ class CameraControls extends EventDispatcher {
|
|
6
|
+
* @category Methods
|
|
7
|
+
*/
|
|
8
|
+
dolly(distance, enableTransition = false) {
|
|
9
|
+
- return this.dollyTo(this._sphericalEnd.radius - distance, enableTransition);
|
|
10
|
+
+ return this.dollyTo(this._sphericalEnd.radius - distance, this.minDistance, enableTransition);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Dolly in/out camera position to given distance.
|
|
14
|
+
@@ -1403,11 +1403,11 @@ class CameraControls extends EventDispatcher {
|
|
15
|
+
* @param enableTransition Whether to move smoothly or immediately.
|
|
16
|
+
* @category Methods
|
|
17
|
+
*/
|
|
18
|
+
- dollyTo(distance, enableTransition = false) {
|
|
19
|
+
+ dollyTo(distance, minDistance, enableTransition = false) {
|
|
20
|
+
this._isUserControllingDolly = false;
|
|
21
|
+
this._lastDollyDirection = DOLLY_DIRECTION.NONE;
|
|
22
|
+
this._changedDolly = 0;
|
|
23
|
+
- return this._dollyToNoClamp(clamp(distance, this.minDistance, this.maxDistance), enableTransition);
|
|
24
|
+
+ return this._dollyToNoClamp(clamp(distance, minDistance, this.maxDistance), enableTransition);
|
|
25
|
+
}
|
|
26
|
+
_dollyToNoClamp(distance, enableTransition = false) {
|
|
27
|
+
const lastRadius = this._sphericalEnd.radius;
|
|
28
|
+
@@ -1635,7 +1635,7 @@ class CameraControls extends EventDispatcher {
|
|
29
|
+
if (isPerspectiveCamera(this._camera)) {
|
|
30
|
+
const distance = this.getDistanceToFitBox(bbSize.x, bbSize.y, bbSize.z, cover);
|
|
31
|
+
promises.push(this.moveTo(center.x, center.y, center.z, enableTransition));
|
|
32
|
+
- promises.push(this.dollyTo(distance, enableTransition));
|
|
33
|
+
+ promises.push(this.dollyTo(distance, this.minDistance, enableTransition));
|
|
34
|
+
promises.push(this.setFocalOffset(0, 0, 0, enableTransition));
|
|
35
|
+
}
|
|
36
|
+
else if (isOrthographicCamera(this._camera)) {
|
|
37
|
+
@@ -1664,7 +1664,7 @@ class CameraControls extends EventDispatcher {
|
|
38
|
+
promises.push(this.moveTo(boundingSphere.center.x, boundingSphere.center.y, boundingSphere.center.z, enableTransition));
|
|
39
|
+
if (isPerspectiveCamera(this._camera)) {
|
|
40
|
+
const distanceToFit = this.getDistanceToFitSphere(boundingSphere.radius);
|
|
41
|
+
- promises.push(this.dollyTo(distanceToFit, enableTransition));
|
|
42
|
+
+ promises.push(this.dollyTo(distanceToFit, this.minDistance, enableTransition));
|
|
43
|
+
}
|
|
44
|
+
else if (isOrthographicCamera(this._camera)) {
|
|
45
|
+
const width = this._camera.right - this._camera.left;
|
|
46
|
+
@@ -1831,7 +1831,7 @@ class CameraControls extends EventDispatcher {
|
|
47
|
+
_zColumn.multiplyScalar(cameraToPoint.z);
|
|
48
|
+
_v3A.copy(_xColumn).add(_yColumn).add(_zColumn);
|
|
49
|
+
_v3A.z = _v3A.z + distance;
|
|
50
|
+
- this.dollyTo(distance, false);
|
|
51
|
+
+ this.dollyTo(distance, Number.EPSILON, false);
|
|
52
|
+
this.setFocalOffset(-_v3A.x, _v3A.y, -_v3A.z, false);
|
|
53
|
+
this.moveTo(targetX, targetY, targetZ, false);
|
|
54
|
+
}
|
|
55
|
+
@@ -2283,7 +2283,7 @@ class CameraControls extends EventDispatcher {
|
|
56
|
+
this.moveTo(obj.target[0], obj.target[1], obj.target[2], enableTransition);
|
|
57
|
+
_sphericalA.setFromVector3(_v3A.fromArray(obj.position).sub(this._targetEnd).applyQuaternion(this._yAxisUpSpace));
|
|
58
|
+
this.rotateTo(_sphericalA.theta, _sphericalA.phi, enableTransition);
|
|
59
|
+
- this.dollyTo(_sphericalA.radius, enableTransition);
|
|
60
|
+
+ this.dollyTo(_sphericalA.radius, this.minDistance, enableTransition);
|
|
61
|
+
this.zoomTo(obj.zoom, enableTransition);
|
|
62
|
+
this.setFocalOffset(obj.focalOffset[0], obj.focalOffset[1], obj.focalOffset[2], enableTransition);
|
|
63
|
+
this._needsUpdate = true;
|