gl-draw 0.15.20 → 0.15.21
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/WebGPULineSegments2.js +139 -0
- package/dist/WebGPULineSegments2.module.js +1014 -0
- package/dist/core/BaseObject/index.d.ts +2 -1
- package/dist/core/Composer.d.ts +5 -5
- package/dist/core/ResourceTracker.d.ts +1 -1
- package/dist/index.js +23 -23
- package/dist/index.module.js +64 -60
- package/dist/objects/conicPolygon/geometry/index.d.ts +4 -4
- package/dist/objects/index.d.ts +8 -8
- package/dist/objects/index.js +1 -1
- package/dist/objects/index.module.js +954 -927
- package/dist/objects/line/createGeometry.d.ts +2 -2
- package/dist/objects/line/index.d.ts +5 -5
- package/dist/objects/line/meshLine/MeshLineGeometry.d.ts +16 -35
- package/dist/objects/line/meshLine/MeshLineMaterial.d.ts +67 -41
- package/dist/objects/line/meshLine/fragment.d.ts +1 -0
- package/dist/objects/line/meshLine/index.d.ts +1 -0
- package/dist/objects/line/meshLine/raycast.d.ts +3 -0
- package/dist/objects/line/meshLine/vertex.d.ts +1 -0
- package/dist/plugins/index.js +1 -1
- package/dist/plugins/index.module.js +24 -24
- package/package.json +1 -1
- package/dist/index.module2.js +0 -1173
- package/dist/index2.js +0 -149
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MeshLineGeometry } from './meshLine';
|
|
2
|
-
import type {
|
|
2
|
+
import type { PointsInput } from './meshLine/MeshLineGeometry';
|
|
3
3
|
interface Options {
|
|
4
|
-
nodes:
|
|
4
|
+
nodes: PointsInput;
|
|
5
5
|
setPointWidth?: (p: number) => any;
|
|
6
6
|
}
|
|
7
7
|
declare const _default: (options: Options) => MeshLineGeometry;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { BufferGeometry } from 'three';
|
|
2
2
|
import BaseObject from "../../core/BaseObject";
|
|
3
3
|
import { MeshLineMaterial } from './meshLine';
|
|
4
|
+
import type { PointsInput } from './meshLine/MeshLineGeometry';
|
|
4
5
|
import type { MeshLineMaterialParameters } from './meshLine/MeshLineMaterial';
|
|
5
|
-
import type { PointsRepresentation } from './meshLine/MeshLineGeometry';
|
|
6
6
|
interface Options {
|
|
7
|
-
nodes?:
|
|
8
|
-
nodesArr?:
|
|
7
|
+
nodes?: PointsInput;
|
|
8
|
+
nodesArr?: PointsInput[];
|
|
9
9
|
geometry?: BufferGeometry;
|
|
10
10
|
geometryArr?: BufferGeometry[];
|
|
11
11
|
material?: MeshLineMaterial;
|
|
@@ -20,11 +20,11 @@ export default class Line extends BaseObject {
|
|
|
20
20
|
constructor(options?: Partial<Options>);
|
|
21
21
|
get material(): MeshLineMaterial;
|
|
22
22
|
create(): Promise<void>;
|
|
23
|
-
setGeometry(nodes:
|
|
23
|
+
setGeometry(nodes: PointsInput, setPointWidth?: (p: number) => any): void;
|
|
24
24
|
getMaterial(materialOptions: Omit<MeshLineMaterialParameters, 'resolution'>): MeshLineMaterial;
|
|
25
25
|
addGeometries(geometries: BufferGeometry[]): void;
|
|
26
26
|
resize(w: number, h: number): void;
|
|
27
|
-
|
|
27
|
+
handleMaterialChange(mat: MeshLineMaterial | null): void;
|
|
28
28
|
animate({ duration, delay, repeat, lineLoop, onRepeat, onUpdate, onComplete, startShow, }?: {
|
|
29
29
|
duration?: number;
|
|
30
30
|
delay?: number;
|
|
@@ -1,40 +1,21 @@
|
|
|
1
|
-
import { BufferGeometry,
|
|
2
|
-
export type
|
|
3
|
-
export type
|
|
1
|
+
import { BufferGeometry, Matrix4, Vector2, Vector3 } from 'three';
|
|
2
|
+
export type WidthCallback = (p: number) => number;
|
|
3
|
+
export type PointsInput = Vector3[] | Vector2[] | number[][] | number[];
|
|
4
4
|
export declare class MeshLineGeometry extends BufferGeometry {
|
|
5
5
|
type: string;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
side: number[];
|
|
11
|
-
width: number[];
|
|
12
|
-
indices_array: number[];
|
|
13
|
-
uvs: number[];
|
|
14
|
-
counters: number[];
|
|
15
|
-
widthCallback: WidthCallback | null;
|
|
16
|
-
_attributes: {
|
|
17
|
-
position: BufferAttribute;
|
|
18
|
-
previous: BufferAttribute;
|
|
19
|
-
next: BufferAttribute;
|
|
20
|
-
side: BufferAttribute;
|
|
21
|
-
width: BufferAttribute;
|
|
22
|
-
uv: BufferAttribute;
|
|
23
|
-
index: BufferAttribute;
|
|
24
|
-
counters: BufferAttribute;
|
|
25
|
-
};
|
|
26
|
-
_points: Float32Array | number[];
|
|
27
|
-
points: Float32Array | number[];
|
|
6
|
+
private pointCount;
|
|
7
|
+
private _points;
|
|
8
|
+
private shape;
|
|
9
|
+
private shapeFunction;
|
|
28
10
|
matrixWorld: Matrix4;
|
|
29
|
-
constructor();
|
|
11
|
+
constructor(points?: PointsInput, shape?: 'none' | 'taper' | 'custom', shapeFunction?: WidthCallback);
|
|
12
|
+
private convertToVector3Array;
|
|
30
13
|
setMatrixWorld(matrixWorld: Matrix4): void;
|
|
31
|
-
setPoints(points:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
*/
|
|
39
|
-
advance({ x, y, z }: Vector3): void;
|
|
14
|
+
setPoints(points: PointsInput, shapeFunction?: WidthCallback): void;
|
|
15
|
+
private initializeGeometry;
|
|
16
|
+
private updateGeometry;
|
|
17
|
+
get points(): Vector3[];
|
|
18
|
+
set points(value: PointsInput);
|
|
19
|
+
updatePoints(points: PointsInput, shapeFunction?: WidthCallback): void;
|
|
20
|
+
setShape(shape: 'none' | 'taper' | 'custom', shapeFunction?: WidthCallback): void;
|
|
40
21
|
}
|
|
@@ -1,49 +1,75 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface MeshLineMaterialParameters {
|
|
3
|
-
|
|
1
|
+
import { Color, type ColorRepresentation, ShaderMaterial, type ShaderMaterialParameters, Texture, Vector2 } from 'three';
|
|
2
|
+
export interface MeshLineMaterialParameters extends ShaderMaterialParameters {
|
|
3
|
+
/**
|
|
4
|
+
* Line width
|
|
5
|
+
* @default 1
|
|
6
|
+
*/
|
|
4
7
|
lineWidth?: number;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
color?:
|
|
8
|
+
/**
|
|
9
|
+
* Line color
|
|
10
|
+
* @default '#ffffff'
|
|
11
|
+
*/
|
|
12
|
+
color?: ColorRepresentation;
|
|
10
13
|
opacity?: number;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Texture map
|
|
16
|
+
*/
|
|
17
|
+
map?: Texture;
|
|
18
|
+
/**
|
|
19
|
+
* Dash offset for dashed lines
|
|
20
|
+
* @default 0
|
|
21
|
+
*/
|
|
14
22
|
dashOffset?: number;
|
|
23
|
+
/**
|
|
24
|
+
* Dash array for dashed lines
|
|
25
|
+
* @default 0
|
|
26
|
+
*/
|
|
27
|
+
dashArray?: number;
|
|
28
|
+
/**
|
|
29
|
+
* Dash ratio for dashed lines
|
|
30
|
+
* @default 0
|
|
31
|
+
*/
|
|
15
32
|
dashRatio?: number;
|
|
16
|
-
|
|
17
|
-
|
|
33
|
+
/**
|
|
34
|
+
* Whether to apply size attenuation (alias for attenuate)
|
|
35
|
+
* @default true
|
|
36
|
+
*/
|
|
37
|
+
sizeAttenuation?: boolean;
|
|
38
|
+
offsetLoop?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Scale down factor
|
|
41
|
+
* @default 0
|
|
42
|
+
*/
|
|
43
|
+
scaleDown?: number;
|
|
44
|
+
/**
|
|
45
|
+
* Alpha map texture
|
|
46
|
+
*/
|
|
47
|
+
alphaMap?: Texture | undefined;
|
|
18
48
|
alphaTest?: number;
|
|
49
|
+
/**
|
|
50
|
+
* Texture repeat
|
|
51
|
+
* @default Vector2(1, 1)
|
|
52
|
+
*/
|
|
19
53
|
repeat?: Vector2;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
uCenter?: Vector2;
|
|
26
|
-
lightColor?: string | Color | number;
|
|
27
|
-
transparent?: boolean;
|
|
28
|
-
depthTest?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Screen resolution for line width calculation
|
|
56
|
+
*/
|
|
57
|
+
resolution?: Vector2;
|
|
58
|
+
offset?: Vector2;
|
|
29
59
|
}
|
|
30
|
-
export declare class MeshLineMaterial extends ShaderMaterial
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
visibility: number;
|
|
46
|
-
repeat: Vector2;
|
|
47
|
-
constructor(parameters: MeshLineMaterialParameters);
|
|
48
|
-
copy(source: MeshLineMaterial): this;
|
|
60
|
+
export declare class MeshLineMaterial extends ShaderMaterial {
|
|
61
|
+
type: string;
|
|
62
|
+
constructor(parameters?: MeshLineMaterialParameters);
|
|
63
|
+
get color(): Color;
|
|
64
|
+
set color(value: ColorRepresentation);
|
|
65
|
+
get opacity(): number;
|
|
66
|
+
set opacity(value: number);
|
|
67
|
+
get map(): Texture | null;
|
|
68
|
+
set map(value: Texture | null);
|
|
69
|
+
get repeat(): Vector2;
|
|
70
|
+
set repeat(value: Vector2);
|
|
71
|
+
get lineWidth(): number;
|
|
72
|
+
set lineWidth(value: number);
|
|
73
|
+
get sizeAttenuation(): boolean;
|
|
74
|
+
set sizeAttenuation(value: boolean);
|
|
49
75
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const fragmentShader: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const vertexShader: string;
|