@xviewer.js/core 1.0.1 → 1.0.2
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 → main.cjs} +2301 -2472
- package/dist/main.cjs.map +1 -0
- package/dist/module.js +2130 -2320
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/Component.d.ts +4 -0
- package/types/Mount.d.ts +2 -1
- package/types/SystemInfo.d.ts +1 -4
- package/types/Utils.d.ts +4 -4
- package/types/Viewer.d.ts +7 -5
- package/types/asset/{aLoader.d.ts → Loader.d.ts} +1 -1
- package/types/asset/ResourceManager.d.ts +4 -4
- package/types/cinestation/CinestationBlendDefinition.d.ts +4 -4
- package/types/components/AccumulativeShadows.d.ts +68 -0
- package/types/components/Center.d.ts +44 -0
- package/types/components/index.d.ts +2 -0
- package/types/constants.d.ts +1 -0
- package/types/index.d.ts +1 -2
- package/types/loaders/BINLoader.d.ts +8 -0
- package/types/loaders/{aEXRLoader.d.ts → EXRLoader.d.ts} +2 -2
- package/types/loaders/{aFBXLoader.d.ts → FBXLoader.d.ts} +2 -2
- package/types/loaders/{aGLTFLoader.d.ts → GLTFLoader.d.ts} +2 -2
- package/types/loaders/{aHDRLoader.d.ts → HDRLoader.d.ts} +2 -2
- package/types/loaders/{aJSONLoader.d.ts → JSONLoader.d.ts} +2 -2
- package/types/loaders/{aTextureLoader.d.ts → TextureLoader.d.ts} +2 -2
- package/types/loaders/index.d.ts +7 -6
- package/types/materials/DiscardMaterial.d.ts +5 -0
- package/types/math/index.d.ts +1 -0
- package/types/plugins/DropFile.d.ts +3 -1
- package/types/plugins/UI.d.ts +30 -0
- package/types/plugins/index.d.ts +1 -0
- package/types/shaderMaterial.d.ts +8 -0
- package/types/types.d.ts +20 -17
- package/dist/main.js.map +0 -1
- package/types/Plugin.d.ts +0 -4
- package/types/PluginManager.d.ts +0 -17
- package/types/components/PerformanceMonitor.d.ts +0 -48
- package/types/plugins/BoxProjectionPlugin.d.ts +0 -20
- package/types/plugins/DebugPlugin.d.ts +0 -10
- package/types/plugins/DebugScene.d.ts +0 -8
- package/types/plugins/DropFilePlugin.d.ts +0 -18
- package/types/plugins/EnvironmentPlugin.d.ts +0 -41
- package/types/plugins/PerformanceMonitorPlugin.d.ts +0 -48
- package/types/tween/Group.d.ts +0 -16
- package/types/tween/Interpolation.d.ts +0 -19
- package/types/tween/Now.d.ts +0 -2
- package/types/tween/Sequence.d.ts +0 -7
- package/types/tween/Tween.d.ts +0 -98
- package/types/tween/TweenChain.d.ts +0 -26
- package/types/tween/TweenGroup.d.ts +0 -17
- package/types/tween/TweenManager.d.ts +0 -8
- package/types/tween/Version.d.ts +0 -1
- package/types/tween/index.d.ts +0 -6
- package/types/tween/mainGroup.d.ts +0 -2
- /package/types/{tween → math}/Easing.d.ts +0 -0
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xviewer.js/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"main": "dist/main.
|
|
7
|
+
"main": "dist/main.cjs",
|
|
8
8
|
"module": "dist/module.js",
|
|
9
|
-
"types": "types/index.d.ts",
|
|
10
9
|
"debug": "src/index.ts",
|
|
10
|
+
"types": "types/index.d.ts",
|
|
11
11
|
"files": [
|
|
12
12
|
"dist/**/*",
|
|
13
13
|
"types/**/*"
|
package/types/Component.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { Object3D } from "three";
|
|
|
2
2
|
import { Viewer } from "./Viewer";
|
|
3
3
|
import { ComponentManager } from "./ComponentManager";
|
|
4
4
|
import { ObjectInstance } from "./ObjectInstance";
|
|
5
|
+
import { __C, __P } from "./types";
|
|
5
6
|
export declare class Component<T extends Object3D = Object3D> extends ObjectInstance {
|
|
6
7
|
private _enabled;
|
|
7
8
|
node: T;
|
|
@@ -34,4 +35,7 @@ export declare class Component<T extends Object3D = Object3D> extends ObjectInst
|
|
|
34
35
|
unscheduleAll(): void;
|
|
35
36
|
destroy(): boolean;
|
|
36
37
|
destroyImmediate(): void;
|
|
38
|
+
apply<K extends __C<this>>(props: __P<this, K>): this & {
|
|
39
|
+
copy?: Function;
|
|
40
|
+
};
|
|
37
41
|
}
|
package/types/Mount.d.ts
CHANGED
package/types/SystemInfo.d.ts
CHANGED
|
@@ -16,10 +16,7 @@ export declare class SystemInfo {
|
|
|
16
16
|
static isOpera: boolean;
|
|
17
17
|
static isSafari: boolean;
|
|
18
18
|
static isSupportMSAA: boolean;
|
|
19
|
-
static isSupportOgg: boolean;
|
|
20
|
-
static isRetina: boolean;
|
|
21
|
-
static devicePixelRatio: number;
|
|
22
19
|
static cpuCoreCount: number;
|
|
23
|
-
static
|
|
20
|
+
static isRetina: boolean;
|
|
24
21
|
static isIFrame: boolean;
|
|
25
22
|
}
|
package/types/Utils.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as THREE from "three";
|
|
2
2
|
import { __C, __P } from "./types";
|
|
3
3
|
export declare function applyProps<T, K extends __C<T>>(target: T & {
|
|
4
4
|
copy?: Function;
|
|
5
5
|
}, props: __P<T, K>): T & {
|
|
6
6
|
copy?: Function;
|
|
7
7
|
};
|
|
8
|
-
export declare function find<T extends Object3D>(node: T, path: string): T;
|
|
9
|
-
export declare function getChildren<T extends Object3D>(node: T, filter: (value: T) => any, group?: boolean): any;
|
|
10
|
-
export declare function getChildByName<T extends Object3D>(node: T, name: string): T;
|
|
8
|
+
export declare function find<T extends THREE.Object3D>(node: T, path: string): T;
|
|
9
|
+
export declare function getChildren<T extends THREE.Object3D>(node: T, filter: (value: T) => any, group?: boolean): any;
|
|
10
|
+
export declare function getChildByName<T extends THREE.Object3D>(node: T, name: string): T;
|
|
11
11
|
export declare function queryValues<T extends Object & {
|
|
12
12
|
name: string;
|
|
13
13
|
}>(object: any): T[];
|
package/types/Viewer.d.ts
CHANGED
|
@@ -6,9 +6,13 @@ import { Orientation } from "./enums/Orientation";
|
|
|
6
6
|
import { AssetProperties, LoaderConstructor, ResourceManager } from "./asset/ResourceManager";
|
|
7
7
|
import { __C, __P } from "./types";
|
|
8
8
|
import { Component } from "./Component";
|
|
9
|
-
import { TweenManager } from "./tween";
|
|
10
9
|
import { Task } from "./Task";
|
|
11
10
|
import { Mount } from "./Mount";
|
|
11
|
+
declare module 'three' {
|
|
12
|
+
interface Object3D {
|
|
13
|
+
apply<K extends __C<this>>(props: __P<this, K>): this;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
12
16
|
export declare class Viewer extends EventEmitter {
|
|
13
17
|
static __target: Vector3;
|
|
14
18
|
static __worldPos: Vector3;
|
|
@@ -52,7 +56,6 @@ export declare class Viewer extends EventEmitter {
|
|
|
52
56
|
private _resourceManager;
|
|
53
57
|
private _componentManager;
|
|
54
58
|
private _loadingManager;
|
|
55
|
-
private _tweens;
|
|
56
59
|
get root(): HTMLElement;
|
|
57
60
|
get container(): HTMLElement;
|
|
58
61
|
get time(): number;
|
|
@@ -128,14 +131,13 @@ export declare class Viewer extends EventEmitter {
|
|
|
128
131
|
rotate(): void;
|
|
129
132
|
resize(width?: number, height?: number): void;
|
|
130
133
|
loadAsset(props: AssetProperties): Promise<any>;
|
|
131
|
-
getLoader(ext: string): import(".").
|
|
132
|
-
addLoader(Loader: LoaderConstructor):
|
|
134
|
+
getLoader(ext: string): import(".").Loader;
|
|
135
|
+
addLoader(Loader: LoaderConstructor): import(".").Loader;
|
|
133
136
|
traverseMaterials(callback: (mat: Material) => void): void;
|
|
134
137
|
traverseComponents(callback: (comp: Component) => void): void;
|
|
135
138
|
mount<T extends Mount>(constructor: {
|
|
136
139
|
new (...args: any[]): T;
|
|
137
140
|
}, autoAdd?: boolean): T;
|
|
138
|
-
tween(): TweenManager;
|
|
139
141
|
task(task: Task): void;
|
|
140
142
|
add<T extends Object3D | Component, K extends __C<T>>(object: T | K & __C<T>, props?: __P<T, K>): T;
|
|
141
143
|
remove<T extends Object3D | Component>(ins: T): T;
|
|
@@ -13,7 +13,7 @@ export interface LoadProperties {
|
|
|
13
13
|
onProgress?: (event: ProgressEvent) => void;
|
|
14
14
|
onError?: (event: ErrorEvent) => void;
|
|
15
15
|
}
|
|
16
|
-
export declare abstract class
|
|
16
|
+
export declare abstract class Loader {
|
|
17
17
|
manager: ResourceManager;
|
|
18
18
|
static _texKeys: string[];
|
|
19
19
|
static _setUserData(node: Object3D): Object3D<import("three").Object3DEventMap>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LoadingManager } from "three";
|
|
2
2
|
import { TextureSettings } from "../TextureSettings";
|
|
3
|
-
import {
|
|
3
|
+
import { Loader } from "./Loader";
|
|
4
4
|
export interface AssetProperties extends TextureSettings {
|
|
5
5
|
url?: string;
|
|
6
6
|
ext?: string;
|
|
@@ -11,7 +11,7 @@ export interface AssetProperties extends TextureSettings {
|
|
|
11
11
|
manager?: LoadingManager;
|
|
12
12
|
onProgress?: (event: ProgressEvent) => void;
|
|
13
13
|
}
|
|
14
|
-
export type LoaderConstructor = new (manager: ResourceManager) =>
|
|
14
|
+
export type LoaderConstructor = new (manager: ResourceManager) => Loader;
|
|
15
15
|
export declare class ResourceManager {
|
|
16
16
|
static extension(path: string): string;
|
|
17
17
|
static dirname(path: string): string;
|
|
@@ -22,7 +22,7 @@ export declare class ResourceManager {
|
|
|
22
22
|
}): {};
|
|
23
23
|
private _loaders;
|
|
24
24
|
destroy(): void;
|
|
25
|
-
getLoader(ext: string):
|
|
26
|
-
addLoader(Loader: LoaderConstructor):
|
|
25
|
+
getLoader(ext: string): Loader;
|
|
26
|
+
addLoader(Loader: LoaderConstructor): Loader;
|
|
27
27
|
loadAsset<T = any>({ url, buffer, ext, path, resourcePath, dracoPath, manager, onProgress, ...props }: AssetProperties): Promise<T>;
|
|
28
28
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export declare const CinestationBlendStyle: {
|
|
2
|
-
Linear: import("../
|
|
3
|
-
QuadraticIn: import("../
|
|
4
|
-
QuadraticOut: import("../
|
|
5
|
-
QuadraticInOut: import("../
|
|
2
|
+
Linear: import("../math/Easing").EasingFunction;
|
|
3
|
+
QuadraticIn: import("../math/Easing").EasingFunction;
|
|
4
|
+
QuadraticOut: import("../math/Easing").EasingFunction;
|
|
5
|
+
QuadraticInOut: import("../math/Easing").EasingFunction;
|
|
6
6
|
};
|
|
7
7
|
export type CinestationBlendStyle = typeof CinestationBlendStyle[keyof typeof CinestationBlendStyle];
|
|
8
8
|
export declare class CinestationBlendDefinition {
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
import { Component } from "../Component";
|
|
3
|
+
import { __E } from "../types";
|
|
4
|
+
export type AccumulativeShadowsProps = {
|
|
5
|
+
/** How many frames it can render, more yields cleaner results but takes more time, 40 */
|
|
6
|
+
frames?: number;
|
|
7
|
+
/** If frames === Infinity blend controls the refresh ratio, 100 */
|
|
8
|
+
blend?: number;
|
|
9
|
+
/** Can limit the amount of frames rendered if frames === Infinity, usually to get some performance back once a movable scene has settled, Infinity */
|
|
10
|
+
limit?: number;
|
|
11
|
+
/** Scale of the plane, */
|
|
12
|
+
scale?: number;
|
|
13
|
+
/** Temporal accumulates shadows over time which is more performant but has a visual regression over instant results, false */
|
|
14
|
+
temporal?: boolean;
|
|
15
|
+
/** Opacity of the plane, 1 */
|
|
16
|
+
opacity?: number;
|
|
17
|
+
/** Discards alpha pixels, 0.65 */
|
|
18
|
+
alphaTest?: number;
|
|
19
|
+
/** Shadow color, black */
|
|
20
|
+
color?: string;
|
|
21
|
+
/** Colorblend, how much colors turn to black, 0 is black, 2 */
|
|
22
|
+
colorBlend?: number;
|
|
23
|
+
/** Buffer resolution, 1024 */
|
|
24
|
+
resolution?: number;
|
|
25
|
+
/** Texture tonemapping */
|
|
26
|
+
toneMapped?: boolean;
|
|
27
|
+
randomLights?: RandomizedLight[];
|
|
28
|
+
};
|
|
29
|
+
export declare class AccumulativeShadows extends Component {
|
|
30
|
+
temporal: boolean;
|
|
31
|
+
frames: number;
|
|
32
|
+
count: number;
|
|
33
|
+
limit: number;
|
|
34
|
+
blend: number;
|
|
35
|
+
constructor({ temporal, frames, limit, blend, scale, opacity, alphaTest, color, colorBlend, resolution, toneMapped, randomLights, ...props }?: AccumulativeShadowsProps);
|
|
36
|
+
reset?(): void;
|
|
37
|
+
}
|
|
38
|
+
export type RandomizedLightProps = __E & {
|
|
39
|
+
/** How many frames it will jiggle the lights, 1.
|
|
40
|
+
* Frames is context aware, if a provider like AccumulativeShadows exists, frames will be taken from there! */
|
|
41
|
+
frames?: number;
|
|
42
|
+
/** Light position, [0, 0, 0] */
|
|
43
|
+
position?: THREE.Vector3;
|
|
44
|
+
/** Radius of the jiggle, higher values make softer light, 5 */
|
|
45
|
+
radius?: number;
|
|
46
|
+
/** Amount of lights, 8 */
|
|
47
|
+
amount?: number;
|
|
48
|
+
/** Light intensity, 1 */
|
|
49
|
+
intensity?: number;
|
|
50
|
+
/** Ambient occlusion, lower values mean less AO, hight more, you can mix AO and directional light, 0.5 */
|
|
51
|
+
ambient?: number;
|
|
52
|
+
/** If the lights cast shadows, this is true by default */
|
|
53
|
+
castShadow?: boolean;
|
|
54
|
+
/** Default shadow bias, 0 */
|
|
55
|
+
bias?: number;
|
|
56
|
+
/** Default map size, 512 */
|
|
57
|
+
mapSize?: number;
|
|
58
|
+
/** Default size of the shadow camera, 10 */
|
|
59
|
+
size?: number;
|
|
60
|
+
/** Default shadow camera near, 0.5 */
|
|
61
|
+
near?: number;
|
|
62
|
+
/** Default shadow camera far, 500 */
|
|
63
|
+
far?: number;
|
|
64
|
+
};
|
|
65
|
+
export declare class RandomizedLight extends THREE.Group {
|
|
66
|
+
constructor({ castShadow, bias, mapSize, size, near, far, frames, position, radius, amount, intensity, ambient, ...props }?: RandomizedLightProps);
|
|
67
|
+
update?(): void;
|
|
68
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Box3, Group, Object3D, Vector3, Sphere } from "three";
|
|
2
|
+
import { Component } from "../Component";
|
|
3
|
+
import { __E } from "../types";
|
|
4
|
+
export type OnCenterCallbackProps = {
|
|
5
|
+
/** The next parent above <Center> */
|
|
6
|
+
parent: Object3D;
|
|
7
|
+
/** The outmost container group of the <Center> component */
|
|
8
|
+
container: Object3D;
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
depth: number;
|
|
12
|
+
boundingBox: Box3;
|
|
13
|
+
boundingSphere: Sphere;
|
|
14
|
+
center: Vector3;
|
|
15
|
+
verticalAlignment: number;
|
|
16
|
+
horizontalAlignment: number;
|
|
17
|
+
depthAlignment: number;
|
|
18
|
+
};
|
|
19
|
+
export type CenterProps = __E & {
|
|
20
|
+
top?: boolean;
|
|
21
|
+
right?: boolean;
|
|
22
|
+
bottom?: boolean;
|
|
23
|
+
left?: boolean;
|
|
24
|
+
front?: boolean;
|
|
25
|
+
back?: boolean;
|
|
26
|
+
/** Disable all axes */
|
|
27
|
+
disable?: boolean;
|
|
28
|
+
/** Disable x-axis centering */
|
|
29
|
+
disableX?: boolean;
|
|
30
|
+
/** Disable y-axis centering */
|
|
31
|
+
disableY?: boolean;
|
|
32
|
+
/** Disable z-axis centering */
|
|
33
|
+
disableZ?: boolean;
|
|
34
|
+
/** See https://threejs.org/docs/index.html?q=box3#api/en/math/Box3.setFromObject */
|
|
35
|
+
precise?: boolean;
|
|
36
|
+
/** Callback, fires in the useLayoutEffect phase, after measurement */
|
|
37
|
+
onCentered?: (props: OnCenterCallbackProps) => void;
|
|
38
|
+
/** Optional cacheKey to keep the component from recalculating on every render */
|
|
39
|
+
cacheKey?: any;
|
|
40
|
+
children?: Object3D[];
|
|
41
|
+
};
|
|
42
|
+
export declare class Center extends Component<Group> {
|
|
43
|
+
constructor({ disable, disableX, disableY, disableZ, left, right, top, bottom, front, back, onCentered, precise, cacheKey, children, ...props }?: CenterProps);
|
|
44
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const version: number;
|
package/types/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export * from "./types";
|
|
2
2
|
export * from "./base";
|
|
3
|
-
export * from "./tween";
|
|
4
3
|
export * from "./loaders";
|
|
5
4
|
export * from "./cinestation";
|
|
6
5
|
export * from "./primitive";
|
|
@@ -18,5 +17,5 @@ export { property, PropertyManager } from "./PropertyManager";
|
|
|
18
17
|
export { dependencies, DependentMode } from "./ComponentManager";
|
|
19
18
|
export { DeviceInput } from "./DeviceInput";
|
|
20
19
|
export { Orientation } from "./enums/Orientation";
|
|
21
|
-
export {
|
|
20
|
+
export { Loader, type LoadProperties } from "./asset/Loader";
|
|
22
21
|
export { ResourceManager, type AssetProperties } from "./asset/ResourceManager";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Loader, LoadProperties } from "../asset/Loader";
|
|
2
|
+
export declare class BINLoader extends Loader {
|
|
3
|
+
extension: string[];
|
|
4
|
+
salt: number;
|
|
5
|
+
load({ url, buffer, path, resourcePath, dracoPath, manager, onLoad, onProgress, onError }: LoadProperties): void;
|
|
6
|
+
private _loader;
|
|
7
|
+
private _dracoLoader;
|
|
8
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LoadProperties,
|
|
2
|
-
export declare class
|
|
1
|
+
import { LoadProperties, Loader } from "../asset/Loader";
|
|
2
|
+
export declare class EXRLoader extends Loader {
|
|
3
3
|
extension: string[];
|
|
4
4
|
load({ url, path, resourcePath, manager, texSettings, onLoad, onProgress, onError, }: LoadProperties): void;
|
|
5
5
|
private _loader;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LoadProperties,
|
|
2
|
-
export declare class
|
|
1
|
+
import { LoadProperties, Loader } from "../asset/Loader";
|
|
2
|
+
export declare class FBXLoader extends Loader {
|
|
3
3
|
extension: string[];
|
|
4
4
|
load({ url, buffer, path, resourcePath, manager, onLoad, onProgress, onError }: LoadProperties): void;
|
|
5
5
|
private _loader;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LoadProperties,
|
|
2
|
-
export declare class
|
|
1
|
+
import { LoadProperties, Loader } from "../asset/Loader";
|
|
2
|
+
export declare class GLTFLoader extends Loader {
|
|
3
3
|
extension: string[];
|
|
4
4
|
load({ url, buffer, path, resourcePath, dracoPath, manager, onLoad, onProgress, onError }: LoadProperties): void;
|
|
5
5
|
private _loader;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LoadProperties,
|
|
2
|
-
export declare class
|
|
1
|
+
import { LoadProperties, Loader } from "../asset/Loader";
|
|
2
|
+
export declare class HDRLoader extends Loader {
|
|
3
3
|
extension: string[];
|
|
4
4
|
load({ url, path, resourcePath, manager, texSettings, onLoad, onProgress, onError, }: LoadProperties): void;
|
|
5
5
|
private _loader;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LoadProperties,
|
|
2
|
-
export declare class
|
|
1
|
+
import { LoadProperties, Loader } from "../asset/Loader";
|
|
2
|
+
export declare class JSONLoader extends Loader {
|
|
3
3
|
extension: string[];
|
|
4
4
|
load({ url, path, resourcePath, manager, onLoad, onProgress, onError }: LoadProperties): void;
|
|
5
5
|
private _loader;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LoadProperties,
|
|
2
|
-
export declare class
|
|
1
|
+
import { LoadProperties, Loader } from "../asset/Loader";
|
|
2
|
+
export declare class TextureLoader extends Loader {
|
|
3
3
|
extension: string[];
|
|
4
4
|
load({ url, path, resourcePath, manager, texSettings, onLoad, onProgress, onError }: LoadProperties): void;
|
|
5
5
|
private _loader;
|
package/types/loaders/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
1
|
+
export { EXRLoader } from "./EXRLoader";
|
|
2
|
+
export { FBXLoader } from "./FBXLoader";
|
|
3
|
+
export { GLTFLoader } from "./GLTFLoader";
|
|
4
|
+
export { HDRLoader } from "./HDRLoader";
|
|
5
|
+
export { JSONLoader } from "./JSONLoader";
|
|
6
|
+
export { TextureLoader } from "./TextureLoader";
|
|
7
|
+
export { BINLoader } from "./BINLoader";
|
package/types/math/index.d.ts
CHANGED
|
@@ -3,10 +3,12 @@ export declare class DropFile extends Mount {
|
|
|
3
3
|
private _onLoad;
|
|
4
4
|
private _onError;
|
|
5
5
|
private _extensions;
|
|
6
|
-
|
|
6
|
+
private _raw;
|
|
7
|
+
constructor({ onLoad, onError, extension, raw, }?: {
|
|
7
8
|
onLoad?: Function;
|
|
8
9
|
onError?: Function;
|
|
9
10
|
extension?: string | string[];
|
|
11
|
+
raw?: boolean;
|
|
10
12
|
});
|
|
11
13
|
onEnable(): void;
|
|
12
14
|
onDisable(): void;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Vector2 } from "three";
|
|
2
|
+
import { Mount } from "../Mount";
|
|
3
|
+
export declare class UI extends Mount {
|
|
4
|
+
static __loc0: Vector2;
|
|
5
|
+
static __loc1: Vector2;
|
|
6
|
+
static __panOffset: Vector2;
|
|
7
|
+
private _camera;
|
|
8
|
+
private _zoom;
|
|
9
|
+
private _targetZoom;
|
|
10
|
+
private _targetPosition;
|
|
11
|
+
private _button;
|
|
12
|
+
private _touchID;
|
|
13
|
+
private _preLoc0;
|
|
14
|
+
private _preLoc1;
|
|
15
|
+
get layerMask(): number;
|
|
16
|
+
set layerMask(v: number);
|
|
17
|
+
onLoad(): void;
|
|
18
|
+
onDestroy(): void;
|
|
19
|
+
private _onPointerDown;
|
|
20
|
+
private _onPointerUp;
|
|
21
|
+
private _onPointerMove;
|
|
22
|
+
private _onMouseWheel;
|
|
23
|
+
private _onTouchStart;
|
|
24
|
+
private _onTouchMove;
|
|
25
|
+
private _setTargetPosition;
|
|
26
|
+
private _calculatePanDelta;
|
|
27
|
+
update(dt: number): void;
|
|
28
|
+
resize(width: number, height: number): void;
|
|
29
|
+
render(dt: number): void;
|
|
30
|
+
}
|
package/types/plugins/index.d.ts
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
import { ConstructorRepresentation } from "./types";
|
|
3
|
+
type UniformValue = THREE.Texture | THREE.TypedArray | THREE.Matrix4 | THREE.Matrix3 | THREE.Quaternion | THREE.Vector4 | THREE.Vector3 | THREE.Vector2 | THREE.Color | number | boolean | null;
|
|
4
|
+
type Uniforms = Record<string, UniformValue | Record<string, UniformValue> | Array<UniformValue>>;
|
|
5
|
+
export declare function shaderMaterial<U extends Uniforms, M extends THREE.ShaderMaterial & U>(uniforms: U, vertexShader: string, fragmentShader: string): ConstructorRepresentation<M> & {
|
|
6
|
+
key: string;
|
|
7
|
+
};
|
|
8
|
+
export {};
|
package/types/types.d.ts
CHANGED
|
@@ -7,7 +7,25 @@ export type __Properties<T> = Omit<Partial<T>, __FunctionKeys<T>> & {
|
|
|
7
7
|
[k: string]: any;
|
|
8
8
|
};
|
|
9
9
|
export type __C<T> = new (...args: any[]) => T;
|
|
10
|
-
export type
|
|
10
|
+
export type __E = {
|
|
11
|
+
/**
|
|
12
|
+
* The object's local scale.
|
|
13
|
+
*/
|
|
14
|
+
scale?: Vector3;
|
|
15
|
+
/**
|
|
16
|
+
* Object's local position.
|
|
17
|
+
*/
|
|
18
|
+
position?: Vector3;
|
|
19
|
+
/**
|
|
20
|
+
* Object's local rotation
|
|
21
|
+
*/
|
|
22
|
+
rotation?: Euler;
|
|
23
|
+
/**
|
|
24
|
+
* Object's layer mask
|
|
25
|
+
*/
|
|
26
|
+
layer?: number;
|
|
27
|
+
};
|
|
28
|
+
export type __P<T, K extends __C<T>> = __Properties<T> & __E & {
|
|
11
29
|
/**
|
|
12
30
|
* Target node for component
|
|
13
31
|
*/
|
|
@@ -37,22 +55,6 @@ export type __P<T, K extends __C<T>> = __Properties<T> & {
|
|
|
37
55
|
* @example ["top", "bottom", "left", "right", "near", "far", "bias", "width", "height"];
|
|
38
56
|
*/
|
|
39
57
|
shadowArgs?: number[];
|
|
40
|
-
/**
|
|
41
|
-
* The object's local scale.
|
|
42
|
-
*/
|
|
43
|
-
scale?: Vector3;
|
|
44
|
-
/**
|
|
45
|
-
* Object's local position.
|
|
46
|
-
*/
|
|
47
|
-
position?: Vector3;
|
|
48
|
-
/**
|
|
49
|
-
* Object's local rotation
|
|
50
|
-
*/
|
|
51
|
-
rotation?: Euler;
|
|
52
|
-
/**
|
|
53
|
-
* Object's layer mask
|
|
54
|
-
*/
|
|
55
|
-
layer?: number;
|
|
56
58
|
};
|
|
57
59
|
export type __Comp<T, K extends __C<T>> = __Properties<T> & {
|
|
58
60
|
/**
|
|
@@ -60,3 +62,4 @@ export type __Comp<T, K extends __C<T>> = __Properties<T> & {
|
|
|
60
62
|
*/
|
|
61
63
|
args?: ConstructorParameters<K>;
|
|
62
64
|
};
|
|
65
|
+
export type ConstructorRepresentation<T = any> = new (...args: any[]) => T;
|