@galacean/effects-plugin-model 2.3.0-beta.0 → 2.3.0-beta.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,7 +3,7 @@
3
3
  * Description: Galacean Effects player model plugin
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 飂兮
6
- * Version: v2.3.0-beta.0
6
+ * Version: v2.3.0-beta.2
7
7
  */
8
8
 
9
9
  import * as EFFECTS from '@galacean/effects';
@@ -2116,11 +2116,10 @@ var ModelCameraComponent = /*#__PURE__*/ function(Behaviour) {
2116
2116
  this.content.matrix = this.transform.getWorldMatrix();
2117
2117
  var composition = this.item.composition;
2118
2118
  if (composition) {
2119
- composition.camera.position = this.transform.position.clone();
2120
- composition.camera.setQuat(this.transform.quat);
2121
2119
  composition.camera.near = this.content.nearPlane;
2122
2120
  composition.camera.far = this.content.farPlane;
2123
2121
  composition.camera.fov = this.content.fov;
2122
+ composition.camera.setTransform(this.transform);
2124
2123
  }
2125
2124
  };
2126
2125
  /**
@@ -9226,6 +9225,32 @@ var EffectsMeshProxy = /*#__PURE__*/ function() {
9226
9225
  return _this;
9227
9226
  }
9228
9227
  var _proto = ModelPlugin.prototype;
9228
+ _proto.precompile = function precompile(compositions, renderer) {
9229
+ var isWebGL2 = renderer.engine.gpuCapability.level === 2;
9230
+ var pbrShaderCode = fetchPBRShaderCode();
9231
+ var unlitShaderCode = fetchUnlitShaderCode();
9232
+ var pbrShaderData = {
9233
+ id: PBRShaderGUID,
9234
+ name: "PBR Shader",
9235
+ dataType: spec.DataType.Shader,
9236
+ fragment: pbrShaderCode.fragmentShaderCode,
9237
+ vertex: pbrShaderCode.vertexShaderCode,
9238
+ // @ts-expect-error
9239
+ glslVersion: isWebGL2 ? GLSLVersion.GLSL3 : GLSLVersion.GLSL1
9240
+ };
9241
+ var unlitShaderData = {
9242
+ id: UnlitShaderGUID,
9243
+ name: "Unlit Shader",
9244
+ dataType: spec.DataType.Shader,
9245
+ fragment: unlitShaderCode.fragmentShaderCode,
9246
+ vertex: unlitShaderCode.vertexShaderCode,
9247
+ // @ts-expect-error
9248
+ glslVersion: isWebGL2 ? GLSLVersion.GLSL3 : GLSLVersion.GLSL1
9249
+ };
9250
+ renderer.engine.addEffectsObjectData(pbrShaderData);
9251
+ renderer.engine.addEffectsObjectData(unlitShaderData);
9252
+ return Promise.resolve();
9253
+ };
9229
9254
  /**
9230
9255
  * 创建 3D 场景管理器和缓存器
9231
9256
  * @param composition - 合成
@@ -9310,32 +9335,6 @@ var EffectsMeshProxy = /*#__PURE__*/ function() {
9310
9335
  });
9311
9336
  })();
9312
9337
  };
9313
- ModelPlugin.precompile = function precompile(compositions, renderer) {
9314
- var isWebGL2 = renderer.engine.gpuCapability.level === 2;
9315
- var pbrShaderCode = fetchPBRShaderCode();
9316
- var unlitShaderCode = fetchUnlitShaderCode();
9317
- var pbrShaderData = {
9318
- id: PBRShaderGUID,
9319
- name: "PBR Shader",
9320
- dataType: spec.DataType.Shader,
9321
- fragment: pbrShaderCode.fragmentShaderCode,
9322
- vertex: pbrShaderCode.vertexShaderCode,
9323
- // @ts-expect-error
9324
- glslVersion: isWebGL2 ? GLSLVersion.GLSL3 : GLSLVersion.GLSL1
9325
- };
9326
- var unlitShaderData = {
9327
- id: UnlitShaderGUID,
9328
- name: "Unlit Shader",
9329
- dataType: spec.DataType.Shader,
9330
- fragment: unlitShaderCode.fragmentShaderCode,
9331
- vertex: unlitShaderCode.vertexShaderCode,
9332
- // @ts-expect-error
9333
- glslVersion: isWebGL2 ? GLSLVersion.GLSL3 : GLSLVersion.GLSL1
9334
- };
9335
- renderer.engine.addEffectsObjectData(pbrShaderData);
9336
- renderer.engine.addEffectsObjectData(unlitShaderData);
9337
- return Promise.resolve();
9338
- };
9339
9338
  return ModelPlugin;
9340
9339
  }(AbstractPlugin);
9341
9340
  var ModelPluginComponent = /*#__PURE__*/ function(Behaviour) {
@@ -13190,7 +13189,7 @@ var GLTFHelper = /*#__PURE__*/ function() {
13190
13189
  registerPlugin("model", ModelPlugin, VFXItem);
13191
13190
  /**
13192
13191
  * 插件版本号
13193
- */ var version = "2.3.0-beta.0";
13192
+ */ var version = "2.3.0-beta.2";
13194
13193
  logger.info("Plugin model version: " + version + ".");
13195
13194
  if (version !== EFFECTS.version) {
13196
13195
  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!");