lythreeframe 1.2.41 → 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.
|
|
1625
|
-
return;
|
|
1626
|
-
let uiLayer = this._canvas.querySelector('.scene-uiLayer');
|
|
1627
|
-
if (!uiLayer) {
|
|
1628
|
-
console.warn("UI Layer not found, check your settings.");
|
|
1637
|
+
if (!this.uiDom)
|
|
1629
1638
|
return;
|
|
1630
|
-
|
|
1631
|
-
uiLayer.appendChild(widget);
|
|
1639
|
+
widget.mount(this.uiDom);
|
|
1632
1640
|
}
|
|
1633
1641
|
setupPostProcess() {
|
|
1634
1642
|
if (this.postProcessParam.steps.length === 0) {
|
|
@@ -2110,6 +2118,16 @@ class Controller {
|
|
|
2110
2118
|
this.pawn.possess();
|
|
2111
2119
|
this.raycaster = new webgpu.Raycaster();
|
|
2112
2120
|
}
|
|
2121
|
+
updateCamera() {
|
|
2122
|
+
var _a, _b;
|
|
2123
|
+
console.log("update camera");
|
|
2124
|
+
let isPawnEnabled = this.pawn.enabled;
|
|
2125
|
+
(_a = this._pawn) === null || _a === void 0 ? void 0 : _a.unpossess();
|
|
2126
|
+
(_b = this._pawn) === null || _b === void 0 ? void 0 : _b.destroy();
|
|
2127
|
+
this._pawn = new Orbital(this);
|
|
2128
|
+
this.pawn.possess();
|
|
2129
|
+
this.pawn.enabled = isPawnEnabled;
|
|
2130
|
+
}
|
|
2113
2131
|
init() {
|
|
2114
2132
|
if (this.viewPort.canvas) {
|
|
2115
2133
|
this.viewPort.canvas.addEventListener("pointermove", this.onPointerMove);
|
|
@@ -2951,6 +2969,7 @@ class ThreeJsApp {
|
|
|
2951
2969
|
this._camera = CameraFactory.updataCamera(param, this.camera);
|
|
2952
2970
|
if (previousCam !== this.camera) {
|
|
2953
2971
|
this._onCameraChangedDelegate.broadcast();
|
|
2972
|
+
this.controller.updateCamera();
|
|
2954
2973
|
}
|
|
2955
2974
|
this._camera.updateProjectionMatrix();
|
|
2956
2975
|
this.viewport.markRenderStateDirty();
|
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.
|
|
1623
|
-
return;
|
|
1624
|
-
let uiLayer = this._canvas.querySelector('.scene-uiLayer');
|
|
1625
|
-
if (!uiLayer) {
|
|
1626
|
-
console.warn("UI Layer not found, check your settings.");
|
|
1635
|
+
if (!this.uiDom)
|
|
1627
1636
|
return;
|
|
1628
|
-
|
|
1629
|
-
uiLayer.appendChild(widget);
|
|
1637
|
+
widget.mount(this.uiDom);
|
|
1630
1638
|
}
|
|
1631
1639
|
setupPostProcess() {
|
|
1632
1640
|
if (this.postProcessParam.steps.length === 0) {
|
|
@@ -2108,6 +2116,16 @@ class Controller {
|
|
|
2108
2116
|
this.pawn.possess();
|
|
2109
2117
|
this.raycaster = new Raycaster();
|
|
2110
2118
|
}
|
|
2119
|
+
updateCamera() {
|
|
2120
|
+
var _a, _b;
|
|
2121
|
+
console.log("update camera");
|
|
2122
|
+
let isPawnEnabled = this.pawn.enabled;
|
|
2123
|
+
(_a = this._pawn) === null || _a === void 0 ? void 0 : _a.unpossess();
|
|
2124
|
+
(_b = this._pawn) === null || _b === void 0 ? void 0 : _b.destroy();
|
|
2125
|
+
this._pawn = new Orbital(this);
|
|
2126
|
+
this.pawn.possess();
|
|
2127
|
+
this.pawn.enabled = isPawnEnabled;
|
|
2128
|
+
}
|
|
2111
2129
|
init() {
|
|
2112
2130
|
if (this.viewPort.canvas) {
|
|
2113
2131
|
this.viewPort.canvas.addEventListener("pointermove", this.onPointerMove);
|
|
@@ -2949,6 +2967,7 @@ class ThreeJsApp {
|
|
|
2949
2967
|
this._camera = CameraFactory.updataCamera(param, this.camera);
|
|
2950
2968
|
if (previousCam !== this.camera) {
|
|
2951
2969
|
this._onCameraChangedDelegate.broadcast();
|
|
2970
|
+
this.controller.updateCamera();
|
|
2952
2971
|
}
|
|
2953
2972
|
this._camera.updateProjectionMatrix();
|
|
2954
2973
|
this.viewport.markRenderStateDirty();
|
|
@@ -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;
|