gl-draw 0.13.2 → 0.13.3
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/core/BaseObject.d.ts +2 -2
- package/dist/core/Camera.d.ts +1 -1
- package/dist/core/Composer.d.ts +0 -3
- package/dist/{plugins/Draw.d.ts → core/Lead/Lead.d.ts} +11 -11
- package/dist/core/Lead/index.d.ts +23 -0
- package/dist/core/Loader/Loader.d.ts +0 -1
- package/dist/core/Pencil.d.ts +6 -8
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/index.module.js +895 -680
- package/dist/index.module2.js +516 -266
- package/dist/index2.js +7 -4
- package/dist/objects/index.js +1 -1
- package/dist/objects/index.module.js +38 -40
- package/dist/objects/node/index.d.ts +1 -1
- package/dist/parseVector.js +1 -1
- package/dist/parseVector.module.js +23 -11
- package/dist/plugins/index.d.ts +0 -1
- package/dist/plugins/index.js +1 -1
- package/dist/plugins/index.module.js +89 -406
- package/dist/utils/index.js +1 -1
- package/dist/utils/index.module.js +15 -16
- package/package.json +1 -2
- package/dist/BaseObject.js +0 -4
- package/dist/BaseObject.module.js +0 -253
- package/dist/core/GUIObject.d.ts +0 -24
- package/dist/index.module3.js +0 -9
- package/dist/index3.js +0 -1
- package/dist/polar2Cartesian.js +0 -1
- package/dist/polar2Cartesian.module.js +0 -14
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
2
|
import type Pencil from "./Pencil";
|
|
3
|
-
import type Draw from "
|
|
4
|
-
import type { PickFunctionsItem } from "
|
|
3
|
+
import type Draw from "./Lead/Lead";
|
|
4
|
+
import type { PickFunctionsItem } from "./Lead/Lead";
|
|
5
5
|
export { CSS3DObject, CSS3DSprite, } from 'three/examples/jsm/renderers/CSS3DRenderer';
|
|
6
6
|
export { CSS2DObject } from 'three/examples/jsm/renderers/CSS2DRenderer';
|
|
7
7
|
export default class BaseObject {
|
package/dist/core/Camera.d.ts
CHANGED
package/dist/core/Composer.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
|
-
import GUI from 'lil-gui';
|
|
3
2
|
import CameraController from './Camera';
|
|
4
3
|
import SceneController from './Scene';
|
|
5
4
|
import RendererController from './Renderer';
|
|
@@ -66,9 +65,7 @@ export default class {
|
|
|
66
65
|
addOutputPass(): void;
|
|
67
66
|
setPremultiplieAlpha(premultiplieAlpha: boolean): void;
|
|
68
67
|
addSSAOPass(params: SSAOParams): void;
|
|
69
|
-
addSSAOGui(gui: GUI): void;
|
|
70
68
|
addBloomPass(params: BloomParams): void;
|
|
71
|
-
addBloomGui(gui: GUI): void;
|
|
72
69
|
bloomSelection: Set<THREE.Object3D<THREE.Object3DEventMap>>;
|
|
73
70
|
bloomLayer: THREE.Layers;
|
|
74
71
|
bloomMaterials: Record<string, THREE.Material | THREE.Material[]>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
|
-
import { IBaseObject } from "../
|
|
3
|
-
import Group from "
|
|
4
|
-
import Pencil from "../
|
|
2
|
+
import { IBaseObject } from "../BaseObject";
|
|
3
|
+
import Group from "../../objects/group";
|
|
4
|
+
import Pencil from "../Pencil";
|
|
5
5
|
type KeyOf<T extends object> = Extract<keyof T, string>;
|
|
6
6
|
export type PickFunctionsItem = {
|
|
7
7
|
objArr: IBaseObject[] | (() => IBaseObject[]);
|
|
@@ -10,9 +10,7 @@ export type PickFunctionsItem = {
|
|
|
10
10
|
};
|
|
11
11
|
export default class Draw<T extends {
|
|
12
12
|
[key: string]: new (...args: any[]) => IBaseObject;
|
|
13
|
-
}> {
|
|
14
|
-
pluginName: string;
|
|
15
|
-
pencil: Pencil;
|
|
13
|
+
} = any> {
|
|
16
14
|
objMap: Map<THREE.Object3D<THREE.Object3DEventMap>, IBaseObject>;
|
|
17
15
|
targetNullMap: Map<THREE.Object3D<THREE.Object3DEventMap>, IBaseObject>;
|
|
18
16
|
objects: Map<string, IBaseObject>;
|
|
@@ -20,13 +18,14 @@ export default class Draw<T extends {
|
|
|
20
18
|
prefabGroupMap: Map<THREE.Scene, Group>;
|
|
21
19
|
get group(): Group | undefined;
|
|
22
20
|
get prefabGroup(): Group | undefined;
|
|
23
|
-
|
|
21
|
+
pencil: Pencil;
|
|
22
|
+
get scene(): THREE.Scene;
|
|
24
23
|
private objectNamesToFactories;
|
|
25
24
|
get objectsPromise(): Promise<any>[];
|
|
26
|
-
constructor(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
constructor(pencil: Pencil, objectFactories: T);
|
|
26
|
+
init<K extends {
|
|
27
|
+
[key: string]: new (...args: any[]) => IBaseObject;
|
|
28
|
+
}>(objectFactories: K): Draw<K>;
|
|
30
29
|
getObject<Y extends KeyOf<T>>(nameOrigin: Y, options?: {
|
|
31
30
|
key: string;
|
|
32
31
|
}): InstanceType<T[Y]> | undefined;
|
|
@@ -53,6 +52,7 @@ export default class Draw<T extends {
|
|
|
53
52
|
private addBaseObject;
|
|
54
53
|
erase(...args: (KeyOf<T> | `${KeyOf<T>}#${string}` | InstanceType<T[keyof T]>)[]): void;
|
|
55
54
|
eraseWithoutMaterial(...args: (KeyOf<T> | `${KeyOf<T>}#${string}` | InstanceType<T[keyof T]>)[]): void;
|
|
55
|
+
private handleErase;
|
|
56
56
|
private removeBaseObject;
|
|
57
57
|
update(delta: number, elapsed: number): void;
|
|
58
58
|
setSize(width: number, height: number): void;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import Lead from './Lead';
|
|
2
|
+
import { EventEmitter } from 'events';
|
|
3
|
+
import Pencil from "../Pencil";
|
|
4
|
+
export interface LeadParams {
|
|
5
|
+
}
|
|
6
|
+
export declare const defaultDrawParams: {};
|
|
7
|
+
interface Options {
|
|
8
|
+
leadParams?: LeadParams;
|
|
9
|
+
pencil: Pencil;
|
|
10
|
+
}
|
|
11
|
+
export default class {
|
|
12
|
+
event: EventEmitter;
|
|
13
|
+
options: Options;
|
|
14
|
+
leadArr: Lead[];
|
|
15
|
+
leadActiveIndex: number;
|
|
16
|
+
get lead(): Lead<any>;
|
|
17
|
+
constructor(options: Options);
|
|
18
|
+
addLead(): Lead<{}>;
|
|
19
|
+
removeLoader(index: number): void;
|
|
20
|
+
setLeadActive(index: number): void;
|
|
21
|
+
dispose(): void;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
package/dist/core/Pencil.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import * as THREE from 'three';
|
|
|
2
2
|
import { Timer } from 'three/examples/jsm/misc/Timer';
|
|
3
3
|
import { EventEmitter } from 'events';
|
|
4
4
|
import Stats from 'stats-gl';
|
|
5
|
-
import GUI from 'lil-gui';
|
|
6
5
|
import RendererController, { RendererParams } from "./Renderer";
|
|
7
6
|
import CameraController, { CameraParams } from "./Camera";
|
|
8
7
|
import SceneController, { SceneParams } from "./Scene";
|
|
@@ -12,14 +11,14 @@ import TransformController from "./TransformControls";
|
|
|
12
11
|
import CSSRendererController, { CSSRendererParams } from "./CSSRenderer";
|
|
13
12
|
import ComposerController, { BloomParams, SSAOParams, ComposerParams } from "./Composer";
|
|
14
13
|
import LoaderController, { LoaderParams } from "./Loader";
|
|
15
|
-
import
|
|
14
|
+
import LeadController from "./Lead";
|
|
15
|
+
import type { Wk } from "../plugins";
|
|
16
16
|
type DeepRequired<T> = T extends Function | HTMLElement ? T : T extends object ? {
|
|
17
17
|
[P in keyof T]-?: DeepRequired<T[P]>;
|
|
18
18
|
} : T;
|
|
19
19
|
interface Options {
|
|
20
20
|
container: HTMLElement;
|
|
21
21
|
stats?: boolean;
|
|
22
|
-
gui?: boolean;
|
|
23
22
|
helper?: boolean;
|
|
24
23
|
viewHelper?: boolean;
|
|
25
24
|
controls?: Partial<ControlsParams>;
|
|
@@ -55,13 +54,12 @@ export default class Pencil {
|
|
|
55
54
|
sceneController: SceneController;
|
|
56
55
|
helperController?: HelperController;
|
|
57
56
|
loaderController: LoaderController;
|
|
57
|
+
leadController: LeadController;
|
|
58
58
|
stats?: Stats;
|
|
59
|
-
gui?: GUI;
|
|
60
59
|
private resizeObserver;
|
|
61
60
|
private raycaster;
|
|
62
61
|
private maxBackufferArea;
|
|
63
62
|
installPlugins: Map<string, any>;
|
|
64
|
-
getPlugin(name: 'draw'): Draw<any>;
|
|
65
63
|
getPlugin(name: 'worker'): Wk;
|
|
66
64
|
get renderer(): THREE.WebGLRenderer;
|
|
67
65
|
get maxAnisotropy(): number;
|
|
@@ -73,12 +71,12 @@ export default class Pencil {
|
|
|
73
71
|
get camera(): THREE.PerspectiveCamera;
|
|
74
72
|
get scene(): THREE.Scene;
|
|
75
73
|
get loader(): import("./Loader/Loader").default;
|
|
74
|
+
get lead(): import("..").Lead<any>;
|
|
76
75
|
event: EventEmitter;
|
|
77
76
|
timer: Timer;
|
|
78
77
|
userData: Record<string, any>;
|
|
79
78
|
static options: {
|
|
80
79
|
stats: boolean;
|
|
81
|
-
gui: boolean;
|
|
82
80
|
helper: boolean;
|
|
83
81
|
viewHelper: boolean;
|
|
84
82
|
controls: boolean;
|
|
@@ -136,9 +134,9 @@ export default class Pencil {
|
|
|
136
134
|
constructor(options: Options);
|
|
137
135
|
use(plugin: any, ...args: any[]): void;
|
|
138
136
|
pageActiveIndex: number;
|
|
139
|
-
addPage({ sceneOptions, cameraOptions, }
|
|
137
|
+
addPage({ sceneOptions, cameraOptions, }?: {
|
|
140
138
|
sceneOptions?: SceneParams;
|
|
141
|
-
cameraOptions
|
|
139
|
+
cameraOptions?: CameraParams;
|
|
142
140
|
}): number;
|
|
143
141
|
removePage(index: number): void;
|
|
144
142
|
showPage(index: number): void;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { default, default as Pencil } from "./core/Pencil";
|
|
2
2
|
export { default as BaseObject } from "./core/BaseObject";
|
|
3
|
-
export { default as
|
|
3
|
+
export type { default as Lead } from "./core/Lead/Lead";
|
|
4
4
|
export declare const cameraControlsAction: Readonly<{
|
|
5
5
|
readonly NONE: 0;
|
|
6
6
|
readonly ROTATE: 1;
|