lythreeframe 1.2.50 → 1.2.52

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/index.d.ts CHANGED
@@ -37,8 +37,6 @@ export { DirectionalLightComponent } from "./lythreeframe/Object/Components/Ligh
37
37
  export { AmbientLightComponent } from './lythreeframe/Object/Components/Light/AmbientLight/AmbientLightComponent';
38
38
  export { LabelComponent } from "./lythreeframe/Object/Components/2D/2DComponent";
39
39
  export { SkyComponent } from "./lythreeframe/Object/Components/Sky/SkyComponent";
40
- export { CurveComponent } from './lythreeframe/Object/Components/Curve/CurveComponent';
41
- export type { CurveComponetSetup } from './lythreeframe/Object/Components/Curve/CurveComponent';
42
40
  export type { SkyComponentParam } from "./lythreeframe/Object/Components/Sky/SkyComponent";
43
41
  export { DefaultSkyParam } from "./lythreeframe/Object/Components/Sky/SkyComponent";
44
42
  export { WebGPUPostProcessFactory } from "./lythreeframe/PostProcess/WebGPUPostProcessFactory";
@@ -60,7 +58,6 @@ export { DefaultSSRParam } from "./lythreeframe/PostProcess/Param/SSR";
60
58
  export type { SSRParam } from "./lythreeframe/PostProcess/Param/SSR";
61
59
  export { DefaultAAParams } from "./lythreeframe/PostProcess/Param/AAParam";
62
60
  export type { AAParams } from "./lythreeframe/PostProcess/Param/AAParam";
63
- export { Pawn } from "./lythreeframe/Object/PawnV2/Pawn";
64
61
  export { Orbital } from "./lythreeframe/Object/PawnV2/Oribital";
65
62
  export { FirstPerson } from "./lythreeframe/Object/PawnV2/FirstPerson";
66
63
  export type { ITransforming } from "./lythreeframe/Object/PawnV2/TransformControl";
