lythreeframe 1.2.42 → 1.2.43
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/bundle.cjs.js
CHANGED
|
@@ -1515,6 +1515,7 @@ class Viewport {
|
|
|
1515
1515
|
return this._app;
|
|
1516
1516
|
}
|
|
1517
1517
|
constructor(app, viewportParam, rendererParam, postProcessParam) {
|
|
1518
|
+
this.uiDom = null;
|
|
1518
1519
|
this._renderer = null;
|
|
1519
1520
|
this.labelRenderer = null;
|
|
1520
1521
|
this._app = null;
|
|
@@ -1585,7 +1586,7 @@ class Viewport {
|
|
|
1585
1586
|
if (element) {
|
|
1586
1587
|
element.removeChild(this.labelRenderer.domElement);
|
|
1587
1588
|
}
|
|
1588
|
-
this.labelRenderer.dispose();
|
|
1589
|
+
// this.labelRenderer.dispose();
|
|
1589
1590
|
}
|
|
1590
1591
|
let width = element ? element.clientWidth : 512;
|
|
1591
1592
|
let height = element ? element.clientHeight : 512;
|
|
@@ -1615,20 +1616,27 @@ class Viewport {
|
|
|
1615
1616
|
uiLayer.style.pointerEvents = 'none'; // UI层默认不响应鼠标事件
|
|
1616
1617
|
uiLayer.style.zIndex = '10'; // 保证在渲染层之上
|
|
1617
1618
|
this._canvas.appendChild(uiLayer);
|
|
1619
|
+
this.uiDom = uiLayer;
|
|
1618
1620
|
}
|
|
1619
1621
|
}
|
|
1620
1622
|
init() {
|
|
1621
1623
|
this.setupPostProcess();
|
|
1622
1624
|
}
|
|
1625
|
+
// addWidget(widget: HTMLElement)
|
|
1626
|
+
// {
|
|
1627
|
+
// if (!this._canvas) return;
|
|
1628
|
+
// let uiLayer = this._canvas.querySelector('.scene-uiLayer') as HTMLDivElement;
|
|
1629
|
+
// if(!uiLayer)
|
|
1630
|
+
// {
|
|
1631
|
+
// console.warn("UI Layer not found, check your settings.");
|
|
1632
|
+
// return
|
|
1633
|
+
// }
|
|
1634
|
+
// uiLayer.appendChild(widget);
|
|
1635
|
+
// }
|
|
1623
1636
|
addWidget(widget) {
|
|
1624
|
-
if (!this.
|
|
1637
|
+
if (!this.uiDom)
|
|
1625
1638
|
return;
|
|
1626
|
-
|
|
1627
|
-
if (!uiLayer) {
|
|
1628
|
-
console.warn("UI Layer not found, check your settings.");
|
|
1629
|
-
return;
|
|
1630
|
-
}
|
|
1631
|
-
uiLayer.appendChild(widget);
|
|
1639
|
+
widget.mount(this.uiDom);
|
|
1632
1640
|
}
|
|
1633
1641
|
setupPostProcess() {
|
|
1634
1642
|
if (this.postProcessParam.steps.length === 0) {
|
|
@@ -2112,10 +2120,13 @@ class Controller {
|
|
|
2112
2120
|
}
|
|
2113
2121
|
updateCamera() {
|
|
2114
2122
|
var _a, _b;
|
|
2123
|
+
console.log("update camera");
|
|
2124
|
+
let isPawnEnabled = this.pawn.enabled;
|
|
2115
2125
|
(_a = this._pawn) === null || _a === void 0 ? void 0 : _a.unpossess();
|
|
2116
2126
|
(_b = this._pawn) === null || _b === void 0 ? void 0 : _b.destroy();
|
|
2117
2127
|
this._pawn = new Orbital(this);
|
|
2118
2128
|
this.pawn.possess();
|
|
2129
|
+
this.pawn.enabled = isPawnEnabled;
|
|
2119
2130
|
}
|
|
2120
2131
|
init() {
|
|
2121
2132
|
if (this.viewPort.canvas) {
|
|
@@ -2958,9 +2969,9 @@ class ThreeJsApp {
|
|
|
2958
2969
|
this._camera = CameraFactory.updataCamera(param, this.camera);
|
|
2959
2970
|
if (previousCam !== this.camera) {
|
|
2960
2971
|
this._onCameraChangedDelegate.broadcast();
|
|
2972
|
+
this.controller.updateCamera();
|
|
2961
2973
|
}
|
|
2962
2974
|
this._camera.updateProjectionMatrix();
|
|
2963
|
-
this.controller.updateCamera();
|
|
2964
2975
|
this.viewport.markRenderStateDirty();
|
|
2965
2976
|
}
|
|
2966
2977
|
onWindowResize(width, height) {
|
package/dist/bundle.esm.js
CHANGED
|
@@ -1513,6 +1513,7 @@ class Viewport {
|
|
|
1513
1513
|
return this._app;
|
|
1514
1514
|
}
|
|
1515
1515
|
constructor(app, viewportParam, rendererParam, postProcessParam) {
|
|
1516
|
+
this.uiDom = null;
|
|
1516
1517
|
this._renderer = null;
|
|
1517
1518
|
this.labelRenderer = null;
|
|
1518
1519
|
this._app = null;
|
|
@@ -1583,7 +1584,7 @@ class Viewport {
|
|
|
1583
1584
|
if (element) {
|
|
1584
1585
|
element.removeChild(this.labelRenderer.domElement);
|
|
1585
1586
|
}
|
|
1586
|
-
this.labelRenderer.dispose();
|
|
1587
|
+
// this.labelRenderer.dispose();
|
|
1587
1588
|
}
|
|
1588
1589
|
let width = element ? element.clientWidth : 512;
|
|
1589
1590
|
let height = element ? element.clientHeight : 512;
|
|
@@ -1613,20 +1614,27 @@ class Viewport {
|
|
|
1613
1614
|
uiLayer.style.pointerEvents = 'none'; // UI层默认不响应鼠标事件
|
|
1614
1615
|
uiLayer.style.zIndex = '10'; // 保证在渲染层之上
|
|
1615
1616
|
this._canvas.appendChild(uiLayer);
|
|
1617
|
+
this.uiDom = uiLayer;
|
|
1616
1618
|
}
|
|
1617
1619
|
}
|
|
1618
1620
|
init() {
|
|
1619
1621
|
this.setupPostProcess();
|
|
1620
1622
|
}
|
|
1623
|
+
// addWidget(widget: HTMLElement)
|
|
1624
|
+
// {
|
|
1625
|
+
// if (!this._canvas) return;
|
|
1626
|
+
// let uiLayer = this._canvas.querySelector('.scene-uiLayer') as HTMLDivElement;
|
|
1627
|
+
// if(!uiLayer)
|
|
1628
|
+
// {
|
|
1629
|
+
// console.warn("UI Layer not found, check your settings.");
|
|
1630
|
+
// return
|
|
1631
|
+
// }
|
|
1632
|
+
// uiLayer.appendChild(widget);
|
|
1633
|
+
// }
|
|
1621
1634
|
addWidget(widget) {
|
|
1622
|
-
if (!this.
|
|
1635
|
+
if (!this.uiDom)
|
|
1623
1636
|
return;
|
|
1624
|
-
|
|
1625
|
-
if (!uiLayer) {
|
|
1626
|
-
console.warn("UI Layer not found, check your settings.");
|
|
1627
|
-
return;
|
|
1628
|
-
}
|
|
1629
|
-
uiLayer.appendChild(widget);
|
|
1637
|
+
widget.mount(this.uiDom);
|
|
1630
1638
|
}
|
|
1631
1639
|
setupPostProcess() {
|
|
1632
1640
|
if (this.postProcessParam.steps.length === 0) {
|
|
@@ -2110,10 +2118,13 @@ class Controller {
|
|
|
2110
2118
|
}
|
|
2111
2119
|
updateCamera() {
|
|
2112
2120
|
var _a, _b;
|
|
2121
|
+
console.log("update camera");
|
|
2122
|
+
let isPawnEnabled = this.pawn.enabled;
|
|
2113
2123
|
(_a = this._pawn) === null || _a === void 0 ? void 0 : _a.unpossess();
|
|
2114
2124
|
(_b = this._pawn) === null || _b === void 0 ? void 0 : _b.destroy();
|
|
2115
2125
|
this._pawn = new Orbital(this);
|
|
2116
2126
|
this.pawn.possess();
|
|
2127
|
+
this.pawn.enabled = isPawnEnabled;
|
|
2117
2128
|
}
|
|
2118
2129
|
init() {
|
|
2119
2130
|
if (this.viewPort.canvas) {
|
|
@@ -2956,9 +2967,9 @@ class ThreeJsApp {
|
|
|
2956
2967
|
this._camera = CameraFactory.updataCamera(param, this.camera);
|
|
2957
2968
|
if (previousCam !== this.camera) {
|
|
2958
2969
|
this._onCameraChangedDelegate.broadcast();
|
|
2970
|
+
this.controller.updateCamera();
|
|
2959
2971
|
}
|
|
2960
2972
|
this._camera.updateProjectionMatrix();
|
|
2961
|
-
this.controller.updateCamera();
|
|
2962
2973
|
this.viewport.markRenderStateDirty();
|
|
2963
2974
|
}
|
|
2964
2975
|
onWindowResize(width, height) {
|
|
@@ -3,7 +3,9 @@ import { ThreeJsApp } from "../ThreeJsApp";
|
|
|
3
3
|
import { PostProcessParam, PostProcessStepParam } from './../PostProcess/PostProcessParam';
|
|
4
4
|
import { RendererParameters } from './Parameters/RendererParameters';
|
|
5
5
|
import { ViewportParam } from './Parameters/ViewportParameters';
|
|
6
|
+
import { Widget } from "@/script/scene/Editor/Widget/Widget";
|
|
6
7
|
export declare class Viewport {
|
|
8
|
+
protected uiDom: HTMLDivElement | null;
|
|
7
9
|
get canvas(): HTMLElement | null;
|
|
8
10
|
get renderer(): WebGPURenderer;
|
|
9
11
|
get app(): ThreeJsApp;
|
|
@@ -21,7 +23,7 @@ export declare class Viewport {
|
|
|
21
23
|
protected createLabelRenderer(): void;
|
|
22
24
|
protected createUILayer(): void;
|
|
23
25
|
init(): void;
|
|
24
|
-
addWidget(widget:
|
|
26
|
+
addWidget(widget: Widget): void;
|
|
25
27
|
setupPostProcess(): void;
|
|
26
28
|
updatePostProcess(steps: PostProcessStepParam[]): void;
|
|
27
29
|
updateRendererSettings(data: RendererParameters): void;
|