@galacean/effects-plugin-editor-gizmo 2.0.0-alpha.9 → 2.0.0-beta.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.
@@ -1,11 +1,26 @@
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;
@@ -13,7 +28,7 @@ export declare class GizmoComponent extends ItemBehaviour {
13
28
  wireframeMeshes: Mesh[];
14
29
  start(): void;
15
30
  update(dt: number): void;
16
- lateUpdate(dt: number): void;
31
+ render(renderer: Renderer): void;
17
32
  updateRenderData(): void;
18
33
  /**
19
34
  * 获取默认绘制模式
@@ -25,21 +40,21 @@ export declare class GizmoComponent extends ItemBehaviour {
25
40
  * @returns 几何体尺寸
26
41
  */
27
42
  getDefaultSize(): {};
28
- createModelContent(item: VFXItem<any>, meshesToAdd: Mesh[]): void;
29
- createParticleContent(item: VFXItem<any>, meshesToAdd: Mesh[]): void;
43
+ createModelContent(item: VFXItem, meshesToAdd: Mesh[]): void;
44
+ createParticleContent(item: VFXItem, meshesToAdd: Mesh[]): void;
30
45
  /**
31
46
  * 创建 BoundingBox 几何体模型
32
47
  * @param item - VFXItem
33
48
  * @param meshesToAdd - 插件缓存的 Mesh 数组
34
49
  */
35
- createBoundingBoxContent(item: VFXItem<any>, meshesToAdd: Mesh[]): void;
50
+ createBoundingBoxContent(item: VFXItem, meshesToAdd: Mesh[]): void;
36
51
  /**
37
52
  * 创建基础几何体模型
38
53
  * @param item - VFXItem
39
54
  * @param meshesToAdd - 插件缓存的 Mesh 数组
40
55
  * @param subType - GizmoSubType 类型
41
56
  */
42
- createBasicContent(item: VFXItem<Mesh | undefined>, meshesToAdd: Mesh[], subType: GizmoSubType, iconTextures?: Map<string, Texture>): void;
57
+ createBasicContent(item: VFXItem, meshesToAdd: Mesh[], subType: GizmoSubType, iconTextures?: Map<string, Texture>): void;
43
58
  /**
44
59
  * 创建组合几何体模型
45
60
  * @param item - VFXItem
@@ -47,6 +62,16 @@ export declare class GizmoComponent extends ItemBehaviour {
47
62
  * @param subType - GizmoSubType 类型
48
63
  * @param iconTextures - XYZ 图标纹理(viewHelper 专用)
49
64
  */
50
- createCombinationContent(item: VFXItem<Mesh | undefined>, meshesToAdd: Mesh[], subType: GizmoSubType, iconTextures?: Map<string, Texture>): void;
65
+ createCombinationContent(item: VFXItem, meshesToAdd: Mesh[], subType: GizmoSubType, iconTextures?: Map<string, Texture>): void;
51
66
  fromData(data: any): void;
67
+ /**
68
+ * 射线检测算法
69
+ * @returns 包含射线检测算法回调方法的参数
70
+ */
71
+ private getHitTestParams;
72
+ }
73
+ export declare enum CoordinateSpace {
74
+ Local = 0,
75
+ World = 1
52
76
  }
77
+ 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;