@galacean/effects-plugin-model 2.0.2 → 2.1.0-alpha.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.
@@ -8,7 +8,6 @@ import { Vector3 } from '../runtime/math';
8
8
  /**
9
9
  * 插件 Mesh 组件类,支持 3D Mesh 渲染能力
10
10
  * @since 2.0.0
11
- * @internal
12
11
  */
13
12
  export declare class ModelMeshComponent extends RendererComponent {
14
13
  /**
@@ -40,17 +39,17 @@ export declare class ModelMeshComponent extends RendererComponent {
40
39
  /**
41
40
  * 组件开始,需要创建内部对象,更新父元素信息和添加到场景管理器中
42
41
  */
43
- start(): void;
42
+ onStart(): void;
44
43
  /**
45
44
  * 组件更新,更新内部对象状态
46
45
  * @param dt - 更新间隔
47
46
  */
48
- update(dt: number): void;
47
+ onUpdate(dt: number): void;
49
48
  /**
50
49
  * 组件晚更新,晚更新内部对象状态
51
50
  * @param dt - 更新间隔
52
51
  */
53
- lateUpdate(dt: number): void;
52
+ onLateUpdate(dt: number): void;
54
53
  /**
55
54
  * 组件渲染,需要检查可见性
56
55
  * @param renderer - 渲染器
@@ -94,7 +93,6 @@ export declare class ModelMeshComponent extends RendererComponent {
94
93
  /**
95
94
  * 插件天空盒组件类,支持 3D 天空盒渲染能力
96
95
  * @since 2.0.0
97
- * @internal
98
96
  */
99
97
  export declare class ModelSkyboxComponent extends RendererComponent {
100
98
  /**
@@ -118,7 +116,7 @@ export declare class ModelSkyboxComponent extends RendererComponent {
118
116
  /**
119
117
  * 组件开始,需要创建内部对象和添加到场景管理器中
120
118
  */
121
- start(): void;
119
+ onStart(): void;
122
120
  /**
123
121
  * 组件渲染,需要检查可见性
124
122
  * @param renderer - 渲染器
@@ -151,7 +149,6 @@ export declare class ModelSkyboxComponent extends RendererComponent {
151
149
  /**
152
150
  * 插件灯光组件类,支持 3D 灯光能力
153
151
  * @since 2.0.0
154
- * @internal
155
152
  */
156
153
  export declare class ModelLightComponent extends Behaviour {
157
154
  /**
@@ -171,12 +168,12 @@ export declare class ModelLightComponent extends Behaviour {
171
168
  /**
172
169
  * 组件开始,需要创建内部对象和添加到场景管理器中
173
170
  */
174
- start(): void;
171
+ onStart(): void;
175
172
  /**
176
173
  * 组件更新,更新内部对象状态
177
174
  * @param dt - 更新间隔
178
175
  */
179
- update(dt: number): void;
176
+ onUpdate(dt: number): void;
180
177
  /**
181
178
  * 组件销毁
182
179
  */
@@ -203,7 +200,6 @@ export declare class ModelLightComponent extends Behaviour {
203
200
  /**
204
201
  * 插件相机组件类,支持 3D 相机能力
205
202
  * @since 2.0.0
206
- * @internal
207
203
  */
208
204
  export declare class ModelCameraComponent extends Behaviour {
209
205
  /**
@@ -223,12 +219,12 @@ export declare class ModelCameraComponent extends Behaviour {
223
219
  /**
224
220
  * 组件开始,需要创建内部对象和添加到场景管理器中
225
221
  */
226
- start(): void;
222
+ onStart(): void;
227
223
  /**
228
224
  * 组件更新,更新内部对象状态
229
225
  * @param dt - 更新间隔
230
226
  */
231
- update(dt: number): void;
227
+ onUpdate(dt: number): void;
232
228
  /**
233
229
  * 组件销毁
234
230
  */
@@ -256,7 +252,6 @@ export declare class ModelCameraComponent extends Behaviour {
256
252
  /**
257
253
  * 插件动画组件类,支持 3D 动画能力
258
254
  * @since 2.0.0
259
- * @internal
260
255
  */
261
256
  export declare class AnimationComponent extends Behaviour {
262
257
  /**
@@ -274,12 +269,12 @@ export declare class AnimationComponent extends Behaviour {
274
269
  /**
275
270
  * 组件开始,需要创建内部对象和添加到场景管理器中
276
271
  */
277
- start(): void;
272
+ onStart(): void;
278
273
  /**
279
274
  * 组件更新,更新内部对象状态
280
275
  * @param dt - 更新间隔
281
276
  */
282
- update(dt: number): void;
277
+ onUpdate(dt: number): void;
283
278
  /**
284
279
  * 组件销毁
285
280
  */
@@ -1,5 +1,5 @@
1
- import type { Scene, SceneLoadOptions, Composition, RenderFrame, Engine, Component, Renderer } from '@galacean/effects';
2
- import { AbstractPlugin, spec, Behaviour } from '@galacean/effects';
1
+ import type { Scene, SceneLoadOptions, Composition, RenderFrame, Component, Renderer } from '@galacean/effects';
2
+ import { AbstractPlugin, spec } from '@galacean/effects';
3
3
  import { CompositionCache } from '../runtime/cache';
4
4
  import { PSceneManager } from '../runtime';
5
5
  /**
@@ -46,75 +46,6 @@ export declare class ModelPlugin extends AbstractPlugin {
46
46
  export interface ModelPluginOptions {
47
47
  cache: CompositionCache;
48
48
  }
49
- /**
50
- * 插件组件类,实现特定的插件功能
51
- * @since 2.0.0
52
- * @internal
53
- */
54
- export declare class ModelPluginComponent extends Behaviour {
55
- private runtimeEnv;
56
- private compatibleMode;
57
- private renderSkybox;
58
- private visBoundingBox;
59
- private autoAdjustScene;
60
- /**
61
- * 渲染插件是否启用动态排序功能
62
- * 支持在渲染的时候对透明 Mesh 进行动态排序
63
- */
64
- private enableDynamicSort;
65
- /**
66
- * 3D 渲染模式,支持可视化渲染中间结果
67
- * none 表示正常的渲染结果
68
- */
69
- private renderMode3D;
70
- /**
71
- * UV 渲染模式中,指定棋盘格的大小,相对于大小为 1 的纹理
72
- * 取值范围(0, 1)
73
- */
74
- private renderMode3DUVGridSize;
75
- /**
76
- * 合成缓存器
77
- */
78
- cache: CompositionCache;
79
- /**
80
- * 场景管理器
81
- */
82
- scene: PSceneManager;
83
- /**
84
- * 构造函数,创建场景管理器
85
- * @param engine - 引擎
86
- * @param options - Mesh 参数
87
- */
88
- constructor(engine: Engine, options?: ModelPluginOptions);
89
- /**
90
- * 组件后更新,合成相机和场景管理器更新
91
- * @param dt - 更新间隔
92
- */
93
- lateUpdate(dt: number): void;
94
- /**
95
- * 组件销毁,同时销毁场景管理器和缓存器
96
- */
97
- onDestroy(): void;
98
- /**
99
- * 反序列化,创建场景管理器
100
- * @param date - 组件参数
101
- */
102
- fromData(data: ModelPluginOptions): void;
103
- /**
104
- * 组件初始化,初始化场景管理器并更新合成相机
105
- * @param sceneParams - 场景参数
106
- */
107
- initial(sceneParams: Record<string, any>): void;
108
- /**
109
- * 更新 SceneManager 中渲染用的相机,相机参数来自 composition.camera
110
- *
111
- * @param composition - 当前合成对象
112
- * @param sceneManager - 当前合成对象绑定的 SceneManager
113
- */
114
- private updateSceneCamera;
115
- private getLightItemCount;
116
- private getMaxJointCount;
117
- }
118
49
  /**
119
50
  * 获取场景管理器,从合成中查找
120
51
  * @param component
@@ -85,7 +85,6 @@ export declare class ModelTreeItem {
85
85
  /**
86
86
  * 插件场景树组件类,实现 3D 场景树功能
87
87
  * @since 2.0.0
88
- * @internal
89
88
  */
90
89
  export declare class ModelTreeComponent extends Behaviour {
91
90
  /**
@@ -110,12 +109,12 @@ export declare class ModelTreeComponent extends Behaviour {
110
109
  /**
111
110
  * 组件开始,查询合成中场景管理器并设置到动画管理器中
112
111
  */
113
- start(): void;
112
+ onStart(): void;
114
113
  /**
115
114
  * 组件更新,内部对象更新
116
115
  * @param dt
117
116
  */
118
- update(dt: number): void;
117
+ onUpdate(dt: number): void;
119
118
  /**
120
119
  * 组件销毁,内部对象销毁
121
120
  */
package/dist/weapp.js CHANGED
@@ -4443,7 +4443,7 @@ exports.ModelMeshComponent = /*#__PURE__*/ function(RendererComponent) {
4443
4443
  var _proto = ModelMeshComponent.prototype;
4444
4444
  /**
4445
4445
  * 组件开始,需要创建内部对象,更新父元素信息和添加到场景管理器中
4446
- */ _proto.start = function start() {
4446
+ */ _proto.onStart = function onStart() {
4447
4447
  var _this_sceneManager;
4448
4448
  this.sceneManager = getSceneManager(this);
4449
4449
  this.createContent();
@@ -4459,7 +4459,7 @@ exports.ModelMeshComponent = /*#__PURE__*/ function(RendererComponent) {
4459
4459
  /**
4460
4460
  * 组件更新,更新内部对象状态
4461
4461
  * @param dt - 更新间隔
4462
- */ _proto.update = function update(dt) {
4462
+ */ _proto.onUpdate = function onUpdate(dt) {
4463
4463
  if (this.sceneManager) {
4464
4464
  this.content.build(this.sceneManager);
4465
4465
  }
@@ -4468,7 +4468,7 @@ exports.ModelMeshComponent = /*#__PURE__*/ function(RendererComponent) {
4468
4468
  /**
4469
4469
  * 组件晚更新,晚更新内部对象状态
4470
4470
  * @param dt - 更新间隔
4471
- */ _proto.lateUpdate = function lateUpdate(dt) {
4471
+ */ _proto.onLateUpdate = function onLateUpdate(dt) {
4472
4472
  this.content.lateUpdate();
4473
4473
  };
4474
4474
  /**
@@ -4566,7 +4566,7 @@ exports.ModelSkyboxComponent = /*#__PURE__*/ function(RendererComponent) {
4566
4566
  var _proto = ModelSkyboxComponent.prototype;
4567
4567
  /**
4568
4568
  * 组件开始,需要创建内部对象和添加到场景管理器中
4569
- */ _proto.start = function start() {
4569
+ */ _proto.onStart = function onStart() {
4570
4570
  var _this_sceneManager;
4571
4571
  this.createContent();
4572
4572
  this.item.type = VFX_ITEM_TYPE_3D;
@@ -4640,7 +4640,7 @@ exports.ModelLightComponent = /*#__PURE__*/ function(Behaviour) {
4640
4640
  var _proto = ModelLightComponent.prototype;
4641
4641
  /**
4642
4642
  * 组件开始,需要创建内部对象和添加到场景管理器中
4643
- */ _proto.start = function start() {
4643
+ */ _proto.onStart = function onStart() {
4644
4644
  this.createContent();
4645
4645
  this.item.type = VFX_ITEM_TYPE_3D;
4646
4646
  var scene = getSceneManager(this);
@@ -4650,7 +4650,7 @@ exports.ModelLightComponent = /*#__PURE__*/ function(Behaviour) {
4650
4650
  /**
4651
4651
  * 组件更新,更新内部对象状态
4652
4652
  * @param dt - 更新间隔
4653
- */ _proto.update = function update(dt) {
4653
+ */ _proto.onUpdate = function onUpdate(dt) {
4654
4654
  this.content.update();
4655
4655
  };
4656
4656
  /**
@@ -4705,7 +4705,7 @@ exports.ModelCameraComponent = /*#__PURE__*/ function(Behaviour) {
4705
4705
  var _proto = ModelCameraComponent.prototype;
4706
4706
  /**
4707
4707
  * 组件开始,需要创建内部对象和添加到场景管理器中
4708
- */ _proto.start = function start() {
4708
+ */ _proto.onStart = function onStart() {
4709
4709
  this.createContent();
4710
4710
  this.item.type = VFX_ITEM_TYPE_3D;
4711
4711
  var scene = getSceneManager(this);
@@ -4715,7 +4715,7 @@ exports.ModelCameraComponent = /*#__PURE__*/ function(Behaviour) {
4715
4715
  /**
4716
4716
  * 组件更新,更新内部对象状态
4717
4717
  * @param dt - 更新间隔
4718
- */ _proto.update = function update(dt) {
4718
+ */ _proto.onUpdate = function onUpdate(dt) {
4719
4719
  this.content.update();
4720
4720
  this.updateMainCamera();
4721
4721
  };
@@ -4786,14 +4786,14 @@ exports.AnimationComponent = /*#__PURE__*/ function(Behaviour) {
4786
4786
  var _proto = AnimationComponent.prototype;
4787
4787
  /**
4788
4788
  * 组件开始,需要创建内部对象和添加到场景管理器中
4789
- */ _proto.start = function start() {
4789
+ */ _proto.onStart = function onStart() {
4790
4790
  this.elapsedTime = 0;
4791
4791
  this.item.type = VFX_ITEM_TYPE_3D;
4792
4792
  };
4793
4793
  /**
4794
4794
  * 组件更新,更新内部对象状态
4795
4795
  * @param dt - 更新间隔
4796
- */ _proto.update = function update(dt) {
4796
+ */ _proto.onUpdate = function onUpdate(dt) {
4797
4797
  this.elapsedTime += dt * 0.001;
4798
4798
  if (this.animation >= 0 && this.animation < this.clips.length) {
4799
4799
  this.clips[this.animation].sampleAnimation(this.item, this.elapsedTime);
@@ -9771,7 +9771,7 @@ exports.ModelPluginComponent = /*#__PURE__*/ function(Behaviour) {
9771
9771
  /**
9772
9772
  * 组件后更新,合成相机和场景管理器更新
9773
9773
  * @param dt - 更新间隔
9774
- */ _proto.lateUpdate = function lateUpdate(dt) {
9774
+ */ _proto.onLateUpdate = function onLateUpdate(dt) {
9775
9775
  var composition = this.item.composition;
9776
9776
  if (this.autoAdjustScene && this.scene.tickCount == 1) {
9777
9777
  var _composition_items;
@@ -10061,7 +10061,7 @@ exports.ModelTreeComponent = /*#__PURE__*/ function(Behaviour) {
10061
10061
  };
10062
10062
  /**
10063
10063
  * 组件开始,查询合成中场景管理器并设置到动画管理器中
10064
- */ _proto.start = function start() {
10064
+ */ _proto.onStart = function onStart() {
10065
10065
  this.item.type = EFFECTS.spec.ItemType.tree;
10066
10066
  this.content.baseTransform.setValid(true);
10067
10067
  var sceneManager = getSceneManager(this);
@@ -10072,7 +10072,7 @@ exports.ModelTreeComponent = /*#__PURE__*/ function(Behaviour) {
10072
10072
  /**
10073
10073
  * 组件更新,内部对象更新
10074
10074
  * @param dt
10075
- */ _proto.update = function update(dt) {
10075
+ */ _proto.onUpdate = function onUpdate(dt) {
10076
10076
  var // this.timeline?.getRenderData(time, true);
10077
10077
  // TODO: 需要使用lifetime
10078
10078
  _this_content;
@@ -13794,7 +13794,7 @@ var GLTFHelper = /*#__PURE__*/ function() {
13794
13794
 
13795
13795
  EFFECTS.registerPlugin("tree", ModelTreePlugin, EFFECTS.VFXItem, true);
13796
13796
  EFFECTS.registerPlugin("model", ModelPlugin, EFFECTS.VFXItem);
13797
- var version = "2.0.2";
13797
+ var version = "2.1.0-alpha.0";
13798
13798
  EFFECTS.logger.info("Plugin model version: " + version + ".");
13799
13799
  if (version !== EFFECTS__namespace.version) {
13800
13800
  console.error("注意:请统一 Model 插件与 Player 版本,不统一的版本混用会有不可预知的后果!", "\nAttention: Please ensure the Model plugin is synchronized with the Player version. Mixing and matching incompatible versions may result in unpredictable consequences!");