@galacean/effects-core 2.9.0-alpha.1 → 2.9.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/animation/animation-events.d.ts +3 -5
- package/dist/components/base-render-component.d.ts +6 -1
- package/dist/components/component.d.ts +6 -1
- package/dist/components/composition-component.d.ts +2 -5
- package/dist/components/frame-component.d.ts +6 -1
- package/dist/components/mesh-component.d.ts +6 -1
- package/dist/components/renderer-component.d.ts +8 -1
- package/dist/components/shape-component.d.ts +2 -0
- package/dist/composition.d.ts +15 -25
- package/dist/effects-object.d.ts +1 -1
- package/dist/engine.d.ts +49 -2
- package/dist/index.js +3064 -1835
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3054 -1835
- package/dist/index.mjs.map +1 -1
- package/dist/material/index.d.ts +1 -0
- package/dist/material/material-state.d.ts +50 -0
- package/dist/material/material.d.ts +109 -285
- package/dist/material/types.d.ts +2 -0
- package/dist/math/index.d.ts +1 -0
- package/dist/math/shape/build-adaptive-bezier.d.ts +1 -1
- package/dist/math/shape/circle.d.ts +1 -1
- package/dist/math/shape/ellipse.d.ts +1 -1
- package/dist/math/shape/graphics-path.d.ts +1 -1
- package/dist/math/shape/poly-star.d.ts +1 -1
- package/dist/math/shape/polygon.d.ts +1 -1
- package/dist/math/shape/rectangle.d.ts +1 -1
- package/dist/math/shape/shape-path.d.ts +1 -1
- package/dist/math/shape/shape-primitive.d.ts +1 -1
- package/dist/math/shape/triangle.d.ts +1 -1
- package/dist/plugin-system.d.ts +1 -1
- package/dist/plugins/camera/camera-controller-node.d.ts +5 -2
- package/dist/plugins/interact/click-handler.d.ts +5 -0
- package/dist/plugins/interact/interact-item.d.ts +1 -1
- package/dist/plugins/particle/particle-mesh.d.ts +0 -1
- package/dist/plugins/particle/particle-system-renderer.d.ts +3 -3
- package/dist/plugins/particle/particle-system.d.ts +6 -23
- package/dist/plugins/particle/trail-mesh.d.ts +1 -2
- package/dist/plugins/plugin.d.ts +1 -1
- package/dist/plugins/text/text-component-base.d.ts +1 -1
- package/dist/plugins/text/text-item.d.ts +1 -1
- package/dist/plugins/text/text-layout.d.ts +7 -0
- package/dist/plugins/timeline/track.d.ts +1 -1
- package/dist/plugins/timeline/tracks/property-track.d.ts +2 -2
- package/dist/render/renderer.d.ts +15 -23
- package/dist/render/shader.d.ts +19 -0
- package/dist/scene-loader.d.ts +2 -0
- package/dist/scene.d.ts +0 -1
- package/dist/texture/texture.d.ts +1 -1
- package/dist/vfx-item.d.ts +18 -3
- package/package.json +2 -2
|
@@ -3,6 +3,7 @@ import { Vector2 } from '@galacean/effects-math/es/core/vector2';
|
|
|
3
3
|
import type * as spec from '@galacean/effects-specification';
|
|
4
4
|
import type { VFXItem } from '../../vfx-item';
|
|
5
5
|
import type { Composition } from '../../composition';
|
|
6
|
+
import type { Maskable } from '../../material';
|
|
6
7
|
export declare enum HitTestType {
|
|
7
8
|
triangle = 1,
|
|
8
9
|
box = 2,
|
|
@@ -28,23 +29,27 @@ export interface HitTestTriangleParams {
|
|
|
28
29
|
type: HitTestType.triangle;
|
|
29
30
|
triangles: TriangleLike[];
|
|
30
31
|
backfaceCulling?: boolean;
|
|
32
|
+
clipMasks: Maskable[];
|
|
31
33
|
behavior?: spec.InteractBehavior;
|
|
32
34
|
}
|
|
33
35
|
export interface HitTestBoxParams {
|
|
34
36
|
type: HitTestType.box;
|
|
35
37
|
center: Vector3;
|
|
36
38
|
size: Vector3;
|
|
39
|
+
clipMasks: Maskable[];
|
|
37
40
|
behavior?: spec.InteractBehavior;
|
|
38
41
|
}
|
|
39
42
|
export interface HitTestSphereParams {
|
|
40
43
|
type: HitTestType.sphere;
|
|
41
44
|
center: Vector3;
|
|
42
45
|
radius: number;
|
|
46
|
+
clipMasks: Maskable[];
|
|
43
47
|
behavior?: spec.InteractBehavior;
|
|
44
48
|
}
|
|
45
49
|
export interface HitTestCustomParams {
|
|
46
50
|
type: HitTestType.custom;
|
|
47
51
|
collect(ray: Ray, pointInCanvas: Vector2): Vector3[] | void;
|
|
52
|
+
clipMasks: Maskable[];
|
|
48
53
|
behavior?: spec.InteractBehavior;
|
|
49
54
|
}
|
|
50
55
|
export type Region = {
|
|
@@ -88,7 +88,7 @@ export declare class InteractComponent extends RendererComponent {
|
|
|
88
88
|
beginDragTarget(options: spec.DragInteractOption, eventSystem: EventSystem): void;
|
|
89
89
|
getHitTestParams: (force?: boolean) => HitTestTriangleParams | void;
|
|
90
90
|
getBoundingBox(): BoundingBoxTriangle | void;
|
|
91
|
-
fromData(data: spec.
|
|
91
|
+
fromData(data: spec.InteractComponentData): void;
|
|
92
92
|
/**
|
|
93
93
|
* 是否可以交互
|
|
94
94
|
* @returns
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Matrix4 } from '@galacean/effects-math/es/core/matrix4';
|
|
2
2
|
import type { Vector3 } from '@galacean/effects-math/es/core/vector3';
|
|
3
3
|
import type { Texture } from '../../texture';
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
4
|
+
import type { TrailPointOptions } from './trail-mesh';
|
|
5
|
+
import type { Point } from './particle-mesh';
|
|
6
6
|
import { ParticleMesh } from './particle-mesh';
|
|
7
7
|
import type { Mesh, Renderer } from '../../render';
|
|
8
8
|
import type { Engine } from '../../engine';
|
|
@@ -14,7 +14,7 @@ export declare class ParticleSystemRenderer extends RendererComponent {
|
|
|
14
14
|
meshes: Mesh[];
|
|
15
15
|
particleMesh: ParticleMesh;
|
|
16
16
|
private trailMesh?;
|
|
17
|
-
constructor(engine: Engine
|
|
17
|
+
constructor(engine: Engine);
|
|
18
18
|
onStart(): void;
|
|
19
19
|
onUpdate(dt: number): void;
|
|
20
20
|
render(renderer: Renderer): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Ray } from '@galacean/effects-math/es/core/index';
|
|
2
2
|
import { Vector3 } from '@galacean/effects-math/es/core/index';
|
|
3
|
-
import type {
|
|
3
|
+
import type { vec3 } from '@galacean/effects-specification';
|
|
4
4
|
import * as spec from '@galacean/effects-specification';
|
|
5
5
|
import { Component } from '../../components';
|
|
6
6
|
import type { Engine } from '../../engine';
|
|
@@ -94,7 +94,6 @@ type TrailOptions = {
|
|
|
94
94
|
blending: number;
|
|
95
95
|
occlusion: boolean;
|
|
96
96
|
transparentOcclusion: boolean;
|
|
97
|
-
textureMap?: vec4;
|
|
98
97
|
};
|
|
99
98
|
interface ParticleTextureSheetAnimation {
|
|
100
99
|
col: number;
|
|
@@ -112,24 +111,7 @@ type ParticleInteraction = {
|
|
|
112
111
|
multiple?: boolean;
|
|
113
112
|
radius: number;
|
|
114
113
|
};
|
|
115
|
-
export interface
|
|
116
|
-
meshSlots?: number[];
|
|
117
|
-
}
|
|
118
|
-
export interface ParticleSystemProps extends Omit<spec.ParticleContent, 'options' | 'renderer' | 'trails' | 'mask'> {
|
|
119
|
-
options: ParticleSystemOptions;
|
|
120
|
-
renderer: ParticleSystemRendererOptions;
|
|
121
|
-
trails?: ParticleTrailProps;
|
|
122
|
-
mask?: spec.MaskOptions;
|
|
123
|
-
}
|
|
124
|
-
export interface ParticleSystemRendererOptions extends Required<Omit<spec.RendererOptions, 'texture' | 'anchor' | 'particleOrigin'>> {
|
|
125
|
-
texture: Texture;
|
|
126
|
-
anchor?: vec2;
|
|
127
|
-
particleOrigin?: spec.ParticleOrigin;
|
|
128
|
-
}
|
|
129
|
-
export interface ParticleTrailProps extends Omit<spec.ParticleTrail, 'texture' | 'mask'> {
|
|
130
|
-
texture: Texture;
|
|
131
|
-
textureMap: vec4;
|
|
132
|
-
mask?: spec.MaskOptions;
|
|
114
|
+
export interface ParticleSystemProps extends spec.ParticleContent {
|
|
133
115
|
}
|
|
134
116
|
export type ParticleContent = [number, number, number, Point];
|
|
135
117
|
export declare class ParticleSystem extends Component implements Maskable {
|
|
@@ -142,7 +124,6 @@ export declare class ParticleSystem extends Component implements Maskable {
|
|
|
142
124
|
textureSheetAnimation?: ParticleTextureSheetAnimation;
|
|
143
125
|
interaction?: ParticleInteraction;
|
|
144
126
|
emissionStopped: boolean;
|
|
145
|
-
destroyed: boolean;
|
|
146
127
|
props: ParticleSystemProps;
|
|
147
128
|
time: number;
|
|
148
129
|
readonly maskManager: MaskProcessor;
|
|
@@ -157,7 +138,9 @@ export declare class ParticleSystem extends Component implements Maskable {
|
|
|
157
138
|
private uvs;
|
|
158
139
|
private basicTransform;
|
|
159
140
|
private clickedPoint;
|
|
160
|
-
|
|
141
|
+
private particleMeshProps;
|
|
142
|
+
private trailMeshProps;
|
|
143
|
+
constructor(engine: Engine, props?: spec.ParticleSystemData);
|
|
161
144
|
get timePassed(): number;
|
|
162
145
|
get lifetime(): number;
|
|
163
146
|
get particleCount(): number;
|
|
@@ -212,6 +195,6 @@ export declare class ParticleSystem extends Component implements Maskable {
|
|
|
212
195
|
resumeParticleEmission(): void;
|
|
213
196
|
getBoundingBox(): void | BoundingBoxSphere;
|
|
214
197
|
getHitTestParams: (force?: boolean) => void | HitTestCustomParams;
|
|
215
|
-
fromData(data:
|
|
198
|
+
fromData(data: spec.ParticleSystemData): void;
|
|
216
199
|
}
|
|
217
200
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Matrix4 } from '@galacean/effects-math/es/core/index';
|
|
2
2
|
import { Vector3 } from '@galacean/effects-math/es/core/index';
|
|
3
3
|
import type * as spec from '@galacean/effects-specification';
|
|
4
|
-
import type { GradientStop
|
|
4
|
+
import type { GradientStop } from '@galacean/effects-specification';
|
|
5
5
|
import type { Engine } from '../../engine';
|
|
6
6
|
import { ValueGetter } from '../../math';
|
|
7
7
|
import type { GPUCapability, ShaderWithSource } from '../../render';
|
|
@@ -24,7 +24,6 @@ export type TrailMeshProps = {
|
|
|
24
24
|
mask: number;
|
|
25
25
|
shaderCachePrefix: string;
|
|
26
26
|
maskMode: number;
|
|
27
|
-
textureMap: vec4;
|
|
28
27
|
name: string;
|
|
29
28
|
};
|
|
30
29
|
export type TrailPointOptions = {
|
package/dist/plugins/plugin.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export declare abstract class Plugin {
|
|
|
32
32
|
* @param composition - 合成对象
|
|
33
33
|
* @param scene - 场景对象
|
|
34
34
|
*/
|
|
35
|
-
onCompositionCreated(composition: Composition, scene
|
|
35
|
+
onCompositionCreated(composition: Composition, scene?: Scene): void;
|
|
36
36
|
/**
|
|
37
37
|
* 合成销毁时触发。
|
|
38
38
|
* @param composition - 合成对象
|
|
@@ -89,7 +89,7 @@ export declare class TextComponentBase {
|
|
|
89
89
|
*/
|
|
90
90
|
setOverflow(overflow: spec.TextOverflow): void;
|
|
91
91
|
protected getFontDesc(size?: number): string;
|
|
92
|
-
protected setupOutline(): void;
|
|
92
|
+
protected setupOutline(fontScale?: number): void;
|
|
93
93
|
protected setupShadow(): void;
|
|
94
94
|
protected disposeTextTexture(): void;
|
|
95
95
|
/**
|
|
@@ -133,7 +133,7 @@ export declare class TextComponent extends MaskableGraphic {
|
|
|
133
133
|
*
|
|
134
134
|
* 说明:
|
|
135
135
|
* - 使用 Canvas 2D 的 measureText,并按当前实现的逐字符排版规则累加宽度(与 updateTexture 保持一致)。
|
|
136
|
-
* - 结果为"逻辑宽度"
|
|
136
|
+
* - 结果为"逻辑宽度"(扣除 fontOffset),可直接写回 options.textWidth。,可直接写回 options.textWidth。
|
|
137
137
|
* - 通过 padding 追加少量冗余像素,用于降低边缘裁切风险。
|
|
138
138
|
*
|
|
139
139
|
* @returns 文本宽度(>= 0)
|
|
@@ -16,6 +16,13 @@ export declare class TextLayout implements BaseLayout {
|
|
|
16
16
|
* 自动宽高模式
|
|
17
17
|
*/
|
|
18
18
|
autoResize: spec.TextSizeMode;
|
|
19
|
+
/**
|
|
20
|
+
* 是否启用单词完整换行(不从单词中间断开)
|
|
21
|
+
* - true: 优先在空格处换行,保持单词完整性
|
|
22
|
+
* - false: 允许在任意字符处换行(逐字符换行)
|
|
23
|
+
* @default true
|
|
24
|
+
*/
|
|
25
|
+
keepWordIntact: boolean;
|
|
19
26
|
constructor(options: spec.TextContentOptions);
|
|
20
27
|
update(options: spec.TextContentOptions): void;
|
|
21
28
|
/**
|
|
@@ -45,7 +45,7 @@ export declare class TrackAsset extends PlayableAsset {
|
|
|
45
45
|
findClip(name: string): TimelineClip | undefined;
|
|
46
46
|
addClip(clip: TimelineClip): void;
|
|
47
47
|
private createClipPlayable;
|
|
48
|
-
fromData(data: spec.
|
|
48
|
+
fromData(data: spec.TrackAssetData): void;
|
|
49
49
|
}
|
|
50
50
|
export declare enum TrackType {
|
|
51
51
|
MasterTrack = 0,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TrackAssetData } from '@galacean/effects-specification';
|
|
2
2
|
import { TrackAsset } from '../track';
|
|
3
3
|
export declare abstract class PropertyTrack extends TrackAsset {
|
|
4
4
|
protected propertyNames: string[];
|
|
5
5
|
protected path: string;
|
|
6
|
-
fromData(data:
|
|
6
|
+
fromData(data: TrackAssetData): void;
|
|
7
7
|
}
|
|
@@ -1,53 +1,44 @@
|
|
|
1
1
|
import type { Matrix4, Vector3, Vector4 } from '@galacean/effects-math/es/core/index';
|
|
2
2
|
import type { RendererComponent } from '../components';
|
|
3
3
|
import type { Engine } from '../engine';
|
|
4
|
-
import
|
|
5
|
-
import type { LostHandler, RestoreHandler } from '../utils';
|
|
4
|
+
import { Material } from '../material';
|
|
6
5
|
import type { FilterMode, Framebuffer, RenderTextureFormat } from './framebuffer';
|
|
7
|
-
import
|
|
8
|
-
import type { RenderFrame
|
|
9
|
-
import type { RenderPassClearAction } from './render-pass';
|
|
6
|
+
import { Geometry } from './geometry';
|
|
7
|
+
import type { RenderFrame } from './render-frame';
|
|
8
|
+
import type { RenderPass, RenderPassClearAction } from './render-pass';
|
|
10
9
|
import type { ShaderLibrary } from './shader';
|
|
11
|
-
import { RenderTargetPool } from './render-target-pool';
|
|
12
10
|
import type { Texture } from '../texture';
|
|
13
|
-
export declare class Renderer
|
|
11
|
+
export declare class Renderer {
|
|
14
12
|
engine: Engine;
|
|
15
|
-
static create
|
|
13
|
+
static create(engine: Engine): Renderer;
|
|
16
14
|
/**
|
|
17
15
|
* 存放渲染需要用到的数据
|
|
18
16
|
*/
|
|
19
|
-
renderingData: RenderingData;
|
|
20
|
-
renderTargetPool: RenderTargetPool;
|
|
21
17
|
protected currentFramebuffer: Framebuffer | null;
|
|
18
|
+
protected disposed: boolean;
|
|
19
|
+
private blitGeometry;
|
|
20
|
+
private blitMaterial;
|
|
22
21
|
constructor(engine: Engine);
|
|
22
|
+
get renderingData(): import("./render-frame").RenderingData;
|
|
23
23
|
setGlobalFloat(name: string, value: number): void;
|
|
24
|
-
setGlobalInt(name: string, value: number): void;
|
|
25
24
|
setGlobalVector4(name: string, value: Vector4): void;
|
|
26
|
-
|
|
25
|
+
setGlobalInt(name: string, value: number): void;
|
|
27
26
|
setGlobalMatrix(name: string, value: Matrix4): void;
|
|
27
|
+
setGlobalVector3(name: string, value: Vector3): void;
|
|
28
28
|
getFramebuffer(): Framebuffer;
|
|
29
29
|
setFramebuffer(framebuffer: Framebuffer | null): void;
|
|
30
30
|
setViewport(x: number, y: number, width: number, height: number): void;
|
|
31
|
-
resize(canvasWidth: number, canvasHeight: number): void;
|
|
32
31
|
clear(action: RenderPassClearAction): void;
|
|
33
32
|
getWidth(): number;
|
|
34
33
|
getHeight(): number;
|
|
35
|
-
/**
|
|
36
|
-
* @override
|
|
37
|
-
* @param e
|
|
38
|
-
*/
|
|
39
|
-
lost(e: Event): void;
|
|
40
|
-
/**
|
|
41
|
-
* @override
|
|
42
|
-
*/
|
|
43
|
-
restore(): void;
|
|
44
34
|
/**
|
|
45
35
|
*
|
|
46
36
|
* @override
|
|
47
37
|
* @returns
|
|
48
38
|
*/
|
|
49
|
-
getShaderLibrary(): ShaderLibrary |
|
|
39
|
+
getShaderLibrary(): ShaderLibrary | null;
|
|
50
40
|
renderRenderFrame(renderFrame: RenderFrame): void;
|
|
41
|
+
renderRenderPass(pass: RenderPass): void;
|
|
51
42
|
renderMeshes(meshes: RendererComponent[]): void;
|
|
52
43
|
drawGeometry(geometry: Geometry, matrix: Matrix4, material: Material, subMeshIndex?: number): void;
|
|
53
44
|
getTemporaryRT(name: string, width: number, height: number, depthBuffer: number, filter: FilterMode, format: RenderTextureFormat): Framebuffer;
|
|
@@ -60,4 +51,5 @@ export declare class Renderer implements LostHandler, RestoreHandler {
|
|
|
60
51
|
*/
|
|
61
52
|
blit(source: Texture, destination: Framebuffer | null, material?: Material): void;
|
|
62
53
|
dispose(): void;
|
|
54
|
+
private checkGlobalUniform;
|
|
63
55
|
}
|
package/dist/render/shader.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as spec from '@galacean/effects-specification';
|
|
2
|
+
import type { Color, Matrix3, Matrix4, Quaternion, Vector2, Vector3, Vector4 } from '@galacean/effects-math/es/core/index';
|
|
2
3
|
import { EffectsObject } from '../effects-object';
|
|
3
4
|
import type { Engine } from '../engine';
|
|
5
|
+
import type { Texture } from '../texture';
|
|
4
6
|
export type ShaderMacros = [key: string, value: string | number | boolean][];
|
|
5
7
|
export declare enum ShaderCompileResultStatus {
|
|
6
8
|
noShader = 0,
|
|
@@ -57,6 +59,23 @@ export declare abstract class ShaderVariant extends EffectsObject {
|
|
|
57
59
|
readonly source: ShaderWithSource;
|
|
58
60
|
shader: Shader;
|
|
59
61
|
constructor(engine: Engine, source: ShaderWithSource);
|
|
62
|
+
initialize(): void;
|
|
63
|
+
abstract setFloat(name: string, value: number): void;
|
|
64
|
+
abstract setInt(name: string, value: number): void;
|
|
65
|
+
abstract setFloats(name: string, value: number[]): void;
|
|
66
|
+
abstract setTexture(name: string, texture: Texture): void;
|
|
67
|
+
abstract setVector2(name: string, value: Vector2): void;
|
|
68
|
+
abstract setVector3(name: string, value: Vector3): void;
|
|
69
|
+
abstract setVector4(name: string, value: Vector4): void;
|
|
70
|
+
abstract setColor(name: string, value: Color): void;
|
|
71
|
+
abstract setQuaternion(name: string, value: Quaternion): void;
|
|
72
|
+
abstract setMatrix(name: string, value: Matrix4): void;
|
|
73
|
+
abstract setMatrix3(name: string, value: Matrix3): void;
|
|
74
|
+
abstract setVector4Array(name: string, array: number[]): void;
|
|
75
|
+
abstract setMatrixArray(name: string, array: number[]): void;
|
|
76
|
+
abstract fillShaderInformation(uniformNames: string[], samplers: string[]): void;
|
|
77
|
+
abstract bind(): void;
|
|
78
|
+
abstract isReady(): boolean;
|
|
60
79
|
}
|
|
61
80
|
export declare class Shader extends EffectsObject {
|
|
62
81
|
shaderData: spec.ShaderData;
|
package/dist/scene-loader.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ import type { Engine } from './engine';
|
|
|
3
3
|
import type { Scene, SceneLoadOptions } from './scene';
|
|
4
4
|
/**
|
|
5
5
|
* @hidden
|
|
6
|
+
* Internal utility.
|
|
7
|
+
* Not part of the public API — do not rely on this in your code.
|
|
6
8
|
*/
|
|
7
9
|
export declare class SceneLoader {
|
|
8
10
|
static load(scene: Scene.LoadType, engine: Engine, options?: SceneLoadOptions): Promise<Composition>;
|
package/dist/scene.d.ts
CHANGED
|
@@ -88,4 +88,4 @@ export declare abstract class Texture extends EffectsObject {
|
|
|
88
88
|
}
|
|
89
89
|
export declare function generateHalfFloatTexture(engine: Engine, data: Uint16Array, width: number, height: number): Texture;
|
|
90
90
|
export declare function generateWhiteTexture(engine: Engine): Texture;
|
|
91
|
-
export declare function
|
|
91
|
+
export declare function generateEmptyTexture(engine: Engine): Texture;
|
package/dist/vfx-item.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import type { Ray } from '@galacean/effects-math/es/core/ray';
|
|
1
2
|
import { Vector3 } from '@galacean/effects-math/es/core/vector3';
|
|
2
3
|
import * as spec from '@galacean/effects-specification';
|
|
3
4
|
import type { Component } from './components';
|
|
4
|
-
import type { Composition } from './composition';
|
|
5
|
+
import type { Composition, CompositionHitTestOptions } from './composition';
|
|
5
6
|
import { EffectsObject } from './effects-object';
|
|
6
7
|
import type { Engine } from './engine';
|
|
7
8
|
import type { EventEmitterListener, EventEmitterOptions, ItemEvent } from './events';
|
|
8
|
-
import type { BoundingBoxData, HitTestBoxParams, HitTestCustomParams, HitTestSphereParams, HitTestTriangleParams } from './plugins';
|
|
9
|
+
import type { BoundingBoxData, HitTestBoxParams, HitTestCustomParams, HitTestSphereParams, HitTestTriangleParams, Region } from './plugins';
|
|
9
10
|
import { Transform } from './transform';
|
|
10
11
|
import type { Constructor, Disposable } from './utils';
|
|
11
12
|
/**
|
|
@@ -54,7 +55,7 @@ export declare class VFXItem extends EffectsObject implements Disposable {
|
|
|
54
55
|
*/
|
|
55
56
|
type: spec.ItemType;
|
|
56
57
|
/**
|
|
57
|
-
* @deprecated 2.9.0 Please use `
|
|
58
|
+
* @deprecated 2.9.0 Please use `definition` instead
|
|
58
59
|
*/
|
|
59
60
|
props: spec.VFXItemData;
|
|
60
61
|
/**
|
|
@@ -275,6 +276,19 @@ export declare class VFXItem extends EffectsObject implements Disposable {
|
|
|
275
276
|
* @param force - 元素没有开启交互也返回参数
|
|
276
277
|
*/
|
|
277
278
|
getHitTestParams(force?: boolean): void | HitTestBoxParams | HitTestTriangleParams | HitTestSphereParams | HitTestCustomParams;
|
|
279
|
+
/**
|
|
280
|
+
* 对当前元素及其子节点进行射线命中测试
|
|
281
|
+
*
|
|
282
|
+
* @param ray - 射线
|
|
283
|
+
* @param x - 归一化屏幕坐标 x
|
|
284
|
+
* @param y - 归一化屏幕坐标 y
|
|
285
|
+
* @param regions - 命中结果收集数组
|
|
286
|
+
* @param hitPositions - 共享的命中位置数组,所有 region 共享同一引用
|
|
287
|
+
* @param force - 是否强制测试无交互信息的元素
|
|
288
|
+
* @param options - 额外选项(maxCount、stop、skip)
|
|
289
|
+
* @returns 是否有任何命中
|
|
290
|
+
*/
|
|
291
|
+
hitTest(ray: Ray, x: number, y: number, regions: Region[], hitPositions: Vector3[], force?: boolean, options?: CompositionHitTestOptions): boolean;
|
|
278
292
|
/**
|
|
279
293
|
* 获取元素当前世界坐标
|
|
280
294
|
*/
|
|
@@ -286,6 +300,7 @@ export declare class VFXItem extends EffectsObject implements Disposable {
|
|
|
286
300
|
* @returns 复制的新 VFXItem
|
|
287
301
|
*/
|
|
288
302
|
duplicate(): VFXItem;
|
|
303
|
+
private onParentChanged;
|
|
289
304
|
fromData(data: spec.VFXItemData): void;
|
|
290
305
|
toData(): void;
|
|
291
306
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/effects-core",
|
|
3
|
-
"version": "2.9.0
|
|
3
|
+
"version": "2.9.0",
|
|
4
4
|
"description": "Galacean Effects runtime core for the web",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"registry": "https://registry.npmjs.org"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@galacean/effects-specification": "2.8.
|
|
45
|
+
"@galacean/effects-specification": "^2.8.1",
|
|
46
46
|
"@galacean/effects-math": "1.1.0",
|
|
47
47
|
"flatbuffers": "24.3.25",
|
|
48
48
|
"uuid": "9.0.1",
|