@galacean/effects-plugin-editor-gizmo 1.2.3 → 2.0.0-alpha.1

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.
@@ -0,0 +1,52 @@
1
+ import type { GeometryDrawMode, Mesh, Texture, VFXItem, spec } from '@galacean/effects';
2
+ import { ItemBehaviour, math } from '@galacean/effects';
3
+ import { GizmoSubType } from './define';
4
+ import { type EditorGizmoPlugin } from './gizmo-loader';
5
+ export declare class GizmoComponent extends ItemBehaviour {
6
+ gizmoPlugin: EditorGizmoPlugin;
7
+ targetItem: VFXItem<any>;
8
+ needCreateModelContent: boolean;
9
+ color: spec.vec3;
10
+ renderMode: GeometryDrawMode;
11
+ depthTest?: boolean;
12
+ mat: math.Matrix4;
13
+ wireframeMeshes: Mesh[];
14
+ start(): void;
15
+ update(dt: number): void;
16
+ lateUpdate(dt: number): void;
17
+ updateRenderData(): void;
18
+ /**
19
+ * 获取默认绘制模式
20
+ * @returns 绘制模式常量
21
+ */
22
+ getDefaultRenderMode(): GeometryDrawMode;
23
+ /**
24
+ * 获取默认尺寸
25
+ * @returns 几何体尺寸
26
+ */
27
+ getDefaultSize(): {};
28
+ createModelContent(item: VFXItem<any>, meshesToAdd: Mesh[]): void;
29
+ createParticleContent(item: VFXItem<any>, meshesToAdd: Mesh[]): void;
30
+ /**
31
+ * 创建 BoundingBox 几何体模型
32
+ * @param item - VFXItem
33
+ * @param meshesToAdd - 插件缓存的 Mesh 数组
34
+ */
35
+ createBoundingBoxContent(item: VFXItem<any>, meshesToAdd: Mesh[]): void;
36
+ /**
37
+ * 创建基础几何体模型
38
+ * @param item - VFXItem
39
+ * @param meshesToAdd - 插件缓存的 Mesh 数组
40
+ * @param subType - GizmoSubType 类型
41
+ */
42
+ createBasicContent(item: VFXItem<Mesh | undefined>, meshesToAdd: Mesh[], subType: GizmoSubType, iconTextures?: Map<string, Texture>): void;
43
+ /**
44
+ * 创建组合几何体模型
45
+ * @param item - VFXItem
46
+ * @param meshesToAdd - 插件缓存的 Mesh 数组
47
+ * @param subType - GizmoSubType 类型
48
+ * @param iconTextures - XYZ 图标纹理(viewHelper 专用)
49
+ */
50
+ createCombinationContent(item: VFXItem<Mesh | undefined>, meshesToAdd: Mesh[], subType: GizmoSubType, iconTextures?: Map<string, Texture>): void;
51
+ fromData(data: any): void;
52
+ }
@@ -1,6 +1,7 @@
1
- import type { Composition, Mesh, RenderFrame, Scene, VFXItem } from '@galacean/effects';
1
+ import type { Composition, Mesh, RenderFrame, Scene, Texture, VFXItem } from '@galacean/effects';
2
2
  import { AbstractPlugin, RenderPass } from '@galacean/effects';
3
3
  import { GizmoVFXItem } from './gizmo-vfx-item';
