@xviewer.js/core 1.0.0-alpha.4 → 1.0.0-alpha.40
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/main.js +3085 -12207
- package/dist/main.js.map +1 -1
- package/dist/module.js +3042 -12205
- package/dist/module.js.map +1 -1
- package/package.json +19 -21
- package/types/PropertyManager.d.ts +14 -4
- package/types/TextureSettings.d.ts +3 -1
- package/types/Viewer.d.ts +18 -12
- package/types/asset/ResourceManager.d.ts +3 -3
- package/types/asset/aLoader.d.ts +5 -3
- package/types/base/getClassInstance.d.ts +1 -0
- package/types/base/index.d.ts +1 -0
- package/types/cinestation/CinestationBlendDefinition.d.ts +4 -4
- package/types/cinestation/CinestationBrain.d.ts +0 -2
- package/types/cinestation/FreelookVirtualCamera.d.ts +38 -22
- package/types/cinestation/VirtualCamera.d.ts +8 -8
- package/types/components/Reflector.d.ts +15 -0
- package/types/components/index.d.ts +1 -0
- package/types/index.d.ts +8 -2
- package/types/loaders/aEXRLoader.d.ts +5 -0
- package/types/{loader → loaders}/aFBXLoader.d.ts +1 -0
- package/types/{loader → loaders}/aGLTFLoader.d.ts +1 -0
- package/types/{loader → loaders}/aHDRLoader.d.ts +1 -0
- package/types/loaders/aJSONLoader.d.ts +5 -0
- package/types/{loader → loaders}/aTextureLoader.d.ts +1 -0
- package/types/{loader → loaders}/index.d.ts +3 -5
- package/types/materials/ReflectorMaterial.d.ts +28 -0
- package/types/{material → materials}/getShaderMaterial.d.ts +2 -2
- package/types/materials/glsl/index.d.ts +3 -0
- package/types/materials/index.d.ts +3 -0
- package/types/math/Constant.d.ts +8 -1
- package/types/math/Interpolation.d.ts +6 -6
- package/types/math/Perlin.d.ts +12 -0
- package/types/math/index.d.ts +5 -0
- package/types/passes/MipBlurPass.d.ts +27 -0
- package/types/passes/cubeuv/MergeBlurPass.d.ts +21 -0
- package/types/passes/cubeuv/MergeInfo.d.ts +9 -0
- package/types/passes/cubeuv/MergeReflectPass.d.ts +18 -0
- package/types/passes/cubeuv/utils.d.ts +15 -0
- package/types/passes/mipGaussianBlendWeight.d.ts +1 -0
- package/types/plugins/BoxProjectionPlugin.d.ts +20 -0
- package/types/plugins/DebugPlugin.d.ts +10 -0
- package/types/plugins/EnvironmentPlugin.d.ts +34 -0
- package/types/plugins/index.d.ts +3 -0
- package/types/tween/Easing.d.ts +25 -0
- package/types/tween/Group.d.ts +16 -0
- package/types/tween/Interpolation.d.ts +19 -0
- package/types/tween/Now.d.ts +2 -0
- package/types/tween/Sequence.d.ts +7 -0
- package/types/tween/Tween.d.ts +96 -0
- package/types/tween/TweenChain.d.ts +15 -5
- package/types/tween/TweenManager.d.ts +0 -2
- package/types/tween/Version.d.ts +1 -0
- package/types/tween/index.d.ts +3 -1
- package/types/tween/mainGroup.d.ts +2 -0
- package/types/types.d.ts +4 -0
- package/types/material/glsl/copy.glsl.d.ts +0 -1
- /package/types/{material → materials}/glsl/boxfilterblur.glsl.d.ts +0 -0
- /package/types/{material → materials}/glsl/fullscreen.glsl.d.ts +0 -0
- /package/types/{material → materials}/glsl/panorama.glsl.d.ts +0 -0
- /package/types/{primitives → primitive}/Box.d.ts +0 -0
- /package/types/{primitives → primitive}/Plane.d.ts +0 -0
- /package/types/{primitives → primitive}/Sphere.d.ts +0 -0
- /package/types/{primitives → primitive}/index.d.ts +0 -0
package/package.json
CHANGED
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"three": ">= 0.164.0 < 0.165.0"
|
|
22
|
-
}
|
|
2
|
+
"name": "@xviewer.js/core",
|
|
3
|
+
"version": "1.0.0-alpha.40",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"main": "dist/main.js",
|
|
8
|
+
"module": "dist/module.js",
|
|
9
|
+
"types": "types/index.d.ts",
|
|
10
|
+
"debug": "src/index.ts",
|
|
11
|
+
"files": [
|
|
12
|
+
"dist/**/*",
|
|
13
|
+
"types/**/*"
|
|
14
|
+
],
|
|
15
|
+
"peerDependencies": {
|
|
16
|
+
"three": ">= 0.164.0 < 0.165.0"
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"b:types": "tsc"
|
|
20
|
+
}
|
|
23
21
|
}
|
|
@@ -1,8 +1,18 @@
|
|
|
1
|
+
declare class ClassProperties {
|
|
2
|
+
clsName: string;
|
|
3
|
+
private _properties;
|
|
4
|
+
constructor(clsName: string);
|
|
5
|
+
property(propertyKey: string, options?: Object): this;
|
|
6
|
+
applyProperties(target: object): object;
|
|
7
|
+
}
|
|
1
8
|
export declare class PropertyManager {
|
|
2
|
-
static
|
|
3
|
-
static
|
|
4
|
-
static _hasProperties(
|
|
5
|
-
static
|
|
9
|
+
static _classMap: Map<String, ClassProperties>;
|
|
10
|
+
static _propertyMap: Map<Object, Object>;
|
|
11
|
+
static _hasProperties(constructor: Function): boolean;
|
|
12
|
+
static _getProperties(constructor: Function, autoAdd?: boolean): Object;
|
|
13
|
+
static _getMergedProperties(constructor: Function): any;
|
|
14
|
+
static _getClassProperties(clsName: string, autoAdd?: boolean): ClassProperties;
|
|
15
|
+
static _applyClassProperties(clsName: string, constructor: Function): object;
|
|
6
16
|
}
|
|
7
17
|
export interface IPropertyOptions {
|
|
8
18
|
dir?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Mapping, PixelFormat, TextureDataType, TextureFilter, Vector2, Wrapping } from "three";
|
|
1
|
+
import { ColorSpace, Mapping, PixelFormat, TextureDataType, TextureFilter, Vector2, Wrapping } from "three";
|
|
2
2
|
export interface TextureSettings {
|
|
3
3
|
flipY?: boolean;
|
|
4
4
|
mapping?: Mapping;
|
|
@@ -10,4 +10,6 @@ export interface TextureSettings {
|
|
|
10
10
|
dataType?: TextureDataType;
|
|
11
11
|
anisotropy?: number;
|
|
12
12
|
repeat?: Vector2;
|
|
13
|
+
colorSpace?: ColorSpace;
|
|
14
|
+
channel?: number;
|
|
13
15
|
}
|
package/types/Viewer.d.ts
CHANGED
|
@@ -1,22 +1,26 @@
|
|
|
1
|
-
import { BufferGeometry, Camera, ColorSpace, DataTexture, DirectionalLightShadow, Euler, Material, Mesh, Object3D, OrthographicCamera, PerspectiveCamera, Scene,
|
|
1
|
+
import { BufferGeometry, Camera, ColorSpace, DataTexture, DirectionalLightShadow, Euler, Material, Mesh, Object3D, OrthographicCamera, PerspectiveCamera, Scene, ShadowMapType, Texture, TextureDataType, ToneMapping, Vector3, WebGLCubeRenderTarget, WebGLRenderer, WebGLRendererParameters, WebGLRenderTarget } from "three";
|
|
2
2
|
import { EventEmitter } from "./base";
|
|
3
3
|
import { ComponentManager } from "./ComponentManager";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { DeviceInput } from "./DeviceInput";
|
|
5
|
+
import { AssetProperties, LoaderConstructor } from "./asset/ResourceManager";
|
|
6
|
+
import { __C, __P } from "./types";
|
|
6
7
|
import { Component } from "./Component";
|
|
7
8
|
import { TextureSettings } from "./TextureSettings";
|
|
8
9
|
import { Plugin } from "./Plugin";
|
|
9
10
|
export declare class Viewer extends EventEmitter {
|
|
10
11
|
static __target: Vector3;
|
|
11
12
|
static __worldPos: Vector3;
|
|
12
|
-
static _getClassInstance(constructor: any, args?: any[]): any;
|
|
13
13
|
static _shadowCameraKeys: string[];
|
|
14
14
|
static _setDirectLightShadow(shadow: DirectionalLightShadow, props: number[]): DirectionalLightShadow;
|
|
15
|
-
static
|
|
16
|
-
static
|
|
17
|
-
static
|
|
18
|
-
static Blit(renderer: WebGLRenderer, renderTarget: WebGLRenderTarget, material:
|
|
19
|
-
static
|
|
15
|
+
static compileMaterial(renderer: WebGLRenderer, scene: Scene, camera: Camera, target: Material | Material[]): void;
|
|
16
|
+
static compileObject3D(renderer: WebGLRenderer, scene: Scene, camera: Camera, target: Object3D): void;
|
|
17
|
+
static compileTexture(renderer: WebGLRenderer, target: Texture | Texture[]): void;
|
|
18
|
+
static Blit(renderer: WebGLRenderer, renderTarget: WebGLRenderTarget, material: Material, lod?: number, face?: number): void;
|
|
19
|
+
static createFullscreenTriangle(): BufferGeometry<import("three").NormalBufferAttributes>;
|
|
20
|
+
static findChild<T extends Object3D>(node: T, path: string): T;
|
|
21
|
+
static getChildByName<T extends Object3D>(node: T, name: string): T;
|
|
22
|
+
static getObject<T extends Object3D>(node: T, filter: (value: T) => any): any;
|
|
23
|
+
static getObjects<T extends Object3D>(node: T, filter: (value: T) => any): any[];
|
|
20
24
|
static fullscreenMesh: Mesh;
|
|
21
25
|
static fullscreenCamera: OrthographicCamera;
|
|
22
26
|
private _root;
|
|
@@ -62,6 +66,7 @@ export declare class Viewer extends EventEmitter {
|
|
|
62
66
|
factor: number;
|
|
63
67
|
};
|
|
64
68
|
get rootRotated(): boolean;
|
|
69
|
+
get input(): DeviceInput;
|
|
65
70
|
constructor({ root, canvas, autoStart, autoResize, shadows, camera, targetFrameRate, colorSpace, toneMapping, toneMappingExposure, maxDPR, path, resourcePath, dracoPath, loader, tasker, ...webglOpts }?: {
|
|
66
71
|
root?: HTMLElement;
|
|
67
72
|
canvas?: HTMLCanvasElement;
|
|
@@ -96,6 +101,7 @@ export declare class Viewer extends EventEmitter {
|
|
|
96
101
|
};
|
|
97
102
|
} & WebGLRendererParameters);
|
|
98
103
|
destroy(): void;
|
|
104
|
+
private _addDefaultLoaders;
|
|
99
105
|
private _frame;
|
|
100
106
|
loop(dt: number): void;
|
|
101
107
|
update(dt: number): void;
|
|
@@ -106,8 +112,8 @@ export declare class Viewer extends EventEmitter {
|
|
|
106
112
|
stop(): this;
|
|
107
113
|
resize(width?: number, height?: number): void;
|
|
108
114
|
loadAsset(props: AssetProperties & TextureSettings): Promise<any>;
|
|
115
|
+
addLoader(Loader: LoaderConstructor): void;
|
|
109
116
|
load({ url, ext, onProgress, castShadow, receiveShadow, ...props }: AssetProperties & __P<Object3D, typeof Object3D>): Promise<any>;
|
|
110
|
-
tween(target: Object): import("./tween").Tween<Object>;
|
|
111
117
|
timeline(target: Object): import("./tween").TweenChain;
|
|
112
118
|
killTweensOf(target: Object): void;
|
|
113
119
|
traverseMaterials(callback: (mat: Material) => void): void;
|
|
@@ -126,8 +132,7 @@ export declare class Viewer extends EventEmitter {
|
|
|
126
132
|
removeComponent(node: Object3D, component: Component): ComponentManager;
|
|
127
133
|
addNode<T, K extends __C<T>>(object: T | K & __C<T>, props?: __P<T, K>): T;
|
|
128
134
|
removeNode(node: Object3D): void;
|
|
129
|
-
activeNode(node: Object3D, active: boolean):
|
|
130
|
-
createComponent<T extends Component, K extends __C<T>>(comp: T | K & __C<T>, props?: __Comp<T, K>): any;
|
|
135
|
+
activeNode(node: Object3D, active: boolean): Object3D<import("three").Object3DEventMap>;
|
|
131
136
|
createRenderTarget(width: number, height: number, nearest?: boolean, floatType?: boolean | TextureDataType, msaa?: number, mipmap?: boolean): WebGLRenderTarget<Texture>;
|
|
132
137
|
createCubeRenderTarget(size: number, nearest?: boolean, floatType?: boolean | TextureDataType, msaa?: number, mipmap?: boolean): WebGLCubeRenderTarget;
|
|
133
138
|
createDataTexture(data: BufferSource, width: number, height: number, floatType?: boolean, nearest?: boolean): DataTexture;
|
|
@@ -137,6 +142,7 @@ export declare class Viewer extends EventEmitter {
|
|
|
137
142
|
* @returns
|
|
138
143
|
*/
|
|
139
144
|
portal<T = any>(callback: () => T): T;
|
|
145
|
+
blit(renderTarget: WebGLRenderTarget, material: Material, lod?: number, face?: number): void;
|
|
140
146
|
compile(target?: Object3D | Scene | Material | Texture): void;
|
|
141
147
|
compile(target?: Material[]): void;
|
|
142
148
|
}
|
|
@@ -9,12 +9,11 @@ export interface AssetProperties {
|
|
|
9
9
|
};
|
|
10
10
|
onProgress?: (event: ProgressEvent) => void;
|
|
11
11
|
}
|
|
12
|
+
export type LoaderConstructor = new (manager: ResourceManager) => aLoader;
|
|
12
13
|
export declare class ResourceManager {
|
|
13
14
|
static extension(path: string): string;
|
|
14
15
|
static dirname(path: string): string;
|
|
15
16
|
static basename(path: string, ext?: string): string;
|
|
16
|
-
static _loaders: Map<string, aLoader>;
|
|
17
|
-
static _addLoader(extNames: string[], Loader: new () => aLoader): void;
|
|
18
17
|
static _parseURL(uri: any): {
|
|
19
18
|
url: string;
|
|
20
19
|
file: any;
|
|
@@ -30,6 +29,7 @@ export declare class ResourceManager {
|
|
|
30
29
|
dracoPath: string;
|
|
31
30
|
loadingManager: LoadingManager;
|
|
32
31
|
private _caches;
|
|
32
|
+
private _loaders;
|
|
33
33
|
constructor(props: {
|
|
34
34
|
path: string;
|
|
35
35
|
resourcePath: string;
|
|
@@ -37,6 +37,6 @@ export declare class ResourceManager {
|
|
|
37
37
|
loadingManager: LoadingManager;
|
|
38
38
|
});
|
|
39
39
|
destroy(): void;
|
|
40
|
+
addLoader(Loader: LoaderConstructor): void;
|
|
40
41
|
loadAsset<T = any>({ url, ext, onProgress, ...props }: AssetProperties & TextureSettings): Promise<T>;
|
|
41
42
|
}
|
|
42
|
-
export declare function resourceLoader(extNames: string[]): <T extends aLoader>(Loader: new () => T) => void;
|
package/types/asset/aLoader.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Object3D } from "three";
|
|
2
2
|
import { ResourceManager } from "./ResourceManager";
|
|
3
3
|
import { TextureSettings } from "../TextureSettings";
|
|
4
4
|
export interface LoadProperties {
|
|
@@ -9,8 +9,10 @@ export interface LoadProperties {
|
|
|
9
9
|
onError?: (event: ErrorEvent) => void;
|
|
10
10
|
}
|
|
11
11
|
export declare abstract class aLoader {
|
|
12
|
-
static _setMeshData(node: Object3D): Object3D<import("three").Object3DEventMap>;
|
|
13
12
|
manager: ResourceManager;
|
|
14
|
-
|
|
13
|
+
static _texKeys: string[];
|
|
14
|
+
static _setMeshData(node: Object3D): Object3D<import("three").Object3DEventMap>;
|
|
15
|
+
constructor(manager: ResourceManager);
|
|
16
|
+
abstract extension: string[];
|
|
15
17
|
abstract load(props: LoadProperties): void;
|
|
16
18
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getClassInstance(constructor: any, args?: any[]): any;
|
package/types/base/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export declare const CinestationBlendStyle: {
|
|
2
|
-
Linear: (
|
|
3
|
-
QuadraticIn: (
|
|
4
|
-
QuadraticOut: (
|
|
5
|
-
QuadraticInOut: (
|
|
2
|
+
Linear: import("../tween").EasingFunction;
|
|
3
|
+
QuadraticIn: import("../tween").EasingFunction;
|
|
4
|
+
QuadraticOut: import("../tween").EasingFunction;
|
|
5
|
+
QuadraticInOut: import("../tween").EasingFunction;
|
|
6
6
|
};
|
|
7
7
|
export type CinestationBlendStyle = typeof CinestationBlendStyle[keyof typeof CinestationBlendStyle];
|
|
8
8
|
export declare class CinestationBlendDefinition {
|
|
@@ -7,9 +7,7 @@ export declare class CinestationBrain extends Component<PerspectiveCamera> {
|
|
|
7
7
|
private _vcamSolo;
|
|
8
8
|
private _vcams;
|
|
9
9
|
private _lerpTime;
|
|
10
|
-
private _isChanged;
|
|
11
10
|
brainBlend: CinestationBlendDefinition;
|
|
12
|
-
onChanged: (v: boolean) => void;
|
|
13
11
|
get vcam(): VirtualCamera;
|
|
14
12
|
get vcams(): VirtualCamera[];
|
|
15
13
|
lastUpdate(dt: number): void;
|
|
@@ -1,54 +1,58 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Quaternion, Vector2, Vector3 } from "three";
|
|
2
2
|
import { VirtualCamera } from "./VirtualCamera";
|
|
3
|
-
|
|
4
|
-
FREE = 0,
|
|
5
|
-
TRANSLATE = 1
|
|
6
|
-
}
|
|
3
|
+
import { EasingFunction } from "../tween";
|
|
7
4
|
export declare class FreelookVirtualCamera extends VirtualCamera {
|
|
8
5
|
static __loc0: Vector2;
|
|
9
6
|
static __loc1: Vector2;
|
|
10
7
|
static __center: Vector2;
|
|
11
8
|
static __preCenter: Vector2;
|
|
12
|
-
static
|
|
13
|
-
static
|
|
9
|
+
static __panDelta: Vector2;
|
|
10
|
+
static __panTarget: Vector2;
|
|
11
|
+
static __rotateDelta: Vector2;
|
|
14
12
|
static __posDelta: Vector3;
|
|
15
|
-
static __posOffset: Vector3;
|
|
16
13
|
static __xAxis: Vector3;
|
|
17
14
|
static __yAxis: Vector3;
|
|
18
15
|
static __quat: Quaternion;
|
|
19
|
-
static __spherical: Spherical;
|
|
20
16
|
private _button;
|
|
21
17
|
private _touchID;
|
|
22
|
-
private _distanceDelta;
|
|
23
18
|
private _preLoc0;
|
|
24
19
|
private _preLoc1;
|
|
25
|
-
private
|
|
26
|
-
private
|
|
27
|
-
|
|
20
|
+
private _spherical;
|
|
21
|
+
private _lookAt;
|
|
22
|
+
private _tempSmoothing;
|
|
23
|
+
private _targetTheta;
|
|
24
|
+
private _targetPhi;
|
|
25
|
+
private _targetSpringLength;
|
|
26
|
+
private _targetFov;
|
|
27
|
+
private _targetLookAt;
|
|
28
28
|
forbidX: boolean;
|
|
29
29
|
forbidY: boolean;
|
|
30
30
|
forbidZ: boolean;
|
|
31
31
|
forbidPanX: boolean;
|
|
32
32
|
forbidPanY: boolean;
|
|
33
33
|
forbitPanOffsetY: boolean;
|
|
34
|
-
rotateSpeed: number;
|
|
35
|
-
rotateSmoothing: number;
|
|
36
34
|
panSpeed: number;
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
rotateSpeed: number;
|
|
36
|
+
smoothing: number;
|
|
39
37
|
phiMin: number;
|
|
40
38
|
phiMax: number;
|
|
41
39
|
thetaMin: number;
|
|
42
40
|
thetaMax: number;
|
|
43
41
|
distanceMin: number;
|
|
44
42
|
distanceMax: number;
|
|
45
|
-
|
|
46
|
-
lookAt:
|
|
43
|
+
get lookAt(): Vector3;
|
|
44
|
+
set lookAt(v: Vector3);
|
|
45
|
+
get springLength(): number;
|
|
46
|
+
set springLength(v: number);
|
|
47
|
+
get theta(): number;
|
|
48
|
+
set theta(v: number);
|
|
49
|
+
get phi(): number;
|
|
50
|
+
set phi(v: number);
|
|
51
|
+
get fov(): number;
|
|
52
|
+
set fov(v: number);
|
|
47
53
|
onEnable(): void;
|
|
48
54
|
onDisable(): void;
|
|
49
55
|
reset(): void;
|
|
50
|
-
private _tweenPOI;
|
|
51
|
-
gotoPOI(position: Vector3, lookAt: Vector3, duration?: number, easing?: (amount: number) => number): void;
|
|
52
56
|
private _onPointerDown;
|
|
53
57
|
private _onPointerUp;
|
|
54
58
|
private _onPointerMove;
|
|
@@ -56,7 +60,19 @@ export declare class FreelookVirtualCamera extends VirtualCamera {
|
|
|
56
60
|
private _onTouchStart;
|
|
57
61
|
private _onTouchMove;
|
|
58
62
|
private _calculateDistanceScale;
|
|
59
|
-
private
|
|
63
|
+
private _calculateRotatelDelta;
|
|
60
64
|
private _calculatePanDelta;
|
|
65
|
+
private _calculateTargetLookAt;
|
|
66
|
+
private _calculateTargetSpringArm;
|
|
67
|
+
gotoPOI({ duration, easing, springLength, theta, phi, lookAt, fov, smoothing, }: {
|
|
68
|
+
duration?: number;
|
|
69
|
+
easing?: EasingFunction;
|
|
70
|
+
springLength?: number;
|
|
71
|
+
theta?: number;
|
|
72
|
+
phi?: number;
|
|
73
|
+
lookAt?: Vector3;
|
|
74
|
+
fov?: number;
|
|
75
|
+
smoothing?: number;
|
|
76
|
+
}): void;
|
|
61
77
|
update(dt: number): void;
|
|
62
78
|
}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { Object3D, Quaternion, Vector3 } from "three";
|
|
2
2
|
import { Component } from "../Component";
|
|
3
3
|
import { CinestationBrain } from "./CinestationBrain";
|
|
4
|
+
declare class Lens {
|
|
5
|
+
fov: number;
|
|
6
|
+
near: number;
|
|
7
|
+
far: number;
|
|
8
|
+
}
|
|
4
9
|
export declare class VirtualCamera extends Component<Object3D & {
|
|
5
10
|
isCamera?: boolean;
|
|
6
11
|
}> {
|
|
7
12
|
private _finalPosition;
|
|
8
13
|
private _finalRotation;
|
|
14
|
+
locked: boolean;
|
|
9
15
|
priority: number;
|
|
10
|
-
|
|
11
|
-
follow: Object3D | null;
|
|
12
|
-
fov: number;
|
|
13
|
-
near: number;
|
|
14
|
-
far: number;
|
|
16
|
+
lens: Lens;
|
|
15
17
|
correctPosition: Vector3;
|
|
16
18
|
correctRotation: Quaternion;
|
|
17
|
-
lookaheadPosition: Vector3;
|
|
18
|
-
trackedObjectOffset: Vector3;
|
|
19
19
|
brain: CinestationBrain;
|
|
20
20
|
get finalPosition(): Vector3;
|
|
21
21
|
get finalRotation(): Quaternion;
|
|
22
22
|
onLoad(): void;
|
|
23
23
|
onDestroy(): void;
|
|
24
|
-
update(dt: number): void;
|
|
25
24
|
}
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Matrix4, Vector3, WebGLRenderTarget } from "three";
|
|
2
|
+
import { Component } from "../Component";
|
|
3
|
+
export declare class Reflector extends Component {
|
|
4
|
+
constructor({ textureWidth, textureHeight, clipBias, multisample, layer, normal, mipmap, }?: {
|
|
5
|
+
textureWidth?: number;
|
|
6
|
+
textureHeight?: number;
|
|
7
|
+
clipBias?: number;
|
|
8
|
+
multisample?: number;
|
|
9
|
+
normal?: Vector3;
|
|
10
|
+
layer?: number;
|
|
11
|
+
mipmap?: boolean;
|
|
12
|
+
});
|
|
13
|
+
getTextureMatrix: () => Matrix4;
|
|
14
|
+
getRenderTarget: () => WebGLRenderTarget;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Reflector } from "./Reflector";
|
package/types/index.d.ts
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
export * from "./types";
|
|
2
2
|
export * from "./base";
|
|
3
3
|
export * from "./tween";
|
|
4
|
-
export * from "./
|
|
4
|
+
export * from "./loaders";
|
|
5
5
|
export * from "./cinestation";
|
|
6
|
-
export * from "./
|
|
6
|
+
export * from "./primitive";
|
|
7
|
+
export * from "./math";
|
|
8
|
+
export * from "./components";
|
|
9
|
+
export * from "./materials";
|
|
10
|
+
export * from "./plugins";
|
|
7
11
|
export { Viewer } from "./Viewer";
|
|
8
12
|
export { Component } from "./Component";
|
|
9
13
|
export { SystemInfo } from "./SystemInfo";
|
|
10
14
|
export { Plugin } from "./Plugin";
|
|
11
15
|
export { ObjectInstance } from "./ObjectInstance";
|
|
12
16
|
export { property, PropertyManager } from "./PropertyManager";
|
|
17
|
+
export { DeviceInput } from "./DeviceInput";
|
|
18
|
+
export * from "./asset/aLoader";
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import "./aFBXLoader";
|
|
3
|
-
import "./aHDRLoader";
|
|
4
|
-
import "./aTextureLoader";
|
|
5
|
-
export { aGLTFLoader } from "./aGLTFLoader";
|
|
1
|
+
export { aEXRLoader } from "./aEXRLoader";
|
|
6
2
|
export { aFBXLoader } from "./aFBXLoader";
|
|
3
|
+
export { aGLTFLoader } from "./aGLTFLoader";
|
|
7
4
|
export { aHDRLoader } from "./aHDRLoader";
|
|
5
|
+
export { aJSONLoader } from "./aJSONLoader";
|
|
8
6
|
export { aTextureLoader } from "./aTextureLoader";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { IUniform, ShaderMaterial, Texture, WebGLProgramParametersWithUniforms } from "three";
|
|
2
|
+
export declare class ReflectorMaterial extends ShaderMaterial {
|
|
3
|
+
vertexShader: string;
|
|
4
|
+
fragmentShader: string;
|
|
5
|
+
defines: {
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
};
|
|
8
|
+
uniforms: {
|
|
9
|
+
[uniform: string]: IUniform<any>;
|
|
10
|
+
};
|
|
11
|
+
onBeforeCompile(shader: WebGLProgramParametersWithUniforms): void;
|
|
12
|
+
get alpha(): number;
|
|
13
|
+
set alpha(v: number);
|
|
14
|
+
get metalness(): number;
|
|
15
|
+
set metalness(v: number);
|
|
16
|
+
get roughness(): number;
|
|
17
|
+
set roughness(v: number);
|
|
18
|
+
get map(): Texture;
|
|
19
|
+
set map(v: Texture);
|
|
20
|
+
get roughnessMap(): Texture;
|
|
21
|
+
set roughnessMap(v: Texture);
|
|
22
|
+
get normalMap(): Texture;
|
|
23
|
+
set normalMap(v: Texture);
|
|
24
|
+
get aoMap(): Texture;
|
|
25
|
+
set aoMap(v: Texture);
|
|
26
|
+
get lightMap(): Texture;
|
|
27
|
+
set lightMap(v: Texture);
|
|
28
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Color, CubeTexture, Matrix3, Matrix4, Quaternion, ShaderMaterial, Texture, Vector2, Vector3, Vector4 } from "three";
|
|
2
|
-
export declare function getShaderMaterial
|
|
2
|
+
export declare function getShaderMaterial<T extends {
|
|
3
3
|
[name: string]: CubeTexture | Texture | Int32Array | Float32Array | Matrix4 | Matrix3 | Quaternion | Vector4 | Vector3 | Vector2 | Color | number | boolean | Array<any> | null;
|
|
4
|
-
}, vertexShader: string, fragmentShader: string, onInit?: (material?: ShaderMaterial) => void): typeof ShaderMaterial;
|
|
4
|
+
}>(uniforms: T, vertexShader: string, fragmentShader: string, onInit?: (material?: ShaderMaterial) => void): typeof ShaderMaterial & T & ShaderMaterial;
|
package/types/math/Constant.d.ts
CHANGED
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
import { Vector3 } from "three";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const Vector3_UNIT_X: Readonly<Vector3>;
|
|
3
|
+
export declare const Vector3_UNIT_Y: Readonly<Vector3>;
|
|
4
|
+
export declare const Vector3_UNIT_Z: Readonly<Vector3>;
|
|
5
|
+
export declare const Vector3_RIGHT: Readonly<Vector3>;
|
|
6
|
+
export declare const Vector3_UP: Readonly<Vector3>;
|
|
7
|
+
export declare const Vector3_ZERO: Readonly<Vector3>;
|
|
8
|
+
export declare const Vector3_ONE: Readonly<Vector3>;
|
|
9
|
+
export declare const Vector3_NEG_ONE: Readonly<Vector3>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Quaternion } from "three";
|
|
2
|
-
export declare function VInterpTo(current:
|
|
3
|
-
export declare function VInterpConstantTo(current:
|
|
1
|
+
import { Quaternion, Vector3 } from "three";
|
|
2
|
+
export declare function VInterpTo(current: Vector3, target: Vector3, deltaTime: number, speed: number, out?: Vector3): Vector3;
|
|
3
|
+
export declare function VInterpConstantTo(current: Vector3, target: Vector3, deltaTime: number, speed: number, out?: Vector3): Vector3;
|
|
4
4
|
export declare function Quat_Equals(a: Quaternion, b: Quaternion, epsilon?: number): boolean;
|
|
5
5
|
export declare function Quat_AngularDistance(a: Quaternion, b: Quaternion): number;
|
|
6
6
|
export declare function QInterpTo(current: Quaternion, target: Quaternion, deltaTime: number, speed: number): Quaternion;
|
|
7
|
-
export declare function QInterpConstantTo(current:
|
|
8
|
-
export declare function FInterpTo(current:
|
|
9
|
-
export declare function FInterpConstantTo(current:
|
|
7
|
+
export declare function QInterpConstantTo(current: Quaternion, target: Quaternion, deltaTime: number, speed: number, out?: Quaternion): Quaternion;
|
|
8
|
+
export declare function FInterpTo(current: number, target: number, deltaTime: number, speed: number): number;
|
|
9
|
+
export declare function FInterpConstantTo(current: number, target: number, deltaTime: number, speed: number): number;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare class Perlin {
|
|
2
|
+
static Noise(x: number): number;
|
|
3
|
+
static Noise(x: number, y: number): number;
|
|
4
|
+
static Noise(x: number, y: number, z: number): number;
|
|
5
|
+
static Fbm(octave: number, x: number): number;
|
|
6
|
+
static Fbm(octave: number, x: number, y: number): number;
|
|
7
|
+
static Fbm(octave: number, x: number, y: number, z: number): number;
|
|
8
|
+
private static _Fade;
|
|
9
|
+
private static _Lerp;
|
|
10
|
+
private static _Grad;
|
|
11
|
+
private static _Permutation;
|
|
12
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { CubeTexture, Texture, WebGLCubeRenderTarget } from "three";
|
|
2
|
+
import { Viewer } from "../Viewer";
|
|
3
|
+
export declare class MipBlurPass {
|
|
4
|
+
private _viewer;
|
|
5
|
+
private _mipmapRenderTargets;
|
|
6
|
+
private _cubeRenderTarget;
|
|
7
|
+
private _blurMaterial;
|
|
8
|
+
private _blurIntensity;
|
|
9
|
+
private _sigma;
|
|
10
|
+
private _minLod;
|
|
11
|
+
private _maxLod;
|
|
12
|
+
private _onChanged?;
|
|
13
|
+
private _uniforms;
|
|
14
|
+
get exposure(): number;
|
|
15
|
+
set exposure(v: number);
|
|
16
|
+
get blurIntensity(): number;
|
|
17
|
+
set blurIntensity(v: number);
|
|
18
|
+
getBlurTexture(): CubeTexture;
|
|
19
|
+
constructor(props: {
|
|
20
|
+
viewer: Viewer;
|
|
21
|
+
cubeRenderTarget: WebGLCubeRenderTarget;
|
|
22
|
+
onChanged?: (tex: Texture) => void;
|
|
23
|
+
});
|
|
24
|
+
dispose(): void;
|
|
25
|
+
update(): void;
|
|
26
|
+
private _blur;
|
|
27
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { CubeTexture, Texture, WebGLRenderTarget } from "three";
|
|
2
|
+
import { Viewer } from "../../Viewer";
|
|
3
|
+
import { MergeInfo } from "./MergeInfo";
|
|
4
|
+
export declare class MergeMipBlurPass {
|
|
5
|
+
private _pmremGenerator;
|
|
6
|
+
private _sigma;
|
|
7
|
+
private _blurMinLod;
|
|
8
|
+
private _blurMaxLod;
|
|
9
|
+
private _blurIntensity;
|
|
10
|
+
private _envMapTarget;
|
|
11
|
+
private _reflectMap;
|
|
12
|
+
get envMapTarget(): WebGLRenderTarget<Texture>;
|
|
13
|
+
constructor({ viewer, reflectMap, }: {
|
|
14
|
+
viewer: Viewer;
|
|
15
|
+
reflectMap: CubeTexture;
|
|
16
|
+
});
|
|
17
|
+
dispose(): void;
|
|
18
|
+
mergeMipBlur(info: MergeInfo): void;
|
|
19
|
+
private _setBlurIntensity;
|
|
20
|
+
private _getPMREMExtension;
|
|
21
|
+
}
|