@galacean/effects-plugin-editor-gizmo 2.0.0-alpha.3 → 2.0.0-alpha.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.
@@ -1,19 +1,33 @@
1
- import type { GeometryDrawMode, Mesh, Texture, VFXItem, spec } from '@galacean/effects';
2
- import { ItemBehaviour, math } from '@galacean/effects';
1
+ import type { GeometryDrawMode, Renderer, Texture, VFXItem } from '@galacean/effects';
2
+ import { Mesh } from '@galacean/effects';
3
+ import { RendererComponent, Transform, math, spec } from '@galacean/effects';
3
4
  import { GizmoSubType } from './define';
4
5
  import { type EditorGizmoPlugin } from './gizmo-loader';
5
- export declare class GizmoComponent extends ItemBehaviour {
6
+ import type { GizmoItemBounding } from './gizmo-vfx-item';
7
+ type Vector3 = math.Vector3;
8
+ declare const Vector3: typeof math.Vector3;
9
+ export declare class GizmoComponent extends RendererComponent {
6
10
  gizmoPlugin: EditorGizmoPlugin;
7
- targetItem: VFXItem<any>;
11
+ targetItem: VFXItem;
8
12
  needCreateModelContent: boolean;
13
+ target: string;
14
+ subType: GizmoSubType;
15
+ size: any;
16
+ contents?: Map<Mesh, Transform>;
17
+ boundingMap: Map<string, GizmoItemBounding>;
18
+ hitBounding?: {
19
+ key: string;
20
+ position: Vector3;
21
+ };
22
+ wireframeMesh: Mesh;
23
+ coordinateSpace: CoordinateSpace;
9
24
  color: spec.vec3;
10
25
  renderMode: GeometryDrawMode;
11
26
  depthTest?: boolean;
12
27
  mat: math.Matrix4;
13
28
  wireframeMeshes: Mesh[];
14
29
  start(): void;
15
- update(dt: number): void;
16
- lateUpdate(dt: number): void;
30
+ render(renderer: Renderer): void;
17
31
  updateRenderData(): void;
18
32
  /**
19
33
  * 获取默认绘制模式
@@ -25,21 +39,21 @@ export declare class GizmoComponent extends ItemBehaviour {
25
39
  * @returns 几何体尺寸
26
40
  */
27
41
  getDefaultSize(): {};
28
- createModelContent(item: VFXItem<any>, meshesToAdd: Mesh[]): void;
29
- createParticleContent(item: VFXItem<any>, meshesToAdd: Mesh[]): void;
42
+ createModelContent(item: VFXItem, meshesToAdd: Mesh[]): void;
43
+ createParticleContent(item: VFXItem, meshesToAdd: Mesh[]): void;
30
44
  /**
31
45
  * 创建 BoundingBox 几何体模型
32
46
  * @param item - VFXItem
33
47
  * @param meshesToAdd - 插件缓存的 Mesh 数组
34
48
  */
35
- createBoundingBoxContent(item: VFXItem<any>, meshesToAdd: Mesh[]): void;
49
+ createBoundingBoxContent(item: VFXItem, meshesToAdd: Mesh[]): void;
36
50
  /**
37
51
  * 创建基础几何体模型
38
52
  * @param item - VFXItem
39
53
  * @param meshesToAdd - 插件缓存的 Mesh 数组
40
54
  * @param subType - GizmoSubType 类型
41
55
  */
42
- createBasicContent(item: VFXItem<Mesh | undefined>, meshesToAdd: Mesh[], subType: GizmoSubType, iconTextures?: Map<string, Texture>): void;
56
+ createBasicContent(item: VFXItem, meshesToAdd: Mesh[], subType: GizmoSubType, iconTextures?: Map<string, Texture>): void;
43
57
  /**
44
58
  * 创建组合几何体模型
45
59
  * @param item - VFXItem
@@ -47,6 +61,16 @@ export declare class GizmoComponent extends ItemBehaviour {
47
61
  * @param subType - GizmoSubType 类型
48
62
  * @param iconTextures - XYZ 图标纹理(viewHelper 专用)
49
63
  */
50
- createCombinationContent(item: VFXItem<Mesh | undefined>, meshesToAdd: Mesh[], subType: GizmoSubType, iconTextures?: Map<string, Texture>): void;
64
+ createCombinationContent(item: VFXItem, meshesToAdd: Mesh[], subType: GizmoSubType, iconTextures?: Map<string, Texture>): void;
51
65
  fromData(data: any): void;
66
+ /**
67
+ * 射线检测算法
68
+ * @returns 包含射线检测算法回调方法的参数
69
+ */
70
+ private getHitTestParams;
71
+ }
72
+ export declare enum CoordinateSpace {
73
+ Local = 0,
74
+ World = 1
52
75
  }
76
+ export {};
@@ -1,6 +1,5 @@
1
1
  import type { Composition, Mesh, RenderFrame, Scene, Texture, VFXItem } from '@galacean/effects';
2
2
  import { AbstractPlugin, RenderPass } from '@galacean/effects';
3
- import { GizmoVFXItem } from './gizmo-vfx-item';
4
3
  export declare const iconTextures: Map<string, Texture>;
5
4
  export declare class EditorGizmoPlugin extends AbstractPlugin {
6
5
  meshToAdd: Mesh[];
@@ -10,8 +9,8 @@ export declare class EditorGizmoPlugin extends AbstractPlugin {
10
9
  static onPlayerDestroy(): void;
11
10
  onCompositionConstructed(composition: Composition, scene: Scene): void;
12
11
  onCompositionReset(composition: Composition): void;
13
- onCompositionItemRemoved(composition: Composition, item: VFXItem<any>): void;
14
- removeGizmoItem(composition: Composition, gizmoVFXItem: GizmoVFXItem): void;
12
+ onCompositionItemRemoved(composition: Composition, item: VFXItem): void;
13
+ removeGizmoItem(composition: Composition, gizmoVFXItem: VFXItem): void;
15
14
  prepareRenderFrame(composition: Composition, renderFrame: RenderFrame): boolean;
16
15
  getBehindRenderPass(pipeline: RenderFrame): RenderPass;
17
16
  getEditorRenderPass(pipeline: RenderFrame): RenderPass;
@@ -1,7 +1,6 @@
1
- import type { Engine, HitTestCustomParams, Mesh, VFXItemProps } from '@galacean/effects';
2
- import { Transform, VFXItem, math } from '@galacean/effects';
3
- import { GizmoSubType } from './define';
4
- type TriangleLike = math.TriangleLike;
1
+ import { math } from '@galacean/effects';
2
+ export type Ray = math.Ray;
3
+ export type TriangleLike = math.TriangleLike;
5
4
  type Vector3 = math.Vector3;
6
5
  declare const Vector3: typeof math.Vector3;
7
6
  /**
@@ -46,28 +45,4 @@ export interface GizmoItemBoundingTriangle {
46
45
  backfaceCulling?: boolean;
47
46
  }
48
47
  export type GizmoItemBounding = GizmoItemBoundingBox | GizmoItemBoundingSphere | GizmoItemBoundingTriangle | GizmoItemBoundingLine;
49
- /**
50
- *
51
- */
52
- export declare class GizmoVFXItem extends VFXItem<Mesh | undefined> {
53
- target: string;
54
- subType: GizmoSubType;
55
- size: any;
56
- contents?: Map<Mesh, Transform>;
57
- targetItem?: VFXItem<any>;
58
- boundingMap: Map<string, GizmoItemBounding>;
59
- hitBounding?: {
60
- key: string;
61
- position: Vector3;
62
- };
63
- wireframeMesh?: Mesh;
64
- constructor(engine: Engine, props?: VFXItemProps);
65
- set content(content: Mesh | undefined);
66
- get content(): Mesh | undefined;
67
- /**
68
- * 射线检测算法
69
- * @returns 包含射线检测算法回调方法的参数
70
- */
71
- getHitTestParams(): void | HitTestCustomParams;
72
- }
73
48
  export {};
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { GizmoVFXItem } from './gizmo-vfx-item';
2
1
  import { GizmoSubType } from './define';
3
2
  import { GeometryType, createGeometry } from './geometry';
4
3
  export { DirectionLightData } from './geometry/direction-light';
5
- export { GizmoSubType, GeometryType, createGeometry, GizmoVFXItem, };
4
+ export { GizmoSubType, GeometryType, createGeometry, };
5
+ export * from './gizmo-component';
6
6
  export declare const version: string;