4
+ export declare const iconTextures: Map<string, Texture>;
4
5
  export declare class EditorGizmoPlugin extends AbstractPlugin {
5
6
  meshToAdd: Mesh[];
6
7
  meshToRemove: Mesh[];
@@ -9,7 +10,6 @@ export declare class EditorGizmoPlugin extends AbstractPlugin {
9
10
  static onPlayerDestroy(): void;
10
11
  onCompositionConstructed(composition: Composition, scene: Scene): void;
11
12
  onCompositionReset(composition: Composition): void;
12
- onCompositionItemLifeBegin(composition: Composition, item: VFXItem<any>): void;
13
13
  onCompositionItemRemoved(composition: Composition, item: VFXItem<any>): void;
14
14
  removeGizmoItem(composition: Composition, gizmoVFXItem: GizmoVFXItem): void;
15
15
  prepareRenderFrame(composition: Composition, renderFrame: RenderFrame): boolean;
@@ -1,7 +1,6 @@
1
- import type { GeometryDrawMode, HitTestCustomParams, Mesh, SpriteMesh, Texture } from '@galacean/effects';
2
- import { spec, Transform, VFXItem, math } from '@galacean/effects';
1
+ import type { Engine, HitTestCustomParams, Mesh, VFXItemProps } from '@galacean/effects';
2
+ import { Transform, VFXItem, math } from '@galacean/effects';
3
3
  import { GizmoSubType } from './define';
4
- type vec3 = spec.vec3;
5
4
  type TriangleLike = math.TriangleLike;
6
5
  type Vector3 = math.Vector3;
7
6
  declare const Vector3: typeof math.Vector3;
@@ -51,12 +50,8 @@ export type GizmoItemBounding = GizmoItemBoundingBox | GizmoItemBoundingSphere |
51
50
  *
52
51
  */
53
52
  export declare class GizmoVFXItem extends VFXItem<Mesh | undefined> {
54
- duration: number;
55
53
  target: number;
56
54
  subType: GizmoSubType;
57
- color: vec3;
58
- renderMode: GeometryDrawMode;
59
- depthTest?: boolean;
60
55
  size: any;
61
56
  contents?: Map<Mesh, Transform>;
62
57
  targetItem?: VFXItem<any>;
@@ -65,56 +60,10 @@ export declare class GizmoVFXItem extends VFXItem<Mesh | undefined> {
65
60
  key: string;
66
61
  position: Vector3;
67
62
  };
68
- mat: math.Matrix4;
69
63
  wireframeMesh?: Mesh;
70
- wireframeMeshes: Mesh[];
71
- spriteMesh?: SpriteMesh;
72
- private engine;
73
- get type(): spec.ItemType;
74
- set type(t: spec.ItemType);
64
+ constructor(engine: Engine, props?: VFXItemProps);
75
65
  set content(content: Mesh | undefined);
76
66
  get content(): Mesh | undefined;
77
- onConstructed(options: {
78
- content: {
79
- options: any;
80
- transform?: any;
81
- };
82
- }): void;
83
- /**
84
- * 获取默认绘制模式
85
- * @returns 绘制模式常量
86
- */
87
- getDefaultRenderMode(): GeometryDrawMode;
88
- /**
89
- * 获取默认尺寸
90
- * @returns 几何体尺寸
91
- */
92
- getDefaultSize(): {};
93
- createModelContent(item: VFXItem<any>, meshesToAdd: Mesh[]): void;
94
- createParticleContent(item: VFXItem<any>, meshesToAdd: Mesh[]): void;
95
- /**
96
- * 创建 BoundingBox 几何体模型
97
- * @param item - VFXItem
98
- * @param meshesToAdd - 插件缓存的 Mesh 数组
99
- */
100
- createBoundingBoxContent(item: VFXItem<any>, meshesToAdd: Mesh[]): void;
101
- /**
102
- * 创建基础几何体模型
103
- * @param item - VFXItem
104
- * @param meshesToAdd - 插件缓存的 Mesh 数组
105
- * @param subType - GizmoSubType 类型
106
- */
107
- createBasicContent(item: VFXItem<Mesh | undefined>, meshesToAdd: Mesh[], subType: GizmoSubType, iconTextures?: Map<string, Texture>): void;
108
- /**
109
- * 创建组合几何体模型
110
- * @param item - VFXItem
111
- * @param meshesToAdd - 插件缓存的 Mesh 数组
112
- * @param subType - GizmoSubType 类型
113
- * @param iconTextures - XYZ 图标纹理(viewHelper 专用)
114
- */
115
- createCombinationContent(item: VFXItem<Mesh | undefined>, meshesToAdd: Mesh[], subType: GizmoSubType, iconTextures?: Map<string, Texture>): void;
116
- onItemUpdate(): void;
117
- updateRenderData(): void;
118
67
  /**
119
68
  * 射线检测算法
120
69
  * @returns 包含射线检测算法回调方法的参数