@galacean/effects-plugin-editor-gizmo 2.10.0-alpha.0 → 2.10.0-alpha.2

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.mjs CHANGED
@@ -3,11 +3,11 @@
3
3
  * Description: Galacean Effects player editor gizmo plugin
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 茂安,旻诺
6
- * Version: v2.10.0-alpha.0
6
+ * Version: v2.10.0-alpha.2
7
7
  */
8
8
 
9
9
  import * as EFFECTS from '@galacean/effects';
10
- import { glContext, Texture, noop, math, Geometry, Transform, Mesh, Material, DestroyOptions, GLSLVersion, GLGeometry, serialize, effectsClass, HitTestType, spec, PluginSystem, RendererComponent, ParticleSystemRenderer, assertExist, RenderPassPriorityPostprocess, TextureLoadAction, RenderPass, RenderPassPriorityPrepare, Plugin, registerPlugin, logger } from '@galacean/effects';
10
+ import { glContext, Texture, noop, math, Geometry, Transform, Mesh, Material, DestroyOptions, GLSLVersion, serialize, effectsClass, HitTestType, spec, PluginSystem, RendererComponent, ParticleSystemRenderer, assertExist, ParticleSystem, RenderPassPriorityPostprocess, TextureLoadAction, RenderPass, RenderPassPriorityPrepare, Plugin, registerPlugin, logger } from '@galacean/effects';
11
11
 
12
12
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
13
13
  try {
@@ -2771,63 +2771,36 @@ function getTriangleIndexData(oid) {
2771
2771
  }
2772
2772
  return indexData;
2773
2773
  }
2774
- var SharedGeometry = /*#__PURE__*/ function(GLGeometry) {
2775
- _inherits(SharedGeometry, GLGeometry);
2774
+ var SharedGeometry = /*#__PURE__*/ function(Geometry) {
2775
+ _inherits(SharedGeometry, Geometry);
2776
2776
  function SharedGeometry(engine, options) {
2777
2777
  var _this;
2778
- _this = GLGeometry.call(this, engine, _extends({
2779
- attributes: {}
2780
- }, options)) || this;
2781
- var indexData = options.index ? options.index.data : options.geometry.getIndexData();
2782
- if (indexData) {
2783
- //@ts-expect-error safe to assign
2784
- indexData = new indexData.constructor(indexData);
2785
- }
2786
- _this.indices = indexData;
2787
- _this.source = options.geometry;
2788
- _this.drawCount = options.drawCount || 0;
2789
- _this.drawStart = options.drawStart || 0;
2790
- _this.mode = options.mode || 0;
2791
- for(var name in _this.source.attributes){
2792
- _this.attributes[name] = _extends({}, _this.source.attributes[name]);
2793
- }
2778
+ var _options_index;
2779
+ var source = options.geometry;
2780
+ var _options_index_data;
2781
+ var sourceIndex = (_options_index_data = (_options_index = options.index) == null ? void 0 : _options_index.data) != null ? _options_index_data : source.getIndexData();
2782
+ var indexData = sourceIndex == null ? void 0 : sourceIndex.slice();
2783
+ var _options_drawStart, _options_drawCount, _options_mode;
2784
+ _this = Geometry.call(this, engine, {
2785
+ name: options.name,
2786
+ attributes: {},
2787
+ indices: indexData ? {
2788
+ data: indexData
2789
+ } : undefined,
2790
+ drawStart: (_options_drawStart = options.drawStart) != null ? _options_drawStart : 0,
2791
+ drawCount: (_options_drawCount = options.drawCount) != null ? _options_drawCount : 0,
2792
+ mode: (_options_mode = options.mode) != null ? _options_mode : 0
2793
+ }) || this;
2794
+ source.getAttributeNames().forEach(function(name) {
2795
+ var vertexBuffer = source.getVertexBuffer(name);
2796
+ if (vertexBuffer) {
2797
+ _this.setVerticesBuffer(vertexBuffer);
2798
+ }
2799
+ });
2794
2800
  return _this;
2795
2801
  }
2796
- var _proto = SharedGeometry.prototype;
2797
- _proto.initialize = function initialize() {
2798
- if (!this.isInitialized) {
2799
- var geometry = this.source;
2800
- geometry.initialize();
2801
- //this.indicesBuffer = this._source.indicesBuffer;
2802
- this.buffers = this.source.buffers;
2803
- this.bufferProps = this.source.bufferProps;
2804
- //this.dirtyFlags = this._source.dirtyFlags;
2805
- //this.vaos = this._source.vaos;
2806
- //创建ibo
2807
- if (this.indices) {
2808
- this.indicesBuffer = this.createIndicesBuffer(this.indices);
2809
- }
2810
- this.flush();
2811
- this.initialized = true;
2812
- }
2813
- };
2814
- _proto.getAttributeNames = function getAttributeNames() {
2815
- return this.source.getAttributeNames();
2816
- };
2817
- _proto.flush = function flush() {
2818
- this.source.flush();
2819
- GLGeometry.prototype.flush.call(this);
2820
- };
2821
- _proto.dispose = function dispose() {
2822
- // from source geometry
2823
- this.buffers = {};
2824
- this.bufferProps = {};
2825
- GLGeometry.prototype.dispose.call(this);
2826
- // @ts-expect-error
2827
- this.source = null;
2828
- };
2829
2802
  return SharedGeometry;
2830
- }(GLGeometry);
2803
+ }(Geometry);
2831
2804
 
2832
2805
  var editorRenderPassName = "editor-gizmo";
2833
2806
  var frontRenderPassName = "front-gizmo";
@@ -3427,7 +3400,7 @@ var GizmoComponent = /*#__PURE__*/ function(RendererComponent1) {
3427
3400
  };
3428
3401
  _proto.createParticleContent = function createParticleContent(item) {
3429
3402
  var _this_item_composition;
3430
- var shape = item.props.content.shape;
3403
+ var shape = item.getComponent(ParticleSystem).definition.shape;
3431
3404
  var engine = (_this_item_composition = this.item.composition) == null ? void 0 : _this_item_composition.renderer.engine;
3432
3405
  assertExist(engine);
3433
3406
  this.targetItem = item;
@@ -3701,7 +3674,7 @@ var EditorGizmoPlugin = /*#__PURE__*/ function(Plugin) {
3701
3674
  registerPlugin("editor-gizmo", EditorGizmoPlugin);
3702
3675
  /**
3703
3676
  * 插件版本号
3704
- */ var version = "2.10.0-alpha.0";
3677
+ */ var version = "2.10.0-alpha.2";
3705
3678
  logger.info("Plugin editor gizmo version: " + version + ".");
3706
3679
  if (version !== EFFECTS.version) {
3707
3680
  console.error("注意:请统一 Editor Gizmo 插件与 Player 版本,不统一的版本混用会有不可预知的后果!", "\nAttention: Please ensure the Editor Gizmo plugin is synchronized with the Player version. Mixing and matching incompatible versions may result in unpredictable consequences!");