@@ -19,13 +19,13 @@ export declare class AssetManager {
19
19
  get LoadingManager(): LoadingManager;
20
20
  init(): Promise<void>;
21
21
  setupDracoLoader(dracoPath: string): void;
22
- convertThreeObjectToLYObject(parentLYComponent: SceneComponent, threejsObject: any): SceneComponent | null;
22
+ convertThreeObjectToLYObject(parentLYComponent: SceneComponent, threejsObject: Object3D): SceneComponent | null;
23
23
  collectResourcesAndReferences(object: Object3D): void;
24
24
  checkMeshResource(mesh: Mesh): void;
25
25
  loadGltfFromPathAsync(path: string): Promise<GLTF>;
26
26
  loadGltfFromPath(path: string, onLoadFinished: (gltf: GLTF) => void): void;
27
27
  loadGltfFromBuffer(data: ArrayBuffer | string, path: string, onLoadFinished: (gltf: GLTF) => void): void;
28
- loadFile(filepath: string | undefined, onLoadFinished: (data: any) => void): void;
28
+ loadFile(filepath: string | undefined, onLoadFinished: (data: string | ArrayBuffer) => void): void;
29
29
  addAsset(asset: BufferGeometry | Material | Texture, referenceCount?: number): TAssetPointer<BufferGeometry | Material | Texture> | undefined;
30
30
  addMaterialAsset(asset: Material, referenceCount?: number): MaterialAssetPointer;
31
31
  addTextureAsset(asset: Texture, referenceCount?: number): TextureAssetPointer;
@@ -40,5 +40,4 @@ export declare class Controller {
40
40
  getHitResultUnderCursor(): Intersection | null;
41
41
  getHitResultFromScreenPoint(x: number, y: number): Intersection | null;
42
42
  focusTo(targetPos: Vector3, targetQuat: Quaternion | Euler, distance: number, time: number, onGoing?: (() => void) | null, onFinished?: (() => void) | null): void;
43
- setPawn(pawn: Pawn): void;
44
43
  }
@@ -7,7 +7,6 @@ import { ViewportParam } from "./ViewportParameters";
7
7
  import { AssetManager } from "../../AssetManagement/AssetManager";
8
8
  import { PostProcessParam } from "../../PostProcess/PostProcessParam";
9
9
  import { RendererParameters } from "./RendererParameters";
10
- import { ControllerParameters } from "./ControllerParameters";
11
10
  export interface AppClass {
12
11
  assetManagerClass: typeof AssetManager;
13
12
  controllerClass: typeof Controller;
@@ -20,7 +19,6 @@ export interface AppParam {
20
19
  postProcessParam?: PostProcessParam;
21
20
  worldParam?: WorldParam;
22
21
  viewportParam: ViewportParam;
23
- controllerParam?: ControllerParameters;
24
22
  classes?: AppClass;
25
23
  isRenderEveryFrame?: boolean;
26
24
  }
@@ -2,6 +2,5 @@ export interface ViewportParam {
2
2
  elementId: string | null;
3
3
  isLabelRendererNeeded: boolean;
4
4
  isUILayerNeeded: boolean;
5
- usingWebGLRenderer?: boolean;
6
5
  }
7
6
  export declare const DefaultViewportParam: ViewportParam;
@@ -1,19 +1,16 @@
1
- import { Object3D, ShadowMapType, ToneMapping } from "three";
2
- import { WebGPURenderer } from "three/webgpu";
1
+ import { ShadowMapType, ToneMapping, WebGPURenderer, Object3D } from "three/webgpu";
3
2
  import { ThreeJsApp } from "../ThreeJsApp";
4
3
  import { PostProcessParam, PostProcessStepParam } from './../PostProcess/PostProcessParam';
5
4
  import { RendererParameters } from './Parameters/RendererParameters';
6
5
  import { ViewportParam } from './Parameters/ViewportParameters';
7
- import { WebGLRenderer } from "three";
8
6
  export declare class Viewport {
9
7
  get uiDom(): HTMLDivElement | null;
10
8
  protected _uiDom: HTMLDivElement | null;
11
9
  get canvas(): HTMLElement | null;
12
10
  get outer(): HTMLElement | null;
13
- get renderer(): WebGPURenderer | WebGLRenderer;
11
+ get renderer(): WebGPURenderer;
14
12
  get app(): ThreeJsApp;
15
13
  private _renderer;
16
- private _webGLRenderer;
17
14
  private labelRenderer;
18
15
  protected _app: ThreeJsApp | null;
19
16
  private resizeObserver;
@@ -22,10 +19,9 @@ export declare class Viewport {
22
19
  private isRenderStateDirty;
23
20
  private postProcessParam;
24
21
  private postProcessing;
25
- private viewportParam;
26
22
  private outlineObjects;
27
23
  constructor(app: ThreeJsApp, viewportParam: ViewportParam, rendererParam: RendererParameters, postProcessParam: PostProcessParam);
28
- protected createRenderer(rendererParam: RendererParameters): Promise<void>;
24
+ protected createRenderer(rendererParam: RendererParameters): void;
29
25
  protected createLabelRenderer(): void;
30
26
  protected createUILayer(): void;
31
27
  init(): void;
@@ -1,9 +1,9 @@
1
- import { Vector3, Quaternion, Euler, Matrix4 } from "three/webgpu";
2
- import { BaseObject } from "./BaseObject";
1
+ import { Euler, Matrix4, Quaternion, Vector3 } from "three/webgpu";
3
2
  import { AttachmentRules } from "../Defines";
4
- import { SceneComponent } from "./Components/SceneComponent";
3
+ import { BaseObject } from "./BaseObject";
5
4
  import { World } from "../Frame/World";
6
5
  import { ThreeJsApp } from "../ThreeJsApp";
6
+ import { SceneComponent } from "./Components/SceneComponent";
7
7
  export declare class Actor extends BaseObject {
8
8
  get world(): World | null;
9
9
  get name(): string;
@@ -1,5 +1,5 @@
1
1
  import { LightComponent } from "../LightComponent";
2
- import { ColorRepresentation, AmbientLight, Vector3 } from "three";
2
+ import { ColorRepresentation, AmbientLight, Vector3 } from "three/webgpu";
3
3
  import { World } from "../../../../Frame/World";
4
4
  import { ThreeJsApp } from "../../../../ThreeJsApp";
5
5
  export declare class AmbientLightComponent extends LightComponent {
@@ -1,4 +1,4 @@
1
- import { PostProcessStepType, type PostProcessStepParam } from "../PostProcessParam";
1
+ import { PostProcessStepParam, PostProcessStepType } from "../PostProcessParam";
2
2
  export interface AAParams extends PostProcessStepParam {
3
3
  type: PostProcessStepType.Antialiasing;
4
4
  method: "fxaa" | "smaa";
@@ -1,4 +1,4 @@
1
- import { type PostProcessStepParam, PostProcessStepType } from "../PostProcessParam";
1
+ import { PostProcessStepParam, PostProcessStepType } from "../PostProcessParam";
2
2
  export interface BloomParam extends PostProcessStepParam {
3
3
  type: PostProcessStepType.Bloom;
4
4
  threshold: number;
@@ -1,4 +1,4 @@
1
- import { type PostProcessStepParam, PostProcessStepType } from "../PostProcessParam";
1
+ import { PostProcessStepParam, PostProcessStepType } from "../PostProcessParam";
2
2
  export interface DOFParam extends PostProcessStepParam {
3
3
  type: PostProcessStepType.DepthOfField;
4
4
  focus: number;
@@ -1,4 +1,4 @@
1
- import { type PostProcessStepParam, PostProcessStepType } from "../PostProcessParam";
1
+ import { PostProcessStepParam, PostProcessStepType } from "../PostProcessParam";
2
2
  export interface DenoiseParam {
3
3
  denoiseRadius: number;
4
4
  lumaPhi: number;
@@ -1,5 +1,5 @@
1
- import type { ColorRepresentation } from "three";
2
- import { type PostProcessStepParam, PostProcessStepType } from "../PostProcessParam";
1
+ import { ColorRepresentation } from "three/webgpu";
2
+ import { PostProcessStepParam, PostProcessStepType } from "../PostProcessParam";
3
3
  export interface OutlineParams extends PostProcessStepParam {
4
4
  type: PostProcessStepType.Outline;
5
5
  edgeStrength: number;
@@ -1,4 +1,4 @@
1
- import { type PostProcessStepParam, PostProcessStepType } from "../PostProcessParam";
1
+ import { PostProcessStepParam, PostProcessStepType } from "../PostProcessParam";
2
2
  export interface SSRParam extends PostProcessStepParam {
3
3
  type: PostProcessStepType.ScreenSpaceReflection;
4
4
  maxDistance: number;
@@ -1,10 +1,10 @@
1
- import { type OutlineParams } from './Param/Outline';
1
+ import { OutlineParams } from './Param/Outline';
2
2
  import { Scene, Camera, Object3D, PassNode, Node } from "three/webgpu";
3
- import { type BloomParam } from "./Param/Bloom";
4
- import { type DOFParam } from "./Param/DOF";
5
- import { type GTAOParam } from "./Param/GTAO";
6
- import { type SSRParam } from "./Param/SSR";
7
- import { type DenoiseParam } from './Param/GTAO';
3
+ import { BloomParam } from "./Param/Bloom";
4
+ import { DOFParam } from "./Param/DOF";
5
+ import { GTAOParam } from "./Param/GTAO";
6
+ import { SSRParam } from "./Param/SSR";
7
+ import { DenoiseParam } from './Param/GTAO';
8
8
  import { ShaderNodeObject, NodeRepresentation } from 'three/tsl';
9
9
  import DepthOfFieldNode from 'three/addons/tsl/display/DepthOfFieldNode.js';
10
10
  import BloomNode from 'three/examples/jsm/tsl/display/BloomNode.js';
@@ -6,12 +6,13 @@ import { Delegate } from './Delegate';
6
6
  import { CameraParam } from './Frame/Parameters/CameraParameter';
7
7
  import { AppParam } from './Frame/Parameters/AppParameter';
8
8
  import { AssetManager } from './AssetManagement/AssetManager';
9
- /**
10
- * Three.js应用程序主类
11
- * 负责管理场景、视口、控制器和资源
12
- */
13
9
  export declare class ThreeJsApp {
14
- private animationFrameHandle;
10
+ get camera(): PerspectiveCamera | OrthographicCamera;
11
+ get clock(): Clock;
12
+ get world(): World;
13
+ get viewport(): Viewport;
14
+ get controller(): Controller;
15
+ get assetManager(): AssetManager;
15
16
  protected _clock: Clock;
16
17
  protected _camera: PerspectiveCamera | OrthographicCamera;
17
18
  protected _world: World;
@@ -19,71 +20,18 @@ export declare class ThreeJsApp {
19
20
  protected _controller: Controller;
20
21
  protected _assetManager: AssetManager;
21
22
  protected _tickingFunctions: Array<(delta: number) => void>;
22
- protected _appParam: AppParam;
23
- protected _onCameraChangedDelegate: Delegate<[void]>;
24
- get camera(): PerspectiveCamera | OrthographicCamera;
25
- get clock(): Clock;
26
- get world(): World;
27
- get viewport(): Viewport;
28
- get controller(): Controller;
29
- get assetManager(): AssetManager;
30
23
  get appParam(): AppParam;
24
+ protected _appParam: AppParam;
31
25
  get onCameraChangedDelegate(): Delegate<[void]>;
32
- /**
33
- * 构造ThreeJs应用程序实例
34
- * @param appParam 应用程序参数配置
35
- */
26
+ protected _onCameraChangedDelegate: Delegate<[void]>;
36
27
  constructor(appParam?: AppParam);
37
- /**
38
- * 构造后初始化钩子
39
- * 按顺序初始化控制器、世界和视口
40
- */
41
28
  protected postConstruct(): void;
42
- /**
43
- * 公共初始化方法
44
- * 可由子类重写以添加自定义初始化逻辑
45
- */
46
29
  init(): void;
47
- /**
48
- * 启动动画循环
49
- * 使用延迟启动以确保所有组件完全初始化
50
- */
51
- protected startAnimationLoop(): void;
52
- /**
53
- * 每帧更新方法
54
- * @param deltaTime 距离上一帧的时间增量(秒)
55
- */
56
30
  protected tick(deltaTime: number): void;
57
- /**
58
- * 添加每帧执行的函数
59
- * @param func 接收deltaTime参数的回调函数
60
- */
61
31
  addTickingFunction(func: (deltaTime: number) => void): void;
62
- /**
63
- * 移除已注册的tick函数
64
- * @param func 要移除的函数引用
65
- */
66
32
  removeTickingFunction(func: (deltaTime: number) => void): void;
67
- /**
68
- * 销毁应用程序并清理所有资源
69
- */
70
33
  destroy(): void;
71
- /**
72
- * 更新相机参数
73
- * @param param 新的相机参数
74
- */
75
34
  updateCamera(param: CameraParam): void;
76
- /**
77
- * 窗口大小改变时的处理
78
- * @param width 新的宽度
79
- * @param height 新的高度
80
- */
81
35
  onWindowResize(width: number, height: number): void;
82
- /**
83
- * 将当前场景渲染为图片
84
- * @param width 图片宽度,默认1024
85
- * @param height 图片高度,默认1024
86
- * @returns 图片的DataURL
87
- */
88
36
  renderAsImage(width?: number, height?: number): Promise<string>;
89
37
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lythreeframe",
3
- "version": "1.2.50",
3
+ "version": "1.2.52",
4
4
  "description": "Three.js 封装",
5
5
  "main": "dist/bundle.cjs.js",
6
6
  "module": "dist/bundle.esm.js",