gl-draw 0.17.0-beta.3 → 0.17.0-beta.30
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/constants.d.ts +0 -1
- package/dist/core/BaseObject/PointerEvent.d.ts +1 -0
- package/dist/core/BaseObject/index.d.ts +4 -4
- package/dist/core/Composer.d.ts +5 -5
- package/dist/core/Lead/Pick.d.ts +35 -3
- package/dist/core/Lead/index.d.ts +5 -6
- package/dist/core/Pages/Pages.d.ts +1 -0
- package/dist/core/Pencil.d.ts +3 -3
- package/dist/core/pass/OutputPass.d.ts +1 -2
- package/dist/index.js +2 -2
- package/dist/index.module.js +498 -407
- package/dist/index.module2.js +1097 -0
- package/dist/index2.js +140 -0
- package/dist/objects/extrudePolygon/createGeometry.d.ts +2 -1
- package/dist/objects/group/index.d.ts +1 -0
- package/dist/objects/index.js +1 -1
- package/dist/objects/index.module.js +339 -379
- package/dist/objects/node/index.d.ts +4 -2
- package/dist/objects/pie/index.d.ts +2 -1
- package/dist/plugins/Worker/getAttributes/conicLine.d.ts +2 -3
- package/dist/plugins/Worker/getAttributes/conicPolygon.d.ts +2 -3
- package/dist/plugins/Worker/getAttributes/extrudePolygon.d.ts +2 -4
- package/dist/plugins/Worker/getAttributes/getCoordinatesArr.d.ts +5 -1
- package/dist/plugins/Worker/getAttributes/getMessage.d.ts +1 -1
- package/dist/plugins/Worker/getAttributes/line.d.ts +2 -2
- package/dist/plugins/Worker/getAttributes/line2.d.ts +2 -2
- package/dist/plugins/Worker/getAttributes/splitPolygonsByLongitudeDifference.d.ts +5 -2
- package/dist/plugins/Worker/index.d.ts +3 -3
- package/dist/plugins/index.js +1 -1
- package/dist/plugins/index.module.js +77 -57
- package/package.json +1 -1
- package/dist/WebGPULineSegments2.js +0 -140
- package/dist/WebGPULineSegments2.module.js +0 -1031
package/dist/constants.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export default class PointerEvent {
|
|
|
6
6
|
onPointerEvent(type: PickFunctionsItem['type'], cb: PickFunctionsItem['cb']): void;
|
|
7
7
|
onClick(cb: PickFunctionsItem['cb']): void;
|
|
8
8
|
onPointerEnter(cb: PickFunctionsItem['cb']): void;
|
|
9
|
+
onPointerEnterOnStop(cb: PickFunctionsItem['cb']): void;
|
|
9
10
|
onPointerLeave(cb: PickFunctionsItem['cb']): void;
|
|
10
11
|
onPointerMove(cb: PickFunctionsItem['cb']): void;
|
|
11
12
|
onPointerDown(cb: PickFunctionsItem['cb']): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Material, Mesh, type Object3D, Points, type SpriteMaterial, Vector3 } from 'three';
|
|
1
|
+
import { type Material, Mesh, type Object3D, Points, type SpriteMaterial, Vector3 } from 'three';
|
|
2
2
|
import type Lead from "../Lead/Lead";
|
|
3
3
|
import type MList from "../MList/MList";
|
|
4
4
|
import type Pencil from "../Pencil";
|
|
@@ -30,7 +30,6 @@ export default class BaseObject extends UseMaterial {
|
|
|
30
30
|
add(...object: Object3D[]): void;
|
|
31
31
|
remove(...object: Object3D[]): void;
|
|
32
32
|
get visible(): boolean;
|
|
33
|
-
get visibleWithAncestors(): boolean;
|
|
34
33
|
create(): void;
|
|
35
34
|
render(): void;
|
|
36
35
|
update(_delta: number, _elapsed: number): void;
|
|
@@ -67,9 +66,10 @@ export default class BaseObject extends UseMaterial {
|
|
|
67
66
|
}): Promise<this>;
|
|
68
67
|
erase(): void;
|
|
69
68
|
handleMaterialChange(mat: Material | null): void;
|
|
70
|
-
enableBloom(): void;
|
|
71
|
-
disableBloom(): void;
|
|
69
|
+
enableBloom(traverse?: boolean): void;
|
|
70
|
+
disableBloom(traverse?: boolean): void;
|
|
72
71
|
disposeTrack: boolean;
|
|
72
|
+
private isDispose;
|
|
73
73
|
dispose(): void;
|
|
74
74
|
}
|
|
75
75
|
export interface IBaseObject extends BaseObject {
|
package/dist/core/Composer.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { Camera, Layers, Material, Scene, Vector2, WebGLRenderer } from 'three';
|
|
1
|
+
import { type Camera, Layers, type Material, type Scene, Vector2, type WebGLRenderer } from 'three';
|
|
2
2
|
import { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer';
|
|
3
3
|
import { RenderPass } from 'three/examples/jsm/postprocessing/RenderPass';
|
|
4
4
|
import { SSAOPass } from 'three/examples/jsm/postprocessing/SSAOPass';
|
|
5
5
|
import { UnrealBloomPass } from 'three/examples/jsm/postprocessing/UnrealBloomPass';
|
|
6
6
|
import type { IBaseObject } from './BaseObject';
|
|
7
|
-
import CameraController from './Camera';
|
|
7
|
+
import type CameraController from './Camera';
|
|
8
8
|
import getMixPass from './pass/MixPass';
|
|
9
9
|
import { OutputPass } from './pass/OutputPass';
|
|
10
|
-
import RendererController from './Renderer';
|
|
11
|
-
import SceneController from './Scene';
|
|
10
|
+
import type RendererController from './Renderer';
|
|
11
|
+
import type SceneController from './Scene';
|
|
12
12
|
export interface BloomParams {
|
|
13
13
|
threshold: number;
|
|
14
14
|
strength: number;
|
|
@@ -70,7 +70,7 @@ export default class {
|
|
|
70
70
|
bloomLayer: Layers;
|
|
71
71
|
bloomMaterials: Record<string, Material | Material[]>;
|
|
72
72
|
bloomVisible: Record<string, boolean>;
|
|
73
|
-
|
|
73
|
+
checkBloomComposerActive(): void;
|
|
74
74
|
enable(): void;
|
|
75
75
|
disable(): void;
|
|
76
76
|
setSize(width: number, height: number): void;
|
package/dist/core/Lead/Pick.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { IBaseObject } from "../BaseObject";
|
|
2
|
-
import Pencil from "../Pencil";
|
|
1
|
+
import type { IBaseObject } from "../BaseObject";
|
|
2
|
+
import type Pencil from "../Pencil";
|
|
3
3
|
export type PickFunctionsItem = {
|
|
4
4
|
objArr: IBaseObject[] | (() => IBaseObject[]);
|
|
5
|
-
type: 'move' | 'enter' | 'leave' | 'down' | 'click' | 'downOutside';
|
|
5
|
+
type: 'move' | 'enter' | 'leave' | 'down' | 'click' | 'downOutside' | 'enterOnStop';
|
|
6
6
|
cb: (data: {
|
|
7
7
|
baseObject: IBaseObject;
|
|
8
8
|
realBaseObject?: IBaseObject;
|
|
@@ -23,6 +23,19 @@ export default class Pick {
|
|
|
23
23
|
private prevActiveObjects;
|
|
24
24
|
private objCallbackMap;
|
|
25
25
|
private pickListener;
|
|
26
|
+
/** 是否有 enterOnStop 事件注册 */
|
|
27
|
+
private hasEnterOnStopEvent;
|
|
28
|
+
/** 需要检测 cursor 的物体 Map<obj, cursorStyle> */
|
|
29
|
+
private cursorObjects;
|
|
30
|
+
private cursorListenerAdded;
|
|
31
|
+
/** 用于检测鼠标停止移动 */
|
|
32
|
+
private moveStopTimer;
|
|
33
|
+
private moveStopDelay;
|
|
34
|
+
private lastMoveEvent;
|
|
35
|
+
private lastMoveActiveObjects;
|
|
36
|
+
private lastMoveRealActiveObject;
|
|
37
|
+
/** 已经触发过 enterOnStop 的物体,用于防止重复触发 */
|
|
38
|
+
private triggeredEnterOnStopObjects;
|
|
26
39
|
private domElement;
|
|
27
40
|
constructor(pencil: Pencil);
|
|
28
41
|
private addPickListener;
|
|
@@ -30,6 +43,25 @@ export default class Pick {
|
|
|
30
43
|
private processObjectHierarchy;
|
|
31
44
|
private handleLeaveEvents;
|
|
32
45
|
private handleDownOutside;
|
|
46
|
+
/** 处理鼠标停止移动事件 */
|
|
47
|
+
private handleMoveStop;
|
|
48
|
+
/** 触发 enterOnStop 事件 */
|
|
49
|
+
private triggerEnterOnStop;
|
|
50
|
+
/** 重置鼠标样式 */
|
|
51
|
+
private resetCursor;
|
|
52
|
+
/** 添加 cursor 检测监听器 */
|
|
53
|
+
private addCursorListener;
|
|
54
|
+
/**
|
|
55
|
+
* 启用物体的 cursor 检测
|
|
56
|
+
* @param obj 要检测的 BaseObject
|
|
57
|
+
* @param cursor 鼠标样式,默认 'pointer'
|
|
58
|
+
*/
|
|
59
|
+
enableCursor(obj: IBaseObject, cursor?: string): void;
|
|
60
|
+
/**
|
|
61
|
+
* 禁用物体的 cursor 检测
|
|
62
|
+
* @param obj 要移除的 BaseObject
|
|
63
|
+
*/
|
|
64
|
+
disableCursor(obj: IBaseObject): void;
|
|
33
65
|
handlePick(objArr: PickFunctionsItem['objArr'], t: PickFunctionsItem['type'], cb: PickFunctionsItem['cb']): number;
|
|
34
66
|
removePick(key: number): void;
|
|
35
67
|
handlePickNode(objArr: PickFunctionsItem['objArr'], t: PickFunctionsItem['type'], cb: PickFunctionsItem['cb']): number;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { Scene } from 'three';
|
|
2
|
-
import Lead from './Lead';
|
|
3
|
-
import Pencil from "../Pencil";
|
|
4
|
-
import Pages from "../Pages";
|
|
1
|
+
import type { Scene } from 'three';
|
|
5
2
|
import type MList from "../MList/MList";
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
import Pages from "../Pages";
|
|
4
|
+
import type Pencil from "../Pencil";
|
|
5
|
+
import Lead from './Lead';
|
|
6
|
+
export type LeadParams = {};
|
|
8
7
|
export declare const defaultDrawParams: {};
|
|
9
8
|
interface Options {
|
|
10
9
|
leadParams?: LeadParams;
|
package/dist/core/Pencil.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventEmitter } from 'events';
|
|
2
2
|
import Stats from 'stats-gl';
|
|
3
|
-
import { type Object3D, type PerspectiveCamera, Timer, Vector3 } from 'three';
|
|
3
|
+
import { type Object3D, type PerspectiveCamera, Raycaster, Timer, Vector3 } from 'three';
|
|
4
4
|
import CameraController, { type CameraParams } from "./Camera";
|
|
5
5
|
import ComposerController, { type BloomParams, type ComposerParams, type SSAOParams } from "./Composer";
|
|
6
6
|
import ControlsController, { type ControlsParams } from "./Controls";
|
|
@@ -58,7 +58,7 @@ export default class Pencil {
|
|
|
58
58
|
mListController: MListController;
|
|
59
59
|
stats?: Stats;
|
|
60
60
|
private resizeObserver;
|
|
61
|
-
|
|
61
|
+
raycaster: Raycaster;
|
|
62
62
|
private maxBackufferArea;
|
|
63
63
|
installPlugins: Map<string, any>;
|
|
64
64
|
getPlugin(name: 'worker'): Wk;
|
|
@@ -144,7 +144,7 @@ export default class Pencil {
|
|
|
144
144
|
removePage(index: number): void;
|
|
145
145
|
showPage(index: number): void;
|
|
146
146
|
private pageActiveIndex;
|
|
147
|
-
private
|
|
147
|
+
private pages;
|
|
148
148
|
private init;
|
|
149
149
|
private initComposer;
|
|
150
150
|
private initCSSRenderer;
|
|
@@ -11,9 +11,8 @@ declare class OutputPassFix extends OutputPass {
|
|
|
11
11
|
value: number;
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
|
-
|
|
14
|
+
fsQuad: FullScreenQuad | undefined;
|
|
15
15
|
_fsQuad: FullScreenQuad | undefined;
|
|
16
16
|
}
|
|
17
17
|
import { OutputPass } from 'three/examples/jsm/postprocessing/OutputPass';
|
|
18
|
-
import { RawShaderMaterial } from 'three';
|
|
19
18
|
import { FullScreenQuad } from 'three/examples/jsm/postprocessing/Pass';
|