lythreeframe 1.0.47 → 1.0.49

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.
@@ -1435,9 +1435,6 @@ const DefaultOutlineParams = {
1435
1435
 
1436
1436
  class Viewport {
1437
1437
  get canvas() {
1438
- if (!this._canvas) {
1439
- throw Error("Canvas is not initialized");
1440
- }
1441
1438
  return this._canvas;
1442
1439
  }
1443
1440
  get renderer() {
@@ -2019,14 +2016,13 @@ class Controller {
2019
2016
  this._pawn = new Orbital(this);
2020
2017
  this.pawn.possess();
2021
2018
  this.raycaster = new webgpu.Raycaster();
2022
- if (!this.viewPort.canvas) {
2023
- throw Error("canvas is null");
2019
+ if (this.viewPort.canvas) {
2020
+ this.viewPort.canvas.addEventListener("pointermove", this.onPointerMove);
2021
+ this.viewPort.canvas.addEventListener("pointerenter", this.onPointerEnter);
2022
+ this.viewPort.canvas.addEventListener("pointerleave", this.onPointerLeave);
2023
+ this.viewPort.canvas.addEventListener("pointerup", this.onPointerUp);
2024
+ this.viewPort.canvas.addEventListener("pointerdown", this.onPointerDown);
2024
2025
  }
2025
- this.viewPort.canvas.addEventListener("pointermove", this.onPointerMove);
2026
- this.viewPort.canvas.addEventListener("pointerenter", this.onPointerEnter);
2027
- this.viewPort.canvas.addEventListener("pointerleave", this.onPointerLeave);
2028
- this.viewPort.canvas.addEventListener("pointerup", this.onPointerUp);
2029
- this.viewPort.canvas.addEventListener("pointerdown", this.onPointerDown);
2030
2026
  }
2031
2027
  init() {
2032
2028
  }
@@ -1433,9 +1433,6 @@ const DefaultOutlineParams = {
1433
1433
 
1434
1434
  class Viewport {
1435
1435
  get canvas() {
1436
- if (!this._canvas) {
1437
- throw Error("Canvas is not initialized");
1438
- }
1439
1436
  return this._canvas;
1440
1437
  }
1441
1438
  get renderer() {
@@ -2017,14 +2014,13 @@ class Controller {
2017
2014
  this._pawn = new Orbital(this);
2018
2015
  this.pawn.possess();
2019
2016
  this.raycaster = new Raycaster();
2020
- if (!this.viewPort.canvas) {
2021
- throw Error("canvas is null");
2017
+ if (this.viewPort.canvas) {
2018
+ this.viewPort.canvas.addEventListener("pointermove", this.onPointerMove);
2019
+ this.viewPort.canvas.addEventListener("pointerenter", this.onPointerEnter);
2020
+ this.viewPort.canvas.addEventListener("pointerleave", this.onPointerLeave);
2021
+ this.viewPort.canvas.addEventListener("pointerup", this.onPointerUp);
2022
+ this.viewPort.canvas.addEventListener("pointerdown", this.onPointerDown);
2022
2023
  }
2023
- this.viewPort.canvas.addEventListener("pointermove", this.onPointerMove);
2024
- this.viewPort.canvas.addEventListener("pointerenter", this.onPointerEnter);
2025
- this.viewPort.canvas.addEventListener("pointerleave", this.onPointerLeave);
2026
- this.viewPort.canvas.addEventListener("pointerup", this.onPointerUp);
2027
- this.viewPort.canvas.addEventListener("pointerdown", this.onPointerDown);
2028
2024
  }
2029
2025
  init() {
2030
2026
  }
@@ -11,7 +11,7 @@ import { Object3D } from 'three/src/Three.WebGPU.Nodes.js';
11
11
  import { DOFParam } from '../PostProcess/Param/DOF';
12
12
  import { ViewportParam } from './Parameters/ViewportParameters';
13
13
  export declare class Viewport {
14
- get canvas(): HTMLElement;
14
+ get canvas(): HTMLElement | null;
15
15
  get renderer(): WebGPURenderer;
16
16
  get app(): ThreeJsApp;
17
17
  private _renderer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lythreeframe",
3
- "version": "1.0.47",
3
+ "version": "1.0.49",
4
4
  "description": "Three.js 封装",
5
5
  "main": "dist/bundle.cjs.js",
6
6
  "module": "dist/bundle.esm.js",