lythreeframe 1.3.14 → 2.0.1
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 +100 -60
- package/dist/bundle.cjs.js.map +1 -1
- package/dist/bundle.esm.js +95 -64
- package/dist/bundle.esm.js.map +1 -1
- package/dist/index.d.ts +8 -2
- package/dist/src/AssetManagement/AssetManager.d.ts +14 -10
- package/dist/src/Frame/Controller.d.ts +54 -12
- package/dist/src/Frame/Parameters/AppParameter.d.ts +0 -2
- package/dist/src/Frame/Parameters/ViewportParameters.d.ts +15 -2
- package/dist/src/Frame/Rendering/WebGLPostProcess.d.ts +41 -0
- package/dist/src/Frame/Viewport.d.ts +12 -14
- package/dist/src/Frame/World.d.ts +7 -1
- package/dist/src/Object/Actor.d.ts +1 -0
- package/dist/src/Object/Components/2D/2DComponent.d.ts +5 -1
- package/dist/src/Object/Components/2D/CSS3DWebPanelComponent.d.ts +26 -0
- package/dist/src/Object/Components/2D/SpiriteComponent.d.ts +15 -0
- package/dist/src/Object/Components/Mesh/Line/CurveComponent.d.ts +18 -0
- package/dist/src/Object/Components/Text/Text3DComponent.d.ts +56 -0
- package/dist/src/Object/PawnV2/FirstPerson.d.ts +52 -6
- package/dist/src/Object/PawnV2/Oribital.d.ts +38 -15
- package/dist/src/Object/PawnV2/Pawn.d.ts +12 -11
- package/dist/src/Object/PawnV2/Spectator.d.ts +19 -0
- package/dist/src/Object/PawnV2/TopDown.d.ts +56 -0
- package/dist/src/Object/PawnV2/TransformControl.d.ts +7 -3
- package/dist/src/Physics/BoxColliderComponent.d.ts +22 -0
- package/dist/src/Physics/CapsuleColliderComponent.d.ts +40 -0
- package/dist/src/Physics/ColliderComponent.d.ts +62 -0
- package/dist/src/Physics/CollisionTypes.d.ts +17 -0
- package/dist/src/Physics/MeshColliderComponent.d.ts +44 -0
- package/dist/src/Physics/PhysicsWorld.d.ts +36 -0
- package/dist/src/Physics/SphereColliderComponent.d.ts +14 -0
- package/dist/src/Physics/index.d.ts +9 -0
- package/dist/src/ThreeJsApp.d.ts +5 -5
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -21,8 +21,7 @@ export type { ViewportParam } from './src/Frame/Parameters/ViewportParameters';
|
|
|
21
21
|
export { DefaultViewportParam } from './src/Frame/Parameters/ViewportParameters';
|
|
22
22
|
export type { WorldParam } from "./src/Frame/Parameters/WorldParameter";
|
|
23
23
|
export { DefaultWorldParam } from "./src/Frame/Parameters/WorldParameter";
|
|
24
|
-
export
|
|
25
|
-
export { DefaultRendererParameters } from './src/Frame/Parameters/RendererParameters';
|
|
24
|
+
export { RendererType } from './src/Frame/Parameters/ViewportParameters';
|
|
26
25
|
export { Actor } from "./src/Object/Actor";
|
|
27
26
|
export { DirectionalLightActor } from "./src/Object/Actors/Light/DirectionalLightActor";
|
|
28
27
|
export { AmbientLightActor } from './src/Object/Actors/Light/AmbientLightActor';
|
|
@@ -42,6 +41,9 @@ export { LevelComponent } from "./src/Object/Components/Level/LevelComponent";
|
|
|
42
41
|
export { DirectionalLightComponent } from "./src/Object/Components/Light/DirectionalLight/DirectionalLightComponent";
|
|
43
42
|
export { AmbientLightComponent } from './src/Object/Components/Light/AmbientLight/AmbientLightComponent';
|
|
44
43
|
export { LabelComponent } from "./src/Object/Components/2D/2DComponent";
|
|
44
|
+
export { CSS3DWebPanelComponent } from "./src/Object/Components/2D/CSS3DWebPanelComponent";
|
|
45
|
+
export { Text3DComponent } from "./src/Object/Components/Text/Text3DComponent";
|
|
46
|
+
export type { Text3DOptions } from "./src/Object/Components/Text/Text3DComponent";
|
|
45
47
|
export { SkyComponent } from "./src/Object/Components/Sky/SkyComponent";
|
|
46
48
|
export type { SkyComponentParam } from "./src/Object/Components/Sky/SkyComponent";
|
|
47
49
|
export { DefaultSkyParam } from "./src/Object/Components/Sky/SkyComponent";
|
|
@@ -66,8 +68,12 @@ export type { LensFlareParam } from "./src/PostProcess/Param/LensFlare";
|
|
|
66
68
|
export { PostProcessManager } from "./src/Frame/Rendering/PostProcess";
|
|
67
69
|
export { Orbital } from "./src/Object/PawnV2/Oribital";
|
|
68
70
|
export { FirstPerson } from "./src/Object/PawnV2/FirstPerson";
|
|
71
|
+
export { Spectator } from "./src/Object/PawnV2/Spectator";
|
|
72
|
+
export { Pawn } from "./src/Object/PawnV2/Pawn";
|
|
69
73
|
export type { ITransforming } from "./src/Object/PawnV2/TransformControl";
|
|
70
74
|
export type { TransformType } from "./src/Object/PawnV2/TransformControl";
|
|
71
75
|
export type { TransformGizmoOptions } from "./src/Object/PawnV2/TransformControl";
|
|
72
76
|
export { TransformGizmo } from "./src/Object/PawnV2/TransformControl";
|
|
73
77
|
export { ThreeObjectLibrary } from "./src/Library/ResourceLibrary";
|
|
78
|
+
export { PhysicsWorld, ColliderComponent, BoxColliderComponent, SphereColliderComponent, CapsuleColliderComponent, MeshColliderComponent, CollisionResponse, CollisionChannel, CollisionShapeType } from "./src/Physics";
|
|
79
|
+
export type { LineTraceHitResult, PhysicsHitResult, CollisionResponseMap } from "./src/Physics";
|
|
@@ -1,23 +1,26 @@
|
|
|
1
|
-
import { BufferGeometry, LoadingManager, Material, Mesh, Texture } from
|
|
2
|
-
import { SceneComponent } from
|
|
3
|
-
import { TAssetPointer } from
|
|
4
|
-
import { DRACOLoader, GLTF, GLTFLoader } from 'three/examples/jsm/Addons.js';
|
|
5
|
-
import { Object3D } from
|
|
6
|
-
import { ThreeJsApp } from
|
|
7
|
-
import { MaterialAssetPointer } from
|
|
8
|
-
import { TextureAssetPointer } from
|
|
9
|
-
import { GeometryAssetPointer } from
|
|
1
|
+
import { BufferGeometry, LoadingManager, Material, Mesh, Texture } from 'three/webgpu';
|
|
2
|
+
import { SceneComponent } from '../Object/Components/SceneComponent';
|
|
3
|
+
import { TAssetPointer } from './AssetPointer/AssetPointer';
|
|
4
|
+
import { DRACOLoader, GLTF, GLTFLoader, KTX2Loader } from 'three/examples/jsm/Addons.js';
|
|
5
|
+
import { Object3D } from 'three/webgpu';
|
|
6
|
+
import { ThreeJsApp } from '../ThreeJsApp';
|
|
7
|
+
import { MaterialAssetPointer } from './AssetPointer/Assets/MaterialAssetPointer';
|
|
8
|
+
import { TextureAssetPointer } from './AssetPointer/Assets/TextureAssetPointer';
|
|
9
|
+
import { GeometryAssetPointer } from './AssetPointer/Assets/GeometryAssetPointer';
|
|
10
10
|
export declare class AssetManager {
|
|
11
11
|
protected geometryAssets: Map<string, GeometryAssetPointer>;
|
|
12
12
|
protected textureAssets: Map<string, TextureAssetPointer>;
|
|
13
13
|
protected materialAssets: Map<string, MaterialAssetPointer>;
|
|
14
|
-
protected
|
|
14
|
+
protected static _dracoLoader: DRACOLoader | null;
|
|
15
|
+
protected static _ktx2Loader: KTX2Loader | null;
|
|
15
16
|
protected readonly gltfLoader: GLTFLoader;
|
|
16
17
|
protected readonly loadingManager: LoadingManager;
|
|
17
18
|
protected app: ThreeJsApp;
|
|
18
19
|
constructor(app: ThreeJsApp);
|
|
19
20
|
get LoadingManager(): LoadingManager;
|
|
21
|
+
get KTX2Loader(): KTX2Loader | null;
|
|
20
22
|
init(): Promise<void>;
|
|
23
|
+
setupKTX2Loader(transcoderPath: string): Promise<void>;
|
|
21
24
|
setupDracoLoader(dracoPath: string): void;
|
|
22
25
|
convertThreeObjectToLYObject(parentLYComponent: SceneComponent, threejsObject: Object3D): SceneComponent | null;
|
|
23
26
|
collectResourcesAndReferences(object: Object3D): void;
|
|
@@ -31,5 +34,6 @@ export declare class AssetManager {
|
|
|
31
34
|
addTextureAsset(asset: Texture, referenceCount?: number): TextureAssetPointer;
|
|
32
35
|
addGeometryAsset(asset: BufferGeometry, referenceCount?: number): GeometryAssetPointer;
|
|
33
36
|
releaseAsset(asset: BufferGeometry | Material | Texture): void;
|
|
37
|
+
dispose(): void;
|
|
34
38
|
clearAssets(): void;
|
|
35
39
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ThreeJsApp } from "../ThreeJsApp";
|
|
2
|
-
import { Euler, Intersection, OrthographicCamera, PerspectiveCamera, Quaternion, Raycaster, Vector2, Vector3 } from "three/webgpu";
|
|
2
|
+
import { Box3, Euler, Intersection, Object3D, OrthographicCamera, PerspectiveCamera, Quaternion, Raycaster, Vector2, Vector3 } from "three/webgpu";
|
|
3
3
|
import { World } from "./World";
|
|
4
4
|
import { Viewport } from "./Viewport";
|
|
5
5
|
import { Pawn } from "../Object/PawnV2/Pawn";
|
|
@@ -74,17 +74,36 @@ export declare class Controller {
|
|
|
74
74
|
protected _onActorHoverBeginDelegate: Delegate<[ActorHoverEvent]>;
|
|
75
75
|
protected _onActorHoverEndDelegate: Delegate<[ActorHoverEvent]>;
|
|
76
76
|
protected _onClickNothingDelegate: Delegate<[void]>;
|
|
77
|
+
protected _onPointerDownDelegate: Delegate<[PointerEvent]>;
|
|
78
|
+
protected _onPointerUpDelegate: Delegate<[PointerEvent]>;
|
|
79
|
+
protected _onPointerMoveDelegate: Delegate<[PointerEvent]>;
|
|
80
|
+
protected _onPointerCancelDelegate: Delegate<[PointerEvent]>;
|
|
81
|
+
protected _onWheelDelegate: Delegate<[WheelEvent]>;
|
|
82
|
+
protected _onKeyDownDelegate: Delegate<[KeyboardEvent]>;
|
|
83
|
+
protected _onKeyUpDelegate: Delegate<[KeyboardEvent]>;
|
|
84
|
+
protected _onContextMenuDelegate: Delegate<[MouseEvent]>;
|
|
85
|
+
protected _onPointerLockChangeDelegate: Delegate<[Event]>;
|
|
86
|
+
protected _onWindowBlurDelegate: Delegate<[Event]>;
|
|
87
|
+
protected _onRawClickDelegate: Delegate<[MouseEvent]>;
|
|
77
88
|
protected pointerPosition: Vector2;
|
|
78
89
|
protected pointerLeftDownPosition: Vector2;
|
|
79
90
|
protected readonly _tempVec2: Vector2;
|
|
80
91
|
protected readonly _raycastVec2: Vector2;
|
|
81
92
|
protected readonly doubleClickDelay: number;
|
|
82
93
|
protected leftClickTimer: number | null;
|
|
83
|
-
protected onPointerMove: (event:
|
|
84
|
-
protected onPointerEnter: (event:
|
|
85
|
-
protected onPointerLeave: (event:
|
|
86
|
-
protected onPointerUp: (event:
|
|
87
|
-
protected onPointerDown: (event:
|
|
94
|
+
protected onPointerMove: (event: PointerEvent) => void;
|
|
95
|
+
protected onPointerEnter: (event: PointerEvent) => void;
|
|
96
|
+
protected onPointerLeave: (event: PointerEvent) => void;
|
|
97
|
+
protected onPointerUp: (event: PointerEvent) => void;
|
|
98
|
+
protected onPointerDown: (event: PointerEvent) => void;
|
|
99
|
+
protected onPointerCancel: (event: PointerEvent) => void;
|
|
100
|
+
protected onWheel: (event: WheelEvent) => void;
|
|
101
|
+
protected onKeyDown: (event: KeyboardEvent) => void;
|
|
102
|
+
protected onKeyUp: (event: KeyboardEvent) => void;
|
|
103
|
+
protected onContextMenu: (event: MouseEvent) => void;
|
|
104
|
+
protected onPointerLockChange: (event: Event) => void;
|
|
105
|
+
protected onWindowBlur: (event: Event) => void;
|
|
106
|
+
protected onClick: (event: MouseEvent) => void;
|
|
88
107
|
get camera(): PerspectiveCamera | OrthographicCamera;
|
|
89
108
|
get world(): World;
|
|
90
109
|
get viewPort(): Viewport;
|
|
@@ -100,20 +119,40 @@ export declare class Controller {
|
|
|
100
119
|
get onActorHoverBeginDelegate(): Delegate<[ActorHoverEvent]>;
|
|
101
120
|
get onActorHoverEndDelegate(): Delegate<[ActorHoverEvent]>;
|
|
102
121
|
get onClickNothingDelegate(): Delegate<[void]>;
|
|
122
|
+
get onPointerDownDelegate(): Delegate<[PointerEvent]>;
|
|
123
|
+
get onPointerUpDelegate(): Delegate<[PointerEvent]>;
|
|
124
|
+
get onPointerMoveDelegate(): Delegate<[PointerEvent]>;
|
|
125
|
+
get onPointerCancelDelegate(): Delegate<[PointerEvent]>;
|
|
126
|
+
get onWheelDelegate(): Delegate<[WheelEvent]>;
|
|
127
|
+
get onKeyDownDelegate(): Delegate<[KeyboardEvent]>;
|
|
128
|
+
get onKeyUpDelegate(): Delegate<[KeyboardEvent]>;
|
|
129
|
+
get onContextMenuDelegate(): Delegate<[MouseEvent]>;
|
|
130
|
+
get onPointerLockChangeDelegate(): Delegate<[Event]>;
|
|
131
|
+
get onWindowBlurDelegate(): Delegate<[Event]>;
|
|
132
|
+
get onRawClickDelegate(): Delegate<[MouseEvent]>;
|
|
103
133
|
constructor(app: ThreeJsApp);
|
|
134
|
+
createInitialPawn(): void;
|
|
104
135
|
init(): void;
|
|
105
136
|
updateCamera(): void;
|
|
106
|
-
switchPawn(pawn: Pawn, cameraMoveTime?: number): void
|
|
137
|
+
switchPawn(pawn: Pawn, cameraMoveTime?: number): Promise<void>;
|
|
107
138
|
tick(deltaTime: number): void;
|
|
108
139
|
destroy(): void;
|
|
109
|
-
protected onPointerMoveEvent(event:
|
|
140
|
+
protected onPointerMoveEvent(event: PointerEvent): void;
|
|
110
141
|
protected clearHovering(): void;
|
|
111
|
-
protected onPointerUpEvent(event:
|
|
142
|
+
protected onPointerUpEvent(event: PointerEvent): void;
|
|
112
143
|
protected handleFirstClick(): void;
|
|
113
144
|
protected handleDoubleClick(): void;
|
|
114
|
-
protected onPointerDownEvent(event:
|
|
115
|
-
protected onPointerEnterEvent(_event:
|
|
116
|
-
protected onPointerLeaveEvent(_event:
|
|
145
|
+
protected onPointerDownEvent(event: PointerEvent): void;
|
|
146
|
+
protected onPointerEnterEvent(_event: PointerEvent): void;
|
|
147
|
+
protected onPointerLeaveEvent(_event: PointerEvent): void;
|
|
148
|
+
protected onPointerCancelEvent(event: PointerEvent): void;
|
|
149
|
+
protected onWheelEvent(event: WheelEvent): void;
|
|
150
|
+
protected onKeyDownEvent(event: KeyboardEvent): void;
|
|
151
|
+
protected onKeyUpEvent(event: KeyboardEvent): void;
|
|
152
|
+
protected onContextMenuEvent(event: MouseEvent): void;
|
|
153
|
+
protected onPointerLockChangeEvent(event: Event): void;
|
|
154
|
+
protected onWindowBlurEvent(event: Event): void;
|
|
155
|
+
protected onClickEvent(event: MouseEvent): void;
|
|
117
156
|
protected fireComponentHoverBegin(component: SceneComponent, hit: Intersection): void;
|
|
118
157
|
protected fireComponentHoverEnd(component: SceneComponent): void;
|
|
119
158
|
protected fireComponentClick(component: SceneComponent, hit: Intersection, isDoubleClick: boolean): void;
|
|
@@ -127,6 +166,9 @@ export declare class Controller {
|
|
|
127
166
|
protected removeCorePointerListeners(): void;
|
|
128
167
|
getHitResultUnderCursor(checkInteractable?: boolean): HitResult | null;
|
|
129
168
|
getHitResultFromScreenPoint(x: number, y: number, checkInteractable?: boolean): HitResult | null;
|
|
169
|
+
getAllHitResultUnderCursor(_checkInteractable?: boolean): HitResult[] | null;
|
|
130
170
|
protected getAllHitResultFromScreenPoint(x: number, y: number): HitResult[];
|
|
131
171
|
focusTo(targetPos: Vector3, targetQuat: Quaternion | Euler, distance: number, time: number, onGoing?: (() => void) | null, onFinished?: (() => void) | null): void;
|
|
172
|
+
focusToBounds(bounds: Box3, time: number, computeOptimalQuat?: boolean, onGoing?: (() => void) | null, onFinished?: (() => void) | null): void;
|
|
173
|
+
focusToObject(targetObejct: Object3D, time: number, computeOptimalQuat?: boolean, onGoing?: (() => void) | null, onFinished?: (() => void) | null): void;
|
|
132
174
|
}
|
|
@@ -6,7 +6,6 @@ import { Viewport } from "../Viewport";
|
|
|
6
6
|
import { ViewportParam } from "./ViewportParameters";
|
|
7
7
|
import { AssetManager } from "../../AssetManagement/AssetManager";
|
|
8
8
|
import { PostProcessParam } from "../../PostProcess/PostProcessParam";
|
|
9
|
-
import { RendererParameters } from "./RendererParameters";
|
|
10
9
|
export interface AppClass {
|
|
11
10
|
assetManagerClass: typeof AssetManager;
|
|
12
11
|
controllerClass: typeof Controller;
|
|
@@ -14,7 +13,6 @@ export interface AppClass {
|
|
|
14
13
|
viewportClass: typeof Viewport;
|
|
15
14
|
}
|
|
16
15
|
export interface AppParam {
|
|
17
|
-
renderParam?: RendererParameters;
|
|
18
16
|
cameraParam?: CameraParam;
|
|
19
17
|
postProcessParam?: PostProcessParam;
|
|
20
18
|
worldParam?: WorldParam;
|
|
@@ -1,6 +1,19 @@
|
|
|
1
|
+
import { PostProcessParam } from 'lythreeframe/src/PostProcess/PostProcessParam';
|
|
2
|
+
import { WebGLRendererParameters } from 'three';
|
|
3
|
+
import { WebGPURendererParameters } from 'three/src/renderers/webgpu/WebGPURenderer.js';
|
|
4
|
+
export declare enum RendererType {
|
|
5
|
+
WebGPU = 0,
|
|
6
|
+
WebGL = 1
|
|
7
|
+
}
|
|
1
8
|
export interface ViewportParam {
|
|
2
9
|
elementId: string | null;
|
|
3
|
-
|
|
4
|
-
|
|
10
|
+
renderer: {
|
|
11
|
+
type: RendererType;
|
|
12
|
+
param?: WebGPURendererParameters | WebGLRendererParameters;
|
|
13
|
+
};
|
|
14
|
+
isLabelRendererNeeded?: boolean;
|
|
15
|
+
isCSS3DRendererNeeded?: boolean;
|
|
16
|
+
isUILayerNeeded?: boolean;
|
|
17
|
+
postProcess?: PostProcessParam;
|
|
5
18
|
}
|
|
6
19
|
export declare const DefaultViewportParam: ViewportParam;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Camera, Data3DTexture, Object3D, Scene, WebGLRenderer } from "three";
|
|
2
|
+
import { EffectComposer } from "three/examples/jsm/postprocessing/EffectComposer.js";
|
|
3
|
+
import { PostProcessParam, PostProcessStepParam } from '../../PostProcess/PostProcessParam';
|
|
4
|
+
export declare class WebGLPostProcessManager {
|
|
5
|
+
private postProcessParam;
|
|
6
|
+
private composer;
|
|
7
|
+
private outlineObjects;
|
|
8
|
+
private renderPass;
|
|
9
|
+
private outlinePass;
|
|
10
|
+
private bloomPass;
|
|
11
|
+
private dofPass;
|
|
12
|
+
private gtaoPass;
|
|
13
|
+
private smaaPass;
|
|
14
|
+
private fxaaPass;
|
|
15
|
+
private lutPass;
|
|
16
|
+
private outputPass;
|
|
17
|
+
private lut3dTexture;
|
|
18
|
+
private renderer;
|
|
19
|
+
protected scene: Scene;
|
|
20
|
+
protected camera: Camera;
|
|
21
|
+
private onDirtyCallback;
|
|
22
|
+
constructor(renderer: WebGLRenderer, scene: Scene, camera: Camera, postProcessParam: PostProcessParam, onDirtyCallback?: () => void);
|
|
23
|
+
get processing(): EffectComposer | null;
|
|
24
|
+
updateCamera(camera: Camera): void;
|
|
25
|
+
setup(): void;
|
|
26
|
+
private buildPipeline;
|
|
27
|
+
private getStepParam;
|
|
28
|
+
private updateAllParameters;
|
|
29
|
+
private updateGTAOParameters;
|
|
30
|
+
private updateOutlineParameters;
|
|
31
|
+
updateSteps(steps: PostProcessStepParam[]): void;
|
|
32
|
+
addOutlineObject(obj: Object3D): void;
|
|
33
|
+
setOutlineObjects(objects: Object3D[]): void;
|
|
34
|
+
removeOutlineObject(obj: Object3D): void;
|
|
35
|
+
setLUT3DTexture(lutTexture: Data3DTexture | null): void;
|
|
36
|
+
getLUT3DTexture(): Data3DTexture | null;
|
|
37
|
+
render(): boolean;
|
|
38
|
+
resize(width: number, height: number): void;
|
|
39
|
+
destroy(): void;
|
|
40
|
+
private markDirty;
|
|
41
|
+
}
|
|
@@ -1,35 +1,37 @@
|
|
|
1
|
+
import { WebGPURendererParameters } from "three/src/renderers/webgpu/WebGPURenderer.js";
|
|
1
2
|
import { Object3D, ShadowMapType, ToneMapping, WebGPURenderer } from "three/webgpu";
|
|
2
3
|
import { ThreeJsApp } from "../ThreeJsApp";
|
|
3
4
|
import { PostProcessParam, PostProcessStepParam } from './../PostProcess/PostProcessParam';
|
|
4
|
-
import {
|
|
5
|
-
import { ViewportParam } from './Parameters/ViewportParameters';
|
|
5
|
+
import { RendererType, ViewportParam } from './Parameters/ViewportParameters';
|
|
6
6
|
import { PostProcessManager } from "./Rendering/PostProcess";
|
|
7
|
+
import { WebGLRenderer, WebGLRendererParameters } from "three";
|
|
8
|
+
import { WebGLPostProcessManager } from "./Rendering/WebGLPostProcess";
|
|
7
9
|
export declare class Viewport {
|
|
8
10
|
get uiDom(): HTMLDivElement | null;
|
|
9
11
|
protected _uiDom: HTMLDivElement | null;
|
|
10
12
|
get canvas(): HTMLElement | null;
|
|
11
13
|
get outer(): HTMLElement | null;
|
|
12
|
-
get renderer(): WebGPURenderer;
|
|
14
|
+
get renderer(): WebGPURenderer | WebGLRenderer;
|
|
13
15
|
get app(): ThreeJsApp;
|
|
14
16
|
private _renderer;
|
|
15
17
|
private labelRenderer;
|
|
18
|
+
private css3dRenderer;
|
|
16
19
|
protected _app: ThreeJsApp | null;
|
|
17
20
|
private resizeObserver;
|
|
18
21
|
private _outerContainer;
|
|
19
22
|
private _canvasContainer;
|
|
20
23
|
private isRenderStateDirty;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
protected createRenderer(rendererParam: RendererParameters): void;
|
|
24
|
+
protected postProcessManager: PostProcessManager | WebGLPostProcessManager | null;
|
|
25
|
+
constructor(app: ThreeJsApp, viewportParam: ViewportParam);
|
|
26
|
+
protected createRenderer(type: RendererType, rendererParam?: WebGPURendererParameters | WebGLRendererParameters): void;
|
|
25
27
|
protected createLabelRenderer(): void;
|
|
28
|
+
protected createCSS3DRenderer(): void;
|
|
26
29
|
protected createUILayer(): void;
|
|
27
30
|
init(): void;
|
|
28
|
-
protected setupPostProcess(): void;
|
|
31
|
+
protected setupPostProcess(postProcessParam: PostProcessParam): void;
|
|
29
32
|
/** Create the PostProcessManager instance. Override in subclass to use custom manager. */
|
|
30
|
-
protected createPostProcessManager(): PostProcessManager;
|
|
33
|
+
protected createPostProcessManager(postProcessParam: PostProcessParam): PostProcessManager | WebGLPostProcessManager;
|
|
31
34
|
updatePostProcess(steps: PostProcessStepParam[]): void;
|
|
32
|
-
updateRendererSettings(data: RendererParameters): void;
|
|
33
35
|
addOutlineObject(obj: Object3D): void;
|
|
34
36
|
setOutlineObjects(objects: Object3D[]): void;
|
|
35
37
|
removeOutlineObject(obj: Object3D): void;
|
|
@@ -40,13 +42,9 @@ export declare class Viewport {
|
|
|
40
42
|
/** Called after post-processing render, before label renderer. Override in subclass to render additional content. */
|
|
41
43
|
protected onAfterPostProcessRender(): void;
|
|
42
44
|
renderAsImage(width?: number, height?: number): Promise<string>;
|
|
43
|
-
setAlpha(alpha: boolean): void;
|
|
44
45
|
setShadowMapEnabled(enabled: boolean): void;
|
|
45
46
|
setShadowMapType(type: ShadowMapType): void;
|
|
46
47
|
setToneMapping(toneMapping: ToneMapping): void;
|
|
47
48
|
setToneMappingExposure(exposure: number): void;
|
|
48
|
-
setLogarithmicDepthBufferEnabled(enabled: boolean): void;
|
|
49
|
-
setDepth(depth: boolean): void;
|
|
50
|
-
setStencil(stencil: boolean): void;
|
|
51
49
|
destroy(): void;
|
|
52
50
|
}
|
|
@@ -1,20 +1,24 @@
|
|
|
1
|
-
import { Scene } from "three/webgpu";
|
|
1
|
+
import { ClippingGroup, Plane, Scene } from "three/webgpu";
|
|
2
2
|
import { ThreeJsApp } from "../ThreeJsApp";
|
|
3
3
|
import { Viewport } from "./Viewport";
|
|
4
4
|
import { Controller } from "./Controller";
|
|
5
5
|
import { Actor } from "../Object/Actor";
|
|
6
6
|
import { LevelActor } from "../Object/Actors/Level/LevelActor";
|
|
7
7
|
import { WorldParam } from "./Parameters/WorldParameter";
|
|
8
|
+
import { PhysicsWorld } from "../Physics/PhysicsWorld";
|
|
8
9
|
export declare class World {
|
|
9
10
|
get scene(): Scene;
|
|
10
11
|
get viewport(): Viewport;
|
|
11
12
|
get controller(): Controller;
|
|
12
13
|
get rootActor(): LevelActor;
|
|
14
|
+
get physics(): PhysicsWorld;
|
|
13
15
|
protected _rootActor: LevelActor | null;
|
|
16
|
+
protected _physics: PhysicsWorld;
|
|
14
17
|
protected app: ThreeJsApp;
|
|
15
18
|
protected actors: Set<Actor>;
|
|
16
19
|
protected tickableActors: Set<Actor>;
|
|
17
20
|
protected worldParam: WorldParam;
|
|
21
|
+
protected _clippingGroup: ClippingGroup | null;
|
|
18
22
|
constructor(app: ThreeJsApp, worldParam: WorldParam);
|
|
19
23
|
init(): void;
|
|
20
24
|
addTickableActor(actor: Actor): void;
|
|
@@ -26,4 +30,6 @@ export declare class World {
|
|
|
26
30
|
removeActors(actors: Actor[]): void;
|
|
27
31
|
getActorById(id: string): Actor | null;
|
|
28
32
|
getActorsByIds(ids: string[]): Actor[];
|
|
33
|
+
addActorClipping(target: Actor, planes: Plane[]): void;
|
|
34
|
+
removeActorClipping(target: Actor, oldParent?: Actor | null): void;
|
|
29
35
|
}
|
|
@@ -2,11 +2,15 @@ import { CSS2DObject } from "three/examples/jsm/renderers/CSS2DRenderer.js";
|
|
|
2
2
|
import { Vector2 } from "three/webgpu";
|
|
3
3
|
import { SceneComponent } from "../SceneComponent";
|
|
4
4
|
import { ThreeJsApp } from "../../../ThreeJsApp";
|
|
5
|
+
export interface LabelComponentOptions {
|
|
6
|
+
center?: Vector2;
|
|
7
|
+
enablePointerEvents?: boolean;
|
|
8
|
+
}
|
|
5
9
|
export declare class LabelComponent extends SceneComponent {
|
|
6
10
|
get threeObject(): CSS2DObject;
|
|
7
11
|
set threeObject(newThreeObject: CSS2DObject);
|
|
8
12
|
protected obj: CSS2DObject;
|
|
9
|
-
constructor(app: ThreeJsApp, domElement: HTMLElement,
|
|
13
|
+
constructor(app: ThreeJsApp, domElement: HTMLElement, options?: LabelComponentOptions, uuid?: string);
|
|
10
14
|
set isHoverEnabled(_bCanHorver: boolean);
|
|
11
15
|
set isClickEnabled(_bCanClick: boolean);
|
|
12
16
|
setVisible(bVisible: boolean): void;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { CSS3DObject } from "three/examples/jsm/Addons.js";
|
|
2
|
+
import { Mesh } from "three";
|
|
3
|
+
import { SceneComponent } from "../SceneComponent";
|
|
4
|
+
import { ThreeJsApp } from "../../../ThreeJsApp";
|
|
5
|
+
export declare class CSS3DWebPanelComponent extends SceneComponent {
|
|
6
|
+
get threeObject(): CSS3DObject;
|
|
7
|
+
set threeObject(newThreeObject: CSS3DObject);
|
|
8
|
+
protected obj: CSS3DObject;
|
|
9
|
+
private wrapper;
|
|
10
|
+
private iframe;
|
|
11
|
+
private targetMesh;
|
|
12
|
+
private readonly meshes;
|
|
13
|
+
private readonly depthMaskMeshes;
|
|
14
|
+
private readonly alphaPunchMeshes;
|
|
15
|
+
private tickFunc;
|
|
16
|
+
private readonly cameraWorldPos;
|
|
17
|
+
private readonly panelWorldPos;
|
|
18
|
+
private readonly rayDir;
|
|
19
|
+
private readonly raycaster;
|
|
20
|
+
private occlusionCandidates;
|
|
21
|
+
constructor(app: ThreeJsApp, meshes: Mesh[], rawUrl: string, uuid?: string);
|
|
22
|
+
protected createDefaultObject(): CSS3DObject;
|
|
23
|
+
private setupMasks;
|
|
24
|
+
private setupOcclusionTick;
|
|
25
|
+
destroy(): void;
|
|
26
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Sprite, SpriteMaterial } from 'three/webgpu';
|
|
2
|
+
import { ThreeJsApp } from '../../../ThreeJsApp';
|
|
3
|
+
import { SceneComponent } from "../SceneComponent";
|
|
4
|
+
export interface SpriteOptions {
|
|
5
|
+
material?: SpriteMaterial;
|
|
6
|
+
textureUrl?: string;
|
|
7
|
+
color?: number | string;
|
|
8
|
+
}
|
|
9
|
+
export declare class SpriteComponent extends SceneComponent {
|
|
10
|
+
get threeObject(): Sprite;
|
|
11
|
+
protected set threeObject(newThreeObject: Sprite);
|
|
12
|
+
protected obj: Sprite;
|
|
13
|
+
constructor(app: ThreeJsApp, options?: SpriteOptions);
|
|
14
|
+
protected createDefaultObject(): Sprite;
|
|
15
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { CatmullRomCurve3, Line, Vector3 } from "three/webgpu";
|
|
2
|
+
import { SceneComponent } from "../../SceneComponent";
|
|
3
|
+
import { ThreeJsApp } from "../../../../ThreeJsApp";
|
|
4
|
+
export declare class CurveComponent extends SceneComponent {
|
|
5
|
+
private curve;
|
|
6
|
+
protected createDefaultObject(): Line;
|
|
7
|
+
constructor(app: ThreeJsApp, uuid?: string);
|
|
8
|
+
setPoints(points: Vector3[], options?: {
|
|
9
|
+
closed?: boolean;
|
|
10
|
+
curveType?: 'centripetal' | 'chordal' | 'catmullrom';
|
|
11
|
+
tension?: number;
|
|
12
|
+
showLine?: boolean;
|
|
13
|
+
}): void;
|
|
14
|
+
getPointAt(u: number): Vector3 | null;
|
|
15
|
+
getTangentAt(u: number): Vector3 | null;
|
|
16
|
+
getLength(): number;
|
|
17
|
+
getCurve(): CatmullRomCurve3 | null;
|
|
18
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Object3D } from "three/webgpu";
|
|
2
|
+
import { SceneComponent } from "../SceneComponent";
|
|
3
|
+
import { ThreeJsApp } from "../../../ThreeJsApp";
|
|
4
|
+
export interface Text3DOptions {
|
|
5
|
+
text?: string;
|
|
6
|
+
fontUrl?: string;
|
|
7
|
+
size?: number;
|
|
8
|
+
height?: number;
|
|
9
|
+
curveSegments?: number;
|
|
10
|
+
bevelEnabled?: boolean;
|
|
11
|
+
bevelThickness?: number;
|
|
12
|
+
bevelSize?: number;
|
|
13
|
+
bevelOffset?: number;
|
|
14
|
+
bevelSegments?: number;
|
|
15
|
+
color?: string;
|
|
16
|
+
sideColor?: string;
|
|
17
|
+
isUnlit?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare class Text3DComponent extends SceneComponent {
|
|
20
|
+
private _text;
|
|
21
|
+
private _fontUrl;
|
|
22
|
+
private _size;
|
|
23
|
+
private _height;
|
|
24
|
+
private _curveSegments;
|
|
25
|
+
private _bevelEnabled;
|
|
26
|
+
private _bevelThickness;
|
|
27
|
+
private _bevelSize;
|
|
28
|
+
private _bevelOffset;
|
|
29
|
+
private _bevelSegments;
|
|
30
|
+
private _color;
|
|
31
|
+
private _sideColor;
|
|
32
|
+
private _isUnlit;
|
|
33
|
+
private _font;
|
|
34
|
+
private _mesh;
|
|
35
|
+
private _group;
|
|
36
|
+
private static _fontLoader;
|
|
37
|
+
private static _fontCache;
|
|
38
|
+
constructor(app: ThreeJsApp, options?: Text3DOptions, uuid?: string);
|
|
39
|
+
protected createDefaultObject(): Object3D;
|
|
40
|
+
get text(): string;
|
|
41
|
+
set text(value: string);
|
|
42
|
+
get color(): string;
|
|
43
|
+
set color(value: string);
|
|
44
|
+
get sideColor(): string;
|
|
45
|
+
set sideColor(value: string);
|
|
46
|
+
get size(): number;
|
|
47
|
+
set size(value: number);
|
|
48
|
+
get height(): number;
|
|
49
|
+
set height(value: number);
|
|
50
|
+
get fontUrl(): string;
|
|
51
|
+
set fontUrl(value: string);
|
|
52
|
+
private loadFontAndRefresh;
|
|
53
|
+
private refreshGeometry;
|
|
54
|
+
private updateMaterial;
|
|
55
|
+
destroy(): void;
|
|
56
|
+
}
|
|
@@ -1,11 +1,57 @@
|
|
|
1
1
|
import { Pawn } from "./Pawn";
|
|
2
|
-
import {
|
|
3
|
-
import { Vector3, Quaternion } from "three/webgpu";
|
|
2
|
+
import { ThreeJsApp } from "../../ThreeJsApp";
|
|
3
|
+
import { Vector3, Quaternion, Euler } from "three/webgpu";
|
|
4
|
+
import { SceneComponent } from "../Components/SceneComponent";
|
|
4
5
|
export declare class FirstPerson extends Pawn {
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
moveSpeed: number;
|
|
7
|
+
lookSpeed: number;
|
|
8
|
+
enableGravity: boolean;
|
|
9
|
+
gravity: number;
|
|
10
|
+
eyeHeight: number;
|
|
11
|
+
private _verticalVelocity;
|
|
12
|
+
private _yaw;
|
|
13
|
+
private _pitch;
|
|
14
|
+
private _targetPos;
|
|
15
|
+
private _clickMarker;
|
|
16
|
+
private _moveForward;
|
|
17
|
+
private _moveBackward;
|
|
18
|
+
private _moveLeft;
|
|
19
|
+
private _moveRight;
|
|
20
|
+
private _moveUp;
|
|
21
|
+
private _moveDown;
|
|
22
|
+
private _isRightDragging;
|
|
23
|
+
constructor(app: ThreeJsApp);
|
|
24
|
+
protected constructRootComponent(): SceneComponent;
|
|
25
|
+
landToGround(): void;
|
|
26
|
+
private syncRotation;
|
|
27
|
+
/**
|
|
28
|
+
* Override setRotation to intercept external rotation changes.
|
|
29
|
+
* Extracts Pitch to internal state and only applies Yaw to the physical pawn.
|
|
30
|
+
*/
|
|
31
|
+
setRotation(rotation: Euler): void;
|
|
32
|
+
setRotation(x: number, y: number, z: number): void;
|
|
33
|
+
/**
|
|
34
|
+
* Override setQuaternion to intercept external rotation changes.
|
|
35
|
+
* Extracts Pitch to internal state and only applies Yaw to the physical pawn.
|
|
36
|
+
*/
|
|
37
|
+
setQuaternion(quat: Quaternion): void;
|
|
38
|
+
setQuaternion(x: number, y: number, z: number, w: number): void;
|
|
39
|
+
possess(): void;
|
|
40
|
+
unpossess(): void;
|
|
41
|
+
getTargetCameraState(): {
|
|
7
42
|
position: Vector3;
|
|
8
43
|
quaternion: Quaternion;
|
|
9
|
-
|
|
10
|
-
|
|
44
|
+
};
|
|
45
|
+
private onContextMenu;
|
|
46
|
+
private onBlur;
|
|
47
|
+
private onMouseDown;
|
|
48
|
+
private onMouseUp;
|
|
49
|
+
private onClick;
|
|
50
|
+
private onPointerLockChange;
|
|
51
|
+
private onMouseMove;
|
|
52
|
+
private setCameraDraggingState;
|
|
53
|
+
private onKeyDown;
|
|
54
|
+
private onKeyUp;
|
|
55
|
+
tick(deltaTime: number): void;
|
|
56
|
+
private updateCameraFromPawn;
|
|
11
57
|
}
|
|
@@ -1,22 +1,45 @@
|
|
|
1
1
|
import { Pawn } from "./Pawn";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { Euler, Quaternion, Vector3 } from "three";
|
|
2
|
+
import { Euler, Quaternion, Vector3 } from "three/webgpu";
|
|
3
|
+
import { ThreeJsApp } from "../../ThreeJsApp";
|
|
5
4
|
export declare class Orbital extends Pawn {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
distance: number;
|
|
6
|
+
minDistance: number;
|
|
7
|
+
maxDistance: number;
|
|
8
|
+
rotateSpeed: number;
|
|
9
|
+
zoomSpeed: number;
|
|
10
|
+
minPolarAngle: number;
|
|
11
|
+
maxPolarAngle: number;
|
|
12
|
+
minAzimuthAngle: number;
|
|
13
|
+
maxAzimuthAngle: number;
|
|
14
|
+
enableDamping: boolean;
|
|
15
|
+
dampingFactor: number;
|
|
16
|
+
private _isDragging;
|
|
17
|
+
private _lastPointerPosition;
|
|
18
|
+
private _targetPosition;
|
|
19
|
+
private _targetQuaternion;
|
|
20
|
+
private _targetDistance;
|
|
21
|
+
private _focusTween;
|
|
22
|
+
constructor(app: ThreeJsApp);
|
|
12
23
|
possess(): void;
|
|
13
|
-
|
|
14
|
-
onChange(): void;
|
|
15
|
-
focusTo(targetPos: Vector3, targetQuat: Quaternion | Euler, distance: number, time: number, onGoing?: (() => void) | null, onFinished?: (() => void) | null): void;
|
|
16
|
-
getFocuingData(): {
|
|
24
|
+
getTargetCameraState(): {
|
|
17
25
|
position: Vector3;
|
|
18
26
|
quaternion: Quaternion;
|
|
19
|
-
|
|
20
|
-
|
|
27
|
+
};
|
|
28
|
+
private updateCameraFromPawn;
|
|
29
|
+
unpossess(): void;
|
|
30
|
+
private onContextMenu;
|
|
31
|
+
private onPointerDown;
|
|
32
|
+
private onPointerMove;
|
|
33
|
+
private onPointerUp;
|
|
34
|
+
private setCameraDraggingState;
|
|
35
|
+
private onWheel;
|
|
36
|
+
tick(deltaTime: number): void;
|
|
37
|
+
setPosition(position: Vector3): void;
|
|
38
|
+
setPosition(x: number, y: number, z: number): void;
|
|
39
|
+
setRotation(rotation: Euler): void;
|
|
40
|
+
setRotation(x: number, y: number, z: number): void;
|
|
41
|
+
setQuaternion(quat: Quaternion): void;
|
|
42
|
+
setQuaternion(x: number, y: number, z: number, w: number): void;
|
|
43
|
+
focusTo(targetPos: Vector3, targetQuat: Quaternion | Euler, distance: number, time: number, onGoing?: (() => void) | null, onFinished?: (() => void) | null): void;
|
|
21
44
|
stopFocusing(): void;
|
|
22
45
|
}
|