@galacean/effects-plugin-model 2.0.1 → 2.0.3

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,7 +3,7 @@
3
3
  * Description: Galacean Effects player model plugin
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 飂兮
6
- * Version: v2.0.1
6
+ * Version: v2.0.3
7
7
  */
8
8
 
9
9
  import * as EFFECTS from '@galacean/effects';
@@ -13779,7 +13779,7 @@ var GLTFHelper = /*#__PURE__*/ function() {
13779
13779
 
13780
13780
  registerPlugin("tree", ModelTreePlugin, VFXItem, true);
13781
13781
  registerPlugin("model", ModelPlugin, VFXItem);
13782
- var version = "2.0.1";
13782
+ var version = "2.0.3";
13783
13783
  logger.info("Plugin model version: " + version + ".");
13784
13784
  if (version !== EFFECTS.version) {
13785
13785
  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!");
package/dist/loader.mjs CHANGED
@@ -3,7 +3,7 @@
3
3
  * Description: Galacean Effects player model plugin
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 飂兮
6
- * Version: v2.0.1
6
+ * Version: v2.0.3
7
7
  */
8
8
 
9
9
  import * as EFFECTS from '@galacean/effects';
@@ -4401,7 +4401,7 @@ var CameraGestureHandlerImp = /*#__PURE__*/ function() {
4401
4401
 
4402
4402
  registerPlugin("tree", ModelTreePlugin, VFXItem, true);
4403
4403
  registerPlugin("model", ModelPlugin, VFXItem);
4404
- var version = "2.0.1";
4404
+ var version = "2.0.3";
4405
4405
  logger.info("Plugin model version: " + version + ".");
4406
4406
  if (version !== EFFECTS.version) {
4407
4407
  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!");
@@ -1,299 +1 @@
1
- import type { Engine, HitTestBoxParams, HitTestCustomParams, HitTestSphereParams, Renderer, VFXItem } from '@galacean/effects';
2
- import { Behaviour, RendererComponent, AnimationClip } from '@galacean/effects';
3
- import type { ModelCameraComponentData, ModelItemBounding, ModelLightComponentData, ModelMeshComponentData, ModelSkyboxComponentData, AnimationComponentData } from '../index';
4
- import type { PSceneManager } from '../runtime';
5
- import { PCamera, PLight, PMesh, PSkybox } from '../runtime';
6
- import type { Euler } from '../runtime/math';
7
- import { Vector3 } from '../runtime/math';
8
- /**
9
- * 插件 Mesh 组件类,支持 3D Mesh 渲染能力
10
- * @since 2.0.0
11
- * @internal
12
- */
13
- export declare class ModelMeshComponent extends RendererComponent {
14
- /**
15
- * 内部 Mesh 对象
16
- */
17
- content: PMesh;
18
- /**
19
- * 参数
20
- */
21
- data?: ModelMeshComponentData;
22
- /**
23
- * 包围盒
24
- */
25
- bounding?: ModelItemBounding;
26
- /**
27
- * 场景管理器
28
- */
29
- sceneManager?: PSceneManager;
30
- /**
31
- * morph 动画权重
32
- */
33
- morphWeights: number[];
34
- /**
35
- * 构造函数,只保存传入参数,不在这里创建内部对象
36
- * @param engine - 引擎
37
- * @param data - Mesh 参数
38
- */
39
- constructor(engine: Engine, data?: ModelMeshComponentData);
40
- /**
41
- * 组件开始,需要创建内部对象,更新父元素信息和添加到场景管理器中
42
- */
43
- start(): void;
44
- /**
45
- * 组件更新,更新内部对象状态
46
- * @param dt - 更新间隔
47
- */
48
- update(dt: number): void;
49
- /**
50
- * 组件晚更新,晚更新内部对象状态
51
- * @param dt - 更新间隔
52
- */
53
- lateUpdate(dt: number): void;
54
- /**
55
- * 组件渲染,需要检查可见性
56
- * @param renderer - 渲染器
57
- * @returns
58
- */
59
- render(renderer: Renderer): void;
60
- /**
61
- * 组件销毁,需要重场景管理器中删除
62
- */
63
- onDestroy(): void;
64
- /**
65
- * 反序列化,记录传入参数
66
- * @param data - 组件参数
67
- */
68
- fromData(data: ModelMeshComponentData): void;
69
- /**
70
- * 创建内部对象
71
- */
72
- createContent(): void;
73
- /**
74
- * 设置当前 Mesh 的可见性。
75
- * @param visible - true:可见,false:不可见
76
- */
77
- setVisible(visible: boolean): void;
78
- /**
79
- * 获取当前 Mesh 的可见性。
80
- */
81
- getVisible(): boolean;
82
- /**
83
- * 获取点击测试参数,根据元素包围盒进行相交测试,Mesh 对象会进行更加精确的点击测试
84
- * @param force - 是否强制进行点击测试
85
- * @returns 点击测试参数
86
- */
87
- getHitTestParams: (force?: boolean) => HitTestBoxParams | HitTestSphereParams | HitTestCustomParams | undefined;
88
- /**
89
- * 计算元素包围盒,只针对 Mesh 对象
90
- * @returns 包围盒
91
- */
92
- computeBoundingBox(): ModelItemBounding | undefined;
93
- }
94
- /**
95
- * 插件天空盒组件类,支持 3D 天空盒渲染能力
96
- * @since 2.0.0
97
- * @internal
98
- */
99
- export declare class ModelSkyboxComponent extends RendererComponent {
100
- /**
101
- * 内部天空盒对象
102
- */
103
- content: PSkybox;
104
- /**
105
- * 天空盒参数
106
- */
107
- data?: ModelSkyboxComponentData;
108
- /**
109
- * 场景管理器
110
- */
111
- sceneManager?: PSceneManager;
112
- /**
113
- * 构造函数,只保存传入参数,不在这里创建内部对象
114
- * @param engine - 引擎
115
- * @param data - Mesh 参数
116
- */
117
- constructor(engine: Engine, data?: ModelSkyboxComponentData);
118
- /**
119
- * 组件开始,需要创建内部对象和添加到场景管理器中
120
- */
121
- start(): void;
122
- /**
123
- * 组件渲染,需要检查可见性
124
- * @param renderer - 渲染器
125
- * @returns
126
- */
127
- render(renderer: Renderer): void;
128
- /**
129
- * 组件销毁,需要重场景管理器中删除
130
- */
131
- onDestroy(): void;
132
- /**
133
- * 反序列化,记录传入参数
134
- * @param data - 组件参数
135
- */
136
- fromData(data: ModelSkyboxComponentData): void;
137
- /**
138
- * 创建内部对象
139
- */
140
- createContent(): void;
141
- /**
142
- * 设置当前可见性。
143
- * @param visible - true:可见,false:不可见
144
- */
145
- setVisible(visible: boolean): void;
146
- /**
147
- * 获取当前可见性。
148
- */
149
- getVisible(): boolean;
150
- }
151
- /**
152
- * 插件灯光组件类,支持 3D 灯光能力
153
- * @since 2.0.0
154
- * @internal
155
- */
156
- export declare class ModelLightComponent extends Behaviour {
157
- /**
158
- * 内部灯光对象
159
- */
160
- content: PLight;
161
- /**
162
- * 参数
163
- */
164
- data?: ModelLightComponentData;
165
- /**
166
- * 构造函数,只保存传入参数,不在这里创建内部对象
167
- * @param engine - 引擎
168
- * @param data - Mesh 参数
169
- */
170
- constructor(engine: Engine, data?: ModelLightComponentData);
171
- /**
172
- * 组件开始,需要创建内部对象和添加到场景管理器中
173
- */
174
- start(): void;
175
- /**
176
- * 组件更新,更新内部对象状态
177
- * @param dt - 更新间隔
178
- */
179
- update(dt: number): void;
180
- /**
181
- * 组件销毁
182
- */
183
- onDestroy(): void;
184
- /**
185
- * 反序列化,记录传入参数
186
- * @param data - 组件参数
187
- */
188
- fromData(data: ModelLightComponentData): void;
189
- /**
190
- * 创建内部对象
191
- */
192
- createContent(): void;
193
- /**
194
- * 设置当前可见性。
195
- * @param visible - true:可见,false:不可见
196
- */
197
- setVisible(visible: boolean): void;
198
- /**
199
- * 获取当前 Mesh 的可见性。
200
- */
201
- getVisible(): boolean;
202
- }
203
- /**
204
- * 插件相机组件类,支持 3D 相机能力
205
- * @since 2.0.0
206
- * @internal
207
- */
208
- export declare class ModelCameraComponent extends Behaviour {
209
- /**
210
- * 内部相机对象
211
- */
212
- content: PCamera;
213
- /**
214
- * 参数
215
- */
216
- data?: ModelCameraComponentData;
217
- /**
218
- * 构造函数,只保存传入参数,不在这里创建内部对象
219
- * @param engine - 引擎
220
- * @param data - Mesh 参数
221
- */
222
- constructor(engine: Engine, data?: ModelCameraComponentData);
223
- /**
224
- * 组件开始,需要创建内部对象和添加到场景管理器中
225
- */
226
- start(): void;
227
- /**
228
- * 组件更新,更新内部对象状态
229
- * @param dt - 更新间隔
230
- */
231
- update(dt: number): void;
232
- /**
233
- * 组件销毁
234
- */
235
- onDestroy(): void;
236
- /**
237
- * 反序列化,记录传入参数
238
- * @param data - 组件参数
239
- */
240
- fromData(data: ModelCameraComponentData): void;
241
- /**
242
- * 创建内部对象
243
- */
244
- createContent(): void;
245
- /**
246
- * 更新合成主相机,更加当前相机元素状态
247
- */
248
- updateMainCamera(): void;
249
- /**
250
- * 设置变换
251
- * @param position - 位置
252
- * @param rotation - 旋转
253
- */
254
- setTransform(position?: Vector3, rotation?: Euler): void;
255
- }
256
- /**
257
- * 插件动画组件类,支持 3D 动画能力
258
- * @since 2.0.0
259
- * @internal
260
- */
261
- export declare class AnimationComponent extends Behaviour {
262
- /**
263
- * 参数
264
- */
265
- data?: AnimationComponentData;
266
- elapsedTime: number;
267
- animation: number;
268
- clips: ModelAnimationClip[];
269
- /**
270
- * 构造函数,只保存传入参数,不在这里创建内部对象
271
- * @param engine - 引擎
272
- */
273
- constructor(engine: Engine);
274
- /**
275
- * 组件开始,需要创建内部对象和添加到场景管理器中
276
- */
277
- start(): void;
278
- /**
279
- * 组件更新,更新内部对象状态
280
- * @param dt - 更新间隔
281
- */
282
- update(dt: number): void;
283
- /**
284
- * 组件销毁
285
- */
286
- onDestroy(): void;
287
- /**
288
- * 反序列化,记录传入参数
289
- * @param data - 组件参数
290
- */
291
- fromData(data: AnimationComponentData): void;
292
- }
293
- declare class ModelAnimationClip extends AnimationClip {
294
- path2Node: Record<string, VFXItem>;
295
- sampleAnimation(vfxItem: VFXItem, time: number): void;
296
- setFromAnimationClip(clip: AnimationClip): void;
297
- getTargetItem(rootItem: VFXItem, path: string): VFXItem;
298
- }
299
1
  export {};
@@ -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
@@ -1,6 +1,6 @@
1
- import type { Engine, VFXItem } from '@galacean/effects';
2
- import { Behaviour, Transform } from '@galacean/effects';
3
- import type { ModelTreeContent, ModelTreeOptions } from '../index';
1
+ import type { VFXItem } from '@galacean/effects';
2
+ import { Transform } from '@galacean/effects';
3
+ import type { ModelTreeOptions } from '../index';
4
4
  import { PAnimationManager } from '../runtime';
5
5
  /**
6
6
  * 场景树节点描述
@@ -82,52 +82,3 @@ export declare class ModelTreeItem {
82
82
  dispose(): void;
83
83
  private build;
84
84
  }
85
- /**
86
- * 插件场景树组件类,实现 3D 场景树功能
87
- * @since 2.0.0
88
- * @internal
89
- */
90
- export declare class ModelTreeComponent extends Behaviour {
91
- /**
92
- * 内部节点树元素
93
- */
94
- content: ModelTreeItem;
95
- /**
96
- * 参数
97
- */
98
- options?: ModelTreeContent;
99
- /**
100
- * 构造函数,创建节点树元素
101
- * @param engine
102
- * @param options
103
- */
104
- constructor(engine: Engine, options?: ModelTreeContent);
105
- /**
106
- * 反序列化,保存入参和创建节点树元素
107
- * @param options
108
- */
109
- fromData(options: ModelTreeContent): void;
110
- /**
111
- * 组件开始,查询合成中场景管理器并设置到动画管理器中
112
- */
113
- start(): void;
114
- /**
115
- * 组件更新,内部对象更新
116
- * @param dt
117
- */
118
- update(dt: number): void;
119
- /**
120
- * 组件销毁,内部对象销毁
121
- */
122
- onDestroy(): void;
123
- /**
124
- * 创建内部场景树元素
125
- */
126
- createContent(): void;
127
- /**
128
- * 获取元素的变换
129
- * @param itemId - 元素索引
130
- * @returns
131
- */
132
- getNodeTransform(itemId: string): Transform;
133
- }
package/dist/weapp.js CHANGED
@@ -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.1";
13797
+ var version = "2.0.3";
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!");
package/dist/weapp.mjs CHANGED
@@ -13771,7 +13771,7 @@ var GLTFHelper = /*#__PURE__*/ function() {
13771
13771
 
13772
13772
  registerPlugin("tree", ModelTreePlugin, VFXItem, true);
13773
13773
  registerPlugin("model", ModelPlugin, VFXItem);
13774
- var version = "2.0.1";
13774
+ var version = "2.0.3";
13775
13775
  logger.info("Plugin model version: " + version + ".");
13776
13776
  if (version !== EFFECTS.version) {
13777
13777
  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!");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/effects-plugin-model",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "description": "Galacean Effects player model plugin",
5
5
  "module": "./dist/index.mjs",
6
6
  "main": "./dist/index.js",
@@ -48,15 +48,15 @@
48
48
  "registry": "https://registry.npmjs.org"
49
49
  },
50
50
  "dependencies": {
51
- "@galacean/effects-helper": "2.0.1"
51
+ "@galacean/effects-helper": "2.0.3"
52
52
  },
53
53
  "devDependencies": {
54
- "@vvfx/resource-detection": "0.6.0",
54
+ "@vvfx/resource-detection": "^0.6.2",
55
55
  "@types/hammerjs": "^2.0.45",
56
56
  "fpsmeter": "^0.3.1",
57
57
  "hammerjs": "^2.0.8",
58
- "@galacean/effects": "2.0.1",
59
- "@galacean/effects-plugin-editor-gizmo": "2.0.1"
58
+ "@galacean/effects": "2.0.3",
59
+ "@galacean/effects-plugin-editor-gizmo": "2.0.3"
60
60
  },
61
61
  "scripts": {
62
62
  "dev": "vite",