@soonspacejs/plugin-effect 2.16.8 → 3.0.0-alpha.0

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/index.d.ts CHANGED
@@ -1,195 +1,784 @@
1
- import { Blending } from 'three';
2
- import { default as SoonSpace, IVector3, IColor, PluginObject, PluginObjectInfo } from 'soonspacejs';
3
- import { ParticleClusterOptions } from '@three3d/particle';
4
- import { InnerCircleWaveOptions } from './circle-wave';
5
- import { InnerCylinderWaveOptions } from './cylinder-wave';
6
- import { WaterOptions } from './water';
7
- export * from '@three3d/particle';
8
- export interface FlameOptions extends PluginObjectInfo {
9
- magnitude?: number;
10
- gain?: number;
11
- imgUrl?: string;
12
- }
13
- export interface SmokeOptions extends PluginObjectInfo {
14
- imgUrl?: string;
15
- count?: number;
16
- maxAge?: number;
17
- size?: number;
18
- acceleration?: number;
19
- velocity?: IVector3;
20
- color?: IColor[];
21
- }
22
- export interface Smoke2Options extends PluginObjectInfo {
23
- imgUrl?: string;
24
- radius?: number;
25
- maxLife?: number;
26
- maxSize?: number;
27
- rate?: number;
28
- colors?: IColor[];
29
- blending?: Blending;
30
- }
31
- export interface SparklesOptions extends PluginObjectInfo {
32
- count?: number;
33
- speed?: number | Float32Array;
34
- opacity?: number | Float32Array;
35
- color?: IColor | Float32Array;
36
- size?: number | Float32Array;
37
- scalar?: number | [number, number, number] | IVector3;
38
- noise?: number | [number, number, number] | IVector3 | Float32Array;
39
- }
40
- export interface CreateWaterOptions extends PluginObjectInfo, Omit<WaterOptions, 'userData'> {
41
- /**
42
- * 是否开启水的动画
43
- * @remarks
44
- * 如果开启,则会一直触发场景渲染
45
- * 如果关闭,则不会主动触发场景渲染,但在渲染渲染时仍会有动画效果,只是不会主动触发场景渲染
46
- */
47
- animation?: boolean;
48
- }
49
- export interface ContactShadowsOptions extends Omit<PluginObjectInfo, 'scale'> {
50
- opacity?: number;
51
- width?: number;
52
- height?: number;
53
- blur?: number;
54
- far?: number;
55
- resolution?: number;
56
- frames?: number;
57
- scale?: number | [x: number, y: number];
58
- darkness?: number;
59
- }
60
- export interface WeatherOptions {
61
- /**
62
- * 粒子贴图
63
- */
64
- imgUrl?: string;
65
- /**
66
- * 颜色
67
- */
68
- color?: IColor;
69
- /**
70
- * 大小
71
- */
72
- size?: number;
73
- /**
74
- * 不透明度
75
- */
76
- opacity?: number;
77
- /**
78
- * 粒子数量
79
- */
80
- count?: number;
81
- /**
82
- * 粒子范围
83
- */
84
- range?: number;
85
- /**
86
- * 粒子左右速度的随机范围
87
- */
88
- velocityX?: [number, number];
89
- /**
90
- * 粒子上下速度的随机范围
91
- */
92
- velocityY?: [number, number];
93
- }
94
- export type CircleWaveOptions = InnerCircleWaveOptions & PluginObjectInfo;
95
- export type CylinderWaveOptions = InnerCylinderWaveOptions & PluginObjectInfo;
96
- export interface PointsWaveOptions extends PluginObjectInfo {
97
- xAxisCount?: number;
98
- zAxisCount?: number;
99
- showDistance?: number;
100
- separation?: number;
101
- size?: number;
102
- maxFluctua?: number;
103
- color?: IColor;
104
- opacity?: number;
105
- }
106
- export interface BuildsOptions extends PluginObjectInfo {
107
- buildWidth?: number;
108
- buildHeigh?: number;
109
- buildDepth?: number;
110
- count?: number;
111
- gapX?: number;
112
- gapZ?: number;
113
- showDistance?: number;
114
- randShift?: number;
115
- color?: IColor;
116
- }
117
- declare class EffectPlugin {
118
- readonly ssp: SoonSpace;
119
- [x: string]: any;
120
- /**
121
- * 天气预设图片
122
- */
123
- readonly weatherPresetImgs: {
124
- rain: string;
125
- snow: string;
126
- };
127
- private _weatherId;
128
- constructor(ssp: SoonSpace);
129
- /**
130
- * 创建火焰
131
- * @params params
132
- * @returns
133
- */
134
- createFlame(params: FlameOptions): PluginObject;
135
- /**
136
- * 创建烟雾
137
- * @param params
138
- * @returns
139
- */
140
- createSmoke(params: SmokeOptions): PluginObject;
141
- createSmoke2(params: Smoke2Options): PluginObject;
142
- /**
143
- * 创建星星
144
- * @param params
145
- * @returns
146
- */
147
- createSparkles(params: SparklesOptions): PluginObject;
148
- /**
149
- * 创建接触阴影
150
- * @params params
151
- */
152
- createContactShadows({ scale, frames, opacity, width, height, blur, darkness, far, resolution, ...props }: ContactShadowsOptions): PluginObject;
153
- /**
154
- * 开启天气
155
- * @param param0
156
- */
157
- openWeather(params?: WeatherOptions): void;
158
- /**
159
- * 关闭天气
160
- */
161
- closeWeather(): void;
162
- /**
163
- * 创建粒子簇
164
- * @param options
165
- * @returns
166
- */
167
- createParticleCluster(options: ParticleClusterOptions): any;
168
- /**
169
- * 创建圆形光波
170
- * @param options
171
- * @returns
172
- */
173
- createCircleWave(options: CircleWaveOptions): PluginObject;
174
- /**
175
- * 创建立柱光波
176
- * @param options
177
- * @returns
178
- */
179
- createCylinderWave(options: CylinderWaveOptions): PluginObject;
180
- /**
181
- * 创建粒子波浪
182
- * @param options
183
- * @returns
184
- */
185
- createPointsWave(options: PointsWaveOptions): PluginObject;
186
- /**
187
- * 创建建筑
188
- * @param options
189
- * @returns
190
- */
191
- createBuilds(options: BuildsOptions): PluginObject;
192
- createWater(options: CreateWaterOptions): PluginObject;
193
- removeEffect(id: PluginObjectInfo['id']): boolean;
194
- }
195
- export default EffectPlugin;
1
+ import { Blending } from 'three';
2
+ import { BufferGeometry } from 'three';
3
+ import { ColorRepresentation } from 'three';
4
+ import { default as default_2 } from 'soonspacejs';
5
+ import { IColor } from 'soonspacejs';
6
+ import { IVector3 } from 'soonspacejs';
7
+ import { Matrix4 } from 'three';
8
+ import { PluginObject } from 'soonspacejs';
9
+ import { PluginObjectInfo } from 'soonspacejs';
10
+ import { Points } from 'three';
11
+ import { PointsMaterialParameters } from 'three';
12
+ import { ShaderMaterialParameters } from 'three';
13
+ import { Texture } from 'three';
14
+ import { Vector2 } from 'three';
15
+ import { Vector3 } from 'three';
16
+ import { Vector4 } from 'three';
17
+
18
+ /**
19
+ * 累积值的类型
20
+ */
21
+ export declare type AccumulateValue = Required<Omit<ParticleClusterFeature, "densityGradient" | "valueGradient">> & GradientParams;
22
+
23
+ export declare interface BuildsOptions extends PluginObjectInfo {
24
+ buildWidth?: number;
25
+ buildHeigh?: number;
26
+ buildDepth?: number;
27
+ count?: number;
28
+ gapX?: number;
29
+ gapZ?: number;
30
+ showDistance?: number;
31
+ randShift?: number;
32
+ color?: IColor;
33
+ }
34
+
35
+ export declare type CircleWaveOptions = InnerCircleWaveOptions & PluginObjectInfo;
36
+
37
+ /**
38
+ * 簇几何体
39
+ */
40
+ export declare class ClusterGeometry extends BufferGeometry {
41
+ readonly isClusterGeometry = true;
42
+ constructor(options?: ClusterGeometryOptions);
43
+ protected _options?: Partial<ClusterGeometryOptions> | null;
44
+ /**
45
+ * 选项
46
+ */
47
+ get options(): Partial<ClusterGeometryOptions>;
48
+ set options(options: Partial<ClusterGeometryOptions>);
49
+ /**
50
+ * 梯度
51
+ */
52
+ get gradient(): ColorGradient | ImageData | null | undefined;
53
+ set gradient(value: ColorGradient | ImageData | null | undefined);
54
+ protected _colorGradient?: ImageData | null;
55
+ get colorGradient(): ImageData | null;
56
+ set colorGradient(value: ImageData | null);
57
+ /**
58
+ * 创建颜色梯度
59
+ * @param gradient
60
+ * @returns
61
+ */
62
+ createColorGradient(gradient?: ColorGradient | ImageData | null): ImageData | null;
63
+ /**
64
+ * 更新顶点颜色
65
+ * @returns
66
+ */
67
+ updateVertexColors(): false | undefined;
68
+ get clim(): IVector2;
69
+ set clim(value: IVector2);
70
+ /**
71
+ * 簇列表
72
+ */
73
+ get clusters(): ParticleClusterData<IVector3_2>[] | undefined;
74
+ set clusters(value: ParticleClusterData<IVector3_2>[] | undefined);
75
+ /**
76
+ * 更新顶点
77
+ * @returns
78
+ */
79
+ updateVertices(): void;
80
+ protected _values?: number[] | null;
81
+ /**
82
+ * 顶点对应的值列表
83
+ */
84
+ get values(): number[];
85
+ set values(val: number[]);
86
+ /**
87
+ * 添加簇
88
+ * @param cluster
89
+ * @returns
90
+ */
91
+ addCluster(cluster: ParticleClusterData<IVector3_2>[] | ParticleClusterData<IVector3_2>): void;
92
+ /**
93
+ * 添加值和顶点颜色
94
+ * @param values
95
+ * @returns
96
+ */
97
+ addValueColors(values: number[]): false | undefined;
98
+ }
99
+
100
+ /**
101
+ * 簇几何体的选项
102
+ */
103
+ export declare interface ClusterGeometryOptions {
104
+ /**
105
+ * 颜色映射纹理
106
+ */
107
+ gradient?: ColorGradient | ImageData | null;
108
+ /**
109
+ * 簇数据
110
+ */
111
+ clusters: ParticleClusterData<IVector3_2>[];
112
+ /**
113
+ * 映射区间
114
+ * @remarks
115
+ * x 为最小值,y 为最大值
116
+ *
117
+ * @defaultValue {x:0,y:100}
118
+ */
119
+ clim?: IVector2;
120
+ }
121
+
122
+ /**
123
+ * 簇类型
124
+ */
125
+ export declare enum ClusterType {
126
+ Point = 0,
127
+ Line = 1,
128
+ Heat = 2
129
+ }
130
+
131
+ /**
132
+ * 颜色梯度,颜色断点列表
133
+ * @remarks
134
+ * 颜色断点可以不按顺序排列
135
+ */
136
+ declare type ColorGradient = ColorStop[];
137
+
138
+ /**
139
+ * 颜色断点
140
+ * @remarks
141
+ * number 的范围是 0-1,表示断点的位置;
142
+ *
143
+ * string 表示颜色,支持 css 所支持的所有颜色格式;
144
+ */
145
+ declare type ColorStop = [number, string];
146
+
147
+ export declare interface ContactShadowsOptions extends Omit<PluginObjectInfo, 'scale'> {
148
+ opacity?: number;
149
+ width?: number;
150
+ height?: number;
151
+ blur?: number;
152
+ far?: number;
153
+ resolution?: number;
154
+ frames?: number;
155
+ scale?: number | [x: number, y: number];
156
+ darkness?: number;
157
+ }
158
+
159
+ /**
160
+ * 生成点云
161
+ * @param pointInfo - 点信息
162
+ * @param intersects - 相交的点列表
163
+ * @returns
164
+ */
165
+ export declare function createHeatParticleClusterData<IVec extends IVector>(pointInfo: Required<HeatParticleClusterFeaturePoint<IVec>>, intersects: Required<HeatParticleClusterFeaturePoint<IVec>>[]): ParticleClusterData<IVec>;
166
+
167
+ /**
168
+ * 为很多点创建点粒子族列
169
+ * @param options
170
+ * @returns
171
+ */
172
+ export declare function createHeatParticleClusterDataArr<IVec extends IVector>(options: CreateHeatParticleClusterDataArrOptions<IVec>): ParticleClusterData<IVec>[];
173
+
174
+ /**
175
+ * 很多热力点粒子族
176
+ */
177
+ export declare interface CreateHeatParticleClusterDataArrOptions<IVec extends IVector> extends HeatParticleClusterFeature {
178
+ points: HeatParticleClusterFeaturePoint<IVec>[];
179
+ }
180
+
181
+ declare interface CreateLineParticleClusterDataArrOptions<IVec extends IVector> extends CreatePointParticleClusterDataArrOptions<IVec> {
182
+ radiusGradient?: GetLineGradientValue;
183
+ lineDensityGradient?: GetLineGradientValue;
184
+ lineValueGradient?: GetLineGradientValue;
185
+ /**
186
+ * 对折线进行插件时步长
187
+ * @defaultValue 与 `step` 相同
188
+ */
189
+ lineStep?: number;
190
+ }
191
+
192
+ /**
193
+ * 生成点云
194
+ * @param options
195
+ * @returns
196
+ */
197
+ export declare function createPointParticleClusterData<IVec extends IVector>(pointInfo: PointParticleClusterInfo<IVec>, lineOptions?: LinePointInfo): ParticleClusterData<IVec>;
198
+
199
+ /**
200
+ * 为很多点创建点粒子族列
201
+ * @param options
202
+ * @returns
203
+ */
204
+ export declare function createPointParticleClusterDataArr<IVec extends IVector>(options: CreatePointParticleClusterDataArrOptions<IVec>): ParticleClusterData<IVec>[];
205
+
206
+ /**
207
+ * 很多点粒子族
208
+ */
209
+ export declare interface CreatePointParticleClusterDataArrOptions<IVec extends IVector> extends ParticleClusterFeature {
210
+ points: ParticleClusterFeaturePoint<IVec>[];
211
+ }
212
+
213
+ export declare interface CreateWaterOptions extends PluginObjectInfo, Omit<WaterOptions, 'userData'> {
214
+ /**
215
+ * 是否开启水的动画
216
+ * @remarks
217
+ * 如果开启,则会一直触发场景渲染
218
+ * 如果关闭,则不会主动触发场景渲染,但在渲染渲染时仍会有动画效果,只是不会主动触发场景渲染
219
+ */
220
+ animation?: boolean;
221
+ }
222
+
223
+ export declare type CylinderWaveOptions = InnerCylinderWaveOptions & PluginObjectInfo;
224
+
225
+ /**
226
+ * 默认的密度梯度函数
227
+ * @param param0
228
+ * @returns
229
+ */
230
+ export declare function densityGradient_Default({ ratio, density }: GradientParams): number;
231
+
232
+ declare class EffectPlugin {
233
+ readonly ssp: default_2;
234
+ [x: string]: any;
235
+ /**
236
+ * 天气预设图片
237
+ */
238
+ readonly weatherPresetImgs: {
239
+ rain: string;
240
+ snow: string;
241
+ };
242
+ private _weatherId;
243
+ constructor(ssp: default_2);
244
+ /**
245
+ * 创建火焰
246
+ * @params params
247
+ * @returns
248
+ */
249
+ createFlame(params: FlameOptions): PluginObject;
250
+ /**
251
+ * 创建烟雾
252
+ * @param params
253
+ * @returns
254
+ */
255
+ createSmoke(params: SmokeOptions): PluginObject;
256
+ createSmoke2(params: Smoke2Options): PluginObject;
257
+ /**
258
+ * 创建星星
259
+ * @param params
260
+ * @returns
261
+ */
262
+ createSparkles(params: SparklesOptions): PluginObject;
263
+ /**
264
+ * 创建接触阴影
265
+ * @params params
266
+ */
267
+ createContactShadows(options: ContactShadowsOptions): PluginObject;
268
+ /**
269
+ * 开启天气
270
+ * @param param0
271
+ */
272
+ openWeather(params?: WeatherOptions): void;
273
+ /**
274
+ * 关闭天气
275
+ */
276
+ closeWeather(): void;
277
+ /**
278
+ * 创建粒子簇
279
+ * @param options
280
+ * @returns
281
+ */
282
+ createParticleCluster(options: ParticleClusterOptions): any;
283
+ /**
284
+ * 创建圆形光波
285
+ * @param options
286
+ * @returns
287
+ */
288
+ createCircleWave(options: CircleWaveOptions): PluginObject;
289
+ /**
290
+ * 创建立柱光波
291
+ * @param options
292
+ * @returns
293
+ */
294
+ createCylinderWave(options: CylinderWaveOptions): PluginObject;
295
+ /**
296
+ * 创建粒子波浪
297
+ * @param options
298
+ * @returns
299
+ */
300
+ createPointsWave(options: PointsWaveOptions): PluginObject;
301
+ /**
302
+ * 创建建筑
303
+ * @param options
304
+ * @returns
305
+ */
306
+ createBuilds(options: BuildsOptions): PluginObject;
307
+ createWater(options: CreateWaterOptions): PluginObject;
308
+ removeEffect(id: PluginObjectInfo['id']): boolean;
309
+ }
310
+ export default EffectPlugin;
311
+
312
+ export declare interface FlameOptions extends PluginObjectInfo {
313
+ magnitude?: number;
314
+ gain?: number;
315
+ imgUrl?: string;
316
+ }
317
+
318
+ /**
319
+ * 密度梯度函数
320
+ */
321
+ export declare type GetGradientValue = (params: GradientParams) => number;
322
+
323
+ declare type GetLineGradientValue = (params: LineGradientParams) => number;
324
+
325
+ /**
326
+ * 在圆形区域内生成随机向量
327
+ * @param axisNum - 向量的轴数
328
+ * @returns
329
+ */
330
+ export declare function getRandomVector_Circle(axisNum: number): number[];
331
+
332
+ /**
333
+ * 在环形区域内生成随机向量
334
+ * @remarks
335
+ * 随机生成的向量长度在 start 到 start+space 之间
336
+ * @param axisNum - 向量的轴数
337
+ * @param start - 向量的起始长度
338
+ * @param space - 随机空间的长度
339
+ * @returns
340
+ */
341
+ export declare function getRandomVector_CircleAnnular(axisNum: number, start: number, space: number): number[];
342
+
343
+ /**
344
+ * 在圆柱区域内生成随机向量
345
+ * @param axisNum - 向量的轴数
346
+ * @param height - 方轴的高度
347
+ * @returns 包含向量各个分量的轴列表
348
+ */
349
+ export declare function getRandomVector_CircleCylinder(axisNum: number, height: number): number[];
350
+
351
+ /**
352
+ * 在圆环柱区域内生成随机向量
353
+ * @param axisNum - 向量的轴数
354
+ * @param start - 向量的起始长度
355
+ * @param space - 随机空间的长度
356
+ * @param height - 方轴的高度
357
+ * @returns 包含向量各个分量的轴列表
358
+ */
359
+ export declare function getRandomVector_CircleCylinderAnnular(axisNum: number, start: number, space: number, height: number): number[];
360
+
361
+ /**
362
+ * 在方式区域内生成随机向量
363
+ * @param axisNum - 向量的轴数
364
+ * @returns
365
+ */
366
+ export declare function getRandomVector_Square(axisNum: number): number[];
367
+
368
+ /**
369
+ * 在方环形区域内生成随机向量
370
+ * @remarks
371
+ * 随机生成的向量长度在 start 到 start+space 之间
372
+ * @param axisNum - 向量的轴数
373
+ * @param start - 向量的起始长度
374
+ * @param space - 随机空间的长度
375
+ * @returns
376
+ */
377
+ export declare function getRandomVector_SquareAnnular(axisNum: number, start: number, space: number): number[];
378
+
379
+ /**
380
+ * 在方柱区域内生成随机向量
381
+ * @param axisNum - 向量的轴数
382
+ * @param height - 方轴的高度
383
+ * @returns 包含向量各个分量的轴列表
384
+ */
385
+ export declare function getRandomVector_SquareCylinder(axisNum: number, height: number): number[];
386
+
387
+ /**
388
+ * 在方环柱区域内生成随机向量
389
+ * @param axisNum - 向量的轴数
390
+ * @param height - 方轴的高度
391
+ * @param start - 向量的起始长度
392
+ * @param space - 随机空间的长度
393
+ * @returns 包含向量各个分量的轴列表
394
+ */
395
+ export declare function getRandomVector_SquareCylinderAnnular(axisNum: number, start: number, space: number, height: number): number[];
396
+
397
+ /**
398
+ * 梯度函数的参数
399
+ */
400
+ export declare interface GradientParams {
401
+ /**
402
+ * 梯度的变化比率
403
+ * @remarks
404
+ * 当作为 DensityGradient 的参数时,表示
405
+ * - 在 solidRadius 半径处为 0
406
+ * - 在 radius 处为 1
407
+ * 当作为 ValueGradient 的参数时,表示
408
+ * - 在 0 半径处为 0
409
+ * - 在 radius 处为 1
410
+ */
411
+ ratio: number;
412
+ radius: number;
413
+ solid: number;
414
+ solidRadius: number;
415
+ gradientRadius: number;
416
+ hollow: number;
417
+ hollowRadius: number;
418
+ distance: number;
419
+ density: number;
420
+ value: number;
421
+ clim: IVector2;
422
+ }
423
+
424
+ export declare interface HeatParticleClusterFeature extends ParticleClusterFeature {
425
+ valuesAccumulate?: ValuesAccumulate;
426
+ }
427
+
428
+ export declare type HeatParticleClusterFeaturePoint<IVec extends IVector> = HeatParticleClusterFeature & IVec;
429
+
430
+ declare interface InnerCircleWaveOptions {
431
+ textureUrl: string[];
432
+ position: IVector3;
433
+ width: number;
434
+ height: number;
435
+ isScaleAnimate: boolean;
436
+ isOpacityAnimate: boolean;
437
+ }
438
+
439
+ declare interface InnerCylinderWaveOptions {
440
+ position: IVector3;
441
+ topRadius: number;
442
+ bottomRadius: number;
443
+ height: number;
444
+ texturePath: string;
445
+ color: string;
446
+ }
447
+
448
+ /**
449
+ * 向量
450
+ */
451
+ declare type IVector = IVector2 | IVector3_2 | IVector4;
452
+
453
+ /**
454
+ * 二维向量
455
+ */
456
+ declare interface IVector2 {
457
+ x: number;
458
+ y: number;
459
+ }
460
+
461
+ /**
462
+ * 三维向量
463
+ */
464
+ declare interface IVector3_2 extends IVector2 {
465
+ z: number;
466
+ }
467
+
468
+ /**
469
+ * 四维向量
470
+ */
471
+ declare interface IVector4 extends IVector3_2 {
472
+ w: number;
473
+ }
474
+
475
+ /**
476
+ * 向量接口类型转向量类型
477
+ */
478
+ declare type IVectorToVector<V extends IVector> = V extends IVector4 ? Vector4 : (V extends IVector3_2 ? Vector3 : Vector2);
479
+
480
+ declare interface LineGradientParams {
481
+ ratio: number;
482
+ length: number;
483
+ startRadius: number;
484
+ endRadius: number;
485
+ addedRadius: number;
486
+ defaultRadius: number;
487
+ index: number;
488
+ startDensity: number;
489
+ endDensity: number;
490
+ addedDensity: number;
491
+ defaultDensity: number;
492
+ startValue: number;
493
+ endValue: number;
494
+ addedValue: number;
495
+ defaultValue: number;
496
+ }
497
+
498
+ export declare interface LinePointInfo {
499
+ lineStep: number;
500
+ matrix: Matrix4;
501
+ }
502
+
503
+ export declare class ParticleCluster extends Points {
504
+ readonly isParticleCluster = true;
505
+ constructor(options?: ParticleClusterOptions);
506
+ get options(): ParticleClusterGeometryOptions;
507
+ set options(value: ParticleClusterGeometryOptions);
508
+ setOptions(options: ParticleClusterGeometryOptions): void;
509
+ addPoint(point: ParticleClusterFeaturePoint<IVector3_2>[] | ParticleClusterFeaturePoint<IVector3_2>, options?: Omit<ParticleClusterGeometryOptions, "points">): void;
510
+ convertPoints(points: ParticleClusterFeaturePoint<IVector3_2>[]): ParticleClusterFeatureVector<IVector3_2>[];
511
+ }
512
+
513
+ /**
514
+ * 粒子簇信息
515
+ */
516
+ export declare interface ParticleClusterData<IVec extends IVector> {
517
+ /**
518
+ * 粒子的坐标列表
519
+ */
520
+ particles: IVectorToVector<IVec>[];
521
+ /**
522
+ * 每个粒子对应的值
523
+ */
524
+ values: number[];
525
+ }
526
+
527
+ /**
528
+ * 粒子簇特征
529
+ */
530
+ export declare interface ParticleClusterFeature {
531
+ /**
532
+ * 半径
533
+ *
534
+ * @defaultValue 10
535
+ */
536
+ radius?: number;
537
+ /**
538
+ * 值
539
+ *
540
+ * @defaultValue 100
541
+ */
542
+ value?: number;
543
+ /**
544
+ * 实心因子
545
+ *
546
+ * @defaultValue 0.7
547
+ */
548
+ solid?: number;
549
+ /**
550
+ * 空心因子
551
+ *
552
+ * @defaultValue 0
553
+ */
554
+ hollow?: number;
555
+ /**
556
+ * 中心点的密度
557
+ * @remarks
558
+ * 单位空间中有多少个点
559
+ *
560
+ * @defaultValue 1
561
+ */
562
+ density?: number;
563
+ /**
564
+ * 粒子云的形状
565
+ */
566
+ shape?: ParticleClusterShape;
567
+ /**
568
+ * 密度梯度函数
569
+ */
570
+ densityGradient?: GetGradientValue;
571
+ valueGradient?: GetGradientValue;
572
+ /**
573
+ * 映射区间
574
+ * @remarks
575
+ * x 为最小值,y 为最大值
576
+ *
577
+ * @defaultValue {x:0,y:100}
578
+ */
579
+ clim?: IVector2;
580
+ /**
581
+ * 生成粒子时使用的距离步长
582
+ * @remarks
583
+ * 这个也会影响粒子的密度 和 粒子个数;
584
+ * 建议所有粒子的步长一样;
585
+ *
586
+ * @defaultValue 3
587
+ */
588
+ step?: number;
589
+ }
590
+
591
+ /**
592
+ * 粒子簇特性点
593
+ */
594
+ export declare type ParticleClusterFeaturePoint<IVec extends IVector> = ParticleClusterFeature & IVec;
595
+
596
+ /**
597
+ * 粒子簇特性向量
598
+ */
599
+ export declare type ParticleClusterFeatureVector<IVec extends IVector> = ParticleClusterFeature & IVectorToVector<IVec>;
600
+
601
+ export declare class ParticleClusterGeometry extends ClusterGeometry {
602
+ readonly isParticleClusterGeometry = true;
603
+ constructor(options?: ParticleClusterGeometryOptions);
604
+ get options(): ParticleClusterGeometryOptions;
605
+ set options(value: ParticleClusterGeometryOptions);
606
+ get clusterType(): ClusterType | undefined;
607
+ set clusterType(value: ClusterType | undefined);
608
+ setOptions(options: ParticleClusterGeometryOptions): void;
609
+ updateClusters(): void;
610
+ createClusters(options: ParticleClusterGeometryOptions): ParticleClusterData<IVector3_2>[];
611
+ /**
612
+ * 添加点
613
+ * @param point
614
+ * @param options
615
+ */
616
+ addPoint(point: ParticleClusterFeaturePoint<IVector3_2>[] | ParticleClusterFeaturePoint<IVector3_2>, options?: Omit<ParticleClusterGeometryOptions, "points">): void;
617
+ }
618
+
619
+ /**
620
+ * ParticleClusterGeometry 的选项
621
+ */
622
+ export declare type ParticleClusterGeometryOptions = CreatePointParticleClusterDataArrOptions<IVector3_2> & CreateLineParticleClusterDataArrOptions<IVector3_2> & CreateHeatParticleClusterDataArrOptions<IVector3_2> & Omit<ClusterGeometryOptions, "clusters"> & {
623
+ clusterType?: ClusterType;
624
+ };
625
+
626
+ /**
627
+ * createPointParticleClusterObject3D 的选项
628
+ */
629
+ export declare type ParticleClusterOptions = ParticleClusterGeometryOptions & PointsMaterialParameters;
630
+
631
+ /**
632
+ * 粒子云的形状
633
+ */
634
+ export declare enum ParticleClusterShape {
635
+ /**
636
+ * 圆形
637
+ */
638
+ Circle = 0,
639
+ /**
640
+ * 方形
641
+ */
642
+ Square = 1
643
+ }
644
+
645
+ /**
646
+ * 点粒子簇
647
+ */
648
+ export declare type PointParticleClusterInfo<IVec extends IVector> = Required<ParticleClusterFeature> & IVectorToVector<IVec>;
649
+
650
+ export declare interface PointsWaveOptions extends PluginObjectInfo {
651
+ xAxisCount?: number;
652
+ zAxisCount?: number;
653
+ showDistance?: number;
654
+ separation?: number;
655
+ size?: number;
656
+ maxFluctua?: number;
657
+ color?: IColor;
658
+ opacity?: number;
659
+ }
660
+
661
+ export declare interface Smoke2Options extends PluginObjectInfo {
662
+ imgUrl?: string;
663
+ radius?: number;
664
+ maxLife?: number;
665
+ maxSize?: number;
666
+ rate?: number;
667
+ colors?: IColor[];
668
+ blending?: Blending;
669
+ }
670
+
671
+ export declare interface SmokeOptions extends PluginObjectInfo {
672
+ imgUrl?: string;
673
+ count?: number;
674
+ maxAge?: number;
675
+ size?: number;
676
+ acceleration?: number;
677
+ velocity?: IVector3;
678
+ color?: IColor[];
679
+ }
680
+
681
+ export declare interface SparklesOptions extends PluginObjectInfo {
682
+ count?: number;
683
+ speed?: number | Float32Array;
684
+ opacity?: number | Float32Array;
685
+ color?: IColor | Float32Array;
686
+ size?: number | Float32Array;
687
+ scalar?: number | [number, number, number] | IVector3;
688
+ noise?: number | [number, number, number] | IVector3 | Float32Array;
689
+ }
690
+
691
+ /**
692
+ * 默认的值梯度函数
693
+ */
694
+ export declare function valueGradient_Default({ ratio, value }: GradientParams): number;
695
+
696
+ /**
697
+ * 值类型函数
698
+ */
699
+ export declare type ValuesAccumulate = (values: AccumulateValue[], clim: IVector2, density: number) => number;
700
+
701
+ export declare function valuesAccumulate_Default(values: AccumulateValue[], clim: IVector2): number;
702
+
703
+ declare interface WaterOptions extends ShaderMaterialParameters {
704
+ /**
705
+ * 水面的多边形区域
706
+ */
707
+ polygon: IVector3[];
708
+ /**
709
+ * 水面的高度
710
+ * @remarks
711
+ * 默认为第一个顶点的 y 值
712
+ */
713
+ height?: number;
714
+ /**
715
+ * 太阳的照射的方向
716
+ */
717
+ sunDirection?: Vector3;
718
+ /**
719
+ * 太阳的颜色
720
+ */
721
+ sunColor?: ColorRepresentation;
722
+ /**
723
+ * 水的颜色
724
+ */
725
+ waterColor?: ColorRepresentation;
726
+ /**
727
+ * 水波的强度
728
+ */
729
+ distortionScale?: number;
730
+ /**
731
+ * 透明度
732
+ */
733
+ alpha?: number;
734
+ /**
735
+ * 速度
736
+ */
737
+ speed?: number;
738
+ /**
739
+ * 水面法线纹理
740
+ */
741
+ waterNormals?: string | Texture;
742
+ fog?: boolean;
743
+ eye?: Vector3;
744
+ clipBias?: number;
745
+ textureWidth?: number;
746
+ textureHeight?: number;
747
+ }
748
+
749
+ export declare interface WeatherOptions {
750
+ /**
751
+ * 粒子贴图
752
+ */
753
+ imgUrl?: string;
754
+ /**
755
+ * 颜色
756
+ */
757
+ color?: IColor;
758
+ /**
759
+ * 大小
760
+ */
761
+ size?: number;
762
+ /**
763
+ * 不透明度
764
+ */
765
+ opacity?: number;
766
+ /**
767
+ * 粒子数量
768
+ */
769
+ count?: number;
770
+ /**
771
+ * 粒子范围
772
+ */
773
+ range?: number;
774
+ /**
775
+ * 粒子左右速度的随机范围
776
+ */
777
+ velocityX?: [number, number];
778
+ /**
779
+ * 粒子上下速度的随机范围
780
+ */
781
+ velocityY?: [number, number];
782
+ }
783
+
784
+ export { }