@galacean/effects-plugin-model 2.0.0-alpha.16 → 2.0.0-alpha.18

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/alipay.js CHANGED
@@ -2,7 +2,27 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var effects = require('@galacean/effects/alipay');
5
+ var EFFECTS = require('@galacean/effects/alipay');
6
+
7
+ function _interopNamespace(e) {
8
+ if (e && e.__esModule) return e;
9
+ var n = Object.create(null);
10
+ if (e) {
11
+ Object.keys(e).forEach(function (k) {
12
+ if (k !== 'default') {
13
+ var d = Object.getOwnPropertyDescriptor(e, k);
14
+ Object.defineProperty(n, k, d.get ? d : {
15
+ enumerable: true,
16
+ get: function () { return e[k]; }
17
+ });
18
+ }
19
+ });
20
+ }
21
+ n["default"] = e;
22
+ return Object.freeze(n);
23
+ }
24
+
25
+ var EFFECTS__namespace = /*#__PURE__*/_interopNamespace(EFFECTS);
6
26
 
7
27
  /**
8
28
  * Model 插件元素类型
@@ -195,7 +215,7 @@ function _extends() {
195
215
  return _extends.apply(this, arguments);
196
216
  }
197
217
 
198
- var Vector2 = effects.math.Vector2, Vector3 = effects.math.Vector3, Vector4 = effects.math.Vector4, Matrix3 = effects.math.Matrix3, Matrix4 = effects.math.Matrix4, Color = effects.math.Color, Euler = effects.math.Euler, EulerOrder = effects.math.EulerOrder, Quaternion = effects.math.Quaternion, Box3 = effects.math.Box3, Sphere = effects.math.Sphere, Ray = effects.math.Ray, DEG2RAD = effects.math.DEG2RAD;
218
+ var Vector2 = EFFECTS.math.Vector2, Vector3 = EFFECTS.math.Vector3, Vector4 = EFFECTS.math.Vector4, Matrix3 = EFFECTS.math.Matrix3, Matrix4 = EFFECTS.math.Matrix4, Color = EFFECTS.math.Color, Euler = EFFECTS.math.Euler, EulerOrder = EFFECTS.math.EulerOrder, Quaternion = EFFECTS.math.Quaternion, Box3 = EFFECTS.math.Box3, Sphere = EFFECTS.math.Sphere, Ray = EFFECTS.math.Ray, DEG2RAD = EFFECTS.math.DEG2RAD;
199
219
 
200
220
  exports.PObjectType = void 0;
201
221
  (function(PObjectType) {
@@ -284,10 +304,10 @@ var UnlitShaderGUID = "unlit000000000000000000000000000";
284
304
  * @param trans - GE 变换对象或数据
285
305
  * @returns
286
306
  */ _proto.fromEffectsTransform = function fromEffectsTransform(trans) {
287
- if (_instanceof1(trans, effects.Transform)) {
307
+ if (_instanceof1(trans, EFFECTS.Transform)) {
288
308
  this.setMatrix(trans.getWorldMatrix());
289
309
  } else {
290
- var effectsTrans = new effects.Transform(_extends({}, trans, {
310
+ var effectsTrans = new EFFECTS.Transform(_extends({}, trans, {
291
311
  valid: true
292
312
  }));
293
313
  effectsTrans.setValid(true);
@@ -462,10 +482,10 @@ var UnlitShaderGUID = "unlit000000000000000000000000000";
462
482
  function PGlobalState() {
463
483
  this.isWebGL2 = false;
464
484
  this.shaderShared = true;
465
- this.runtimeEnv = effects.PLAYER_OPTIONS_ENV_EDITOR;
485
+ this.runtimeEnv = EFFECTS.PLAYER_OPTIONS_ENV_EDITOR;
466
486
  this.compatibleMode = "gltf";
467
487
  this.visBoundingBox = false;
468
- this.renderMode3D = effects.spec.RenderMode3D.none;
488
+ this.renderMode3D = EFFECTS.spec.RenderMode3D.none;
469
489
  this.renderMode3DUVGridSize = 1 / 16;
470
490
  }
471
491
  var _proto = PGlobalState.prototype;
@@ -474,16 +494,16 @@ var UnlitShaderGUID = "unlit000000000000000000000000000";
474
494
  */ _proto.reset = function reset() {
475
495
  this.isWebGL2 = false;
476
496
  this.shaderShared = true;
477
- this.runtimeEnv = effects.PLAYER_OPTIONS_ENV_EDITOR;
497
+ this.runtimeEnv = EFFECTS.PLAYER_OPTIONS_ENV_EDITOR;
478
498
  this.compatibleMode = "gltf";
479
499
  this.visBoundingBox = false;
480
- this.renderMode3D = effects.spec.RenderMode3D.none;
500
+ this.renderMode3D = EFFECTS.spec.RenderMode3D.none;
481
501
  this.renderMode3DUVGridSize = 1 / 16;
482
502
  };
483
503
  /**
484
504
  * 是否可视化渲染中间结果
485
505
  */ _proto.hasRenderMode3D = function hasRenderMode3D() {
486
- return this.renderMode3D !== effects.spec.RenderMode3D.none;
506
+ return this.renderMode3D !== EFFECTS.spec.RenderMode3D.none;
487
507
  };
488
508
  /**
489
509
  * 获取单例
@@ -498,7 +518,7 @@ var UnlitShaderGUID = "unlit000000000000000000000000000";
498
518
  get: /**
499
519
  * 是否编辑器模式
500
520
  */ function get() {
501
- return this.runtimeEnv === effects.PLAYER_OPTIONS_ENV_EDITOR;
521
+ return this.runtimeEnv === EFFECTS.PLAYER_OPTIONS_ENV_EDITOR;
502
522
  }
503
523
  },
504
524
  {
@@ -774,7 +794,7 @@ var ctrlMap = {
774
794
  * @param binaries
775
795
  * @param pointer
776
796
  */ function typedArrayFromBinary(binary, pointer) {
777
- if (pointer.length != 2 || pointer[0] !== effects.spec.ValueType.BINARY || !_instanceof1(pointer[1], Array)) {
797
+ if (pointer.length != 2 || pointer[0] !== EFFECTS.spec.ValueType.BINARY || !_instanceof1(pointer[1], Array)) {
778
798
  // 不是BinaryPointer,可能已经创建,直接返回
779
799
  return pointer;
780
800
  }
@@ -1151,7 +1171,7 @@ exports.TextureDataMode = void 0;
1151
1171
  var matList = props.inverseBindMatrices;
1152
1172
  if (matList !== undefined && matList.length > 0) {
1153
1173
  if (matList.length % 16 !== 0 || matList.length !== this.jointItem.length * 16) {
1154
- throw new Error("Invalid array length, invert bind matrices " + matList.length + ", joint array " + this.jointItem.length);
1174
+ throw new Error("Invalid array length, invert bind matrices " + matList.length + ", joint array " + this.jointItem.length + ".");
1155
1175
  }
1156
1176
  var matrixCount = matList.length / 16;
1157
1177
  for(var i = 0; i < matrixCount; i++){
@@ -1182,7 +1202,7 @@ exports.TextureDataMode = void 0;
1182
1202
  });
1183
1203
  } else {
1184
1204
  this.animationMatrices = this.inverseBindMatrices;
1185
- console.error("Some error occured, replace skin animation matrices by invert bind matrices");
1205
+ console.error("Some error occured, replace skin animation matrices by invert bind matrices.");
1186
1206
  }
1187
1207
  };
1188
1208
  /**
@@ -1243,7 +1263,7 @@ exports.TextureDataMode = void 0;
1243
1263
  } else if (detail.halfFloatTexture) {
1244
1264
  return 2;
1245
1265
  } else {
1246
- throw new Error("Too many joint count " + jointCount + ", half float texture not support");
1266
+ throw new Error("Too many joint count " + jointCount + ", half float texture not support.");
1247
1267
  }
1248
1268
  } else {
1249
1269
  return 0;
@@ -1256,7 +1276,7 @@ exports.TextureDataMode = void 0;
1256
1276
  (_props_boneNames = props.boneNames) == null ? void 0 : _props_boneNames.forEach(function(boneName) {
1257
1277
  var node = name2Item[boneName];
1258
1278
  if (!node) {
1259
- throw new Error("Can't find node of bone name " + boneName);
1279
+ throw new Error("Can't find node of bone name " + boneName + ".");
1260
1280
  }
1261
1281
  jointItems.push(node);
1262
1282
  });
@@ -1353,19 +1373,19 @@ exports.TextureDataMode = void 0;
1353
1373
  * 还要注意最大数目不能超过5,否则也直接报错。
1354
1374
  * 后续考虑是否做个兼容,目前还是严格报错比较好。
1355
1375
  */ if (positionCount > 0 && positionCount != this.morphWeightsLength) {
1356
- console.error("Position morph count mismatch: " + this.morphWeightsLength + ", " + positionCount);
1376
+ console.error("Position morph count mismatch: " + this.morphWeightsLength + ", " + positionCount + ".");
1357
1377
  return false;
1358
1378
  }
1359
1379
  if (normalCount > 0 && normalCount != this.morphWeightsLength) {
1360
- console.error("Normal morph count mismatch: " + this.morphWeightsLength + ", " + normalCount);
1380
+ console.error("Normal morph count mismatch: " + this.morphWeightsLength + ", " + normalCount + ".");
1361
1381
  return false;
1362
1382
  }
1363
1383
  if (tangentCount > 0 && tangentCount != this.morphWeightsLength) {
1364
- console.error("Tangent morph count mismatch: " + this.morphWeightsLength + ", " + tangentCount);
1384
+ console.error("Tangent morph count mismatch: " + this.morphWeightsLength + ", " + tangentCount + ".");
1365
1385
  return false;
1366
1386
  }
1367
1387
  if (this.morphWeightsLength > 5) {
1368
- console.error("Tangent morph count should not greater than 5, current " + this.morphWeightsLength);
1388
+ console.error("Tangent morph count should not greater than 5, current " + this.morphWeightsLength + ".");
1369
1389
  return false;
1370
1390
  }
1371
1391
  return true;
@@ -1387,7 +1407,7 @@ exports.TextureDataMode = void 0;
1387
1407
  _proto.updateWeights = function updateWeights(weights) {
1388
1408
  var _this = this;
1389
1409
  if (weights.length != this.morphWeightsArray.length) {
1390
- console.error("Length of morph weights mismatch: input " + weights.length + ", internel " + this.morphWeightsArray.length);
1410
+ console.error("Length of morph weights mismatch: input " + weights.length + ", internel " + this.morphWeightsArray.length + ".");
1391
1411
  return;
1392
1412
  }
1393
1413
  weights.forEach(function(value, index) {
@@ -1508,16 +1528,16 @@ exports.PAnimPathType = void 0;
1508
1528
  this.component = this.dataArray.length / this.timeArray.length;
1509
1529
  // special checker for weights animation
1510
1530
  if (this.component <= 0) {
1511
- console.error("Invalid weights component: " + this.timeArray.length + ", " + this.component + ", " + this.dataArray.length);
1531
+ console.error("Invalid weights component: " + this.timeArray.length + ", " + this.component + ", " + this.dataArray.length + ".");
1512
1532
  } else if (this.timeArray.length * this.component != this.dataArray.length) {
1513
- console.error("Invalid weights array length: " + this.timeArray.length + ", " + this.component + ", " + this.dataArray.length);
1533
+ console.error("Invalid weights array length: " + this.timeArray.length + ", " + this.component + ", " + this.dataArray.length + ".");
1514
1534
  }
1515
1535
  } else {
1516
1536
  // should never happened
1517
- console.error("Invalid path status: " + path);
1537
+ console.error("Invalid path status: " + path + ".");
1518
1538
  }
1519
1539
  if (this.timeArray.length * this.component > this.dataArray.length) {
1520
- throw new Error("Data length mismatch: " + this.timeArray.length + ", " + this.component + ", " + this.dataArray.length);
1540
+ throw new Error("Data length mismatch: " + this.timeArray.length + ", " + this.component + ", " + this.dataArray.length + ".");
1521
1541
  }
1522
1542
  if (interpolation === "LINEAR") {
1523
1543
  this.interp = 0;
@@ -1642,21 +1662,21 @@ exports.PAnimPathType = void 0;
1642
1662
  }
1643
1663
  var _this_buffer_data;
1644
1664
  var data = (_this_buffer_data = (_this_buffer = this.buffer) == null ? void 0 : _this_buffer.data) != null ? _this_buffer_data : new Float32Array(this.getSize() * 4);
1645
- var type = this.isHalfFloat ? effects.glContext.HALF_FLOAT : effects.glContext.FLOAT;
1646
- this.texture = effects.Texture.create(this.engine, {
1665
+ var type = this.isHalfFloat ? EFFECTS.glContext.HALF_FLOAT : EFFECTS.glContext.FLOAT;
1666
+ this.texture = EFFECTS.Texture.create(this.engine, {
1647
1667
  name: name,
1648
1668
  data: {
1649
1669
  width: this.width,
1650
1670
  height: this.height,
1651
1671
  data: data
1652
1672
  },
1653
- target: effects.glContext.TEXTURE_2D,
1654
- format: effects.glContext.RGBA,
1673
+ target: EFFECTS.glContext.TEXTURE_2D,
1674
+ format: EFFECTS.glContext.RGBA,
1655
1675
  type: type,
1656
- wrapS: effects.glContext.CLAMP_TO_EDGE,
1657
- wrapT: effects.glContext.CLAMP_TO_EDGE,
1658
- minFilter: effects.glContext.NEAREST,
1659
- magFilter: effects.glContext.NEAREST
1676
+ wrapS: EFFECTS.glContext.CLAMP_TO_EDGE,
1677
+ wrapT: EFFECTS.glContext.CLAMP_TO_EDGE,
1678
+ minFilter: EFFECTS.glContext.NEAREST,
1679
+ magFilter: EFFECTS.glContext.NEAREST
1660
1680
  });
1661
1681
  };
1662
1682
  /**
@@ -1670,13 +1690,13 @@ exports.PAnimPathType = void 0;
1670
1690
  var _this_buffer;
1671
1691
  var _this_buffer_data;
1672
1692
  this.texture.updateSource({
1673
- sourceType: effects.TextureSourceType.data,
1693
+ sourceType: EFFECTS.TextureSourceType.data,
1674
1694
  data: {
1675
1695
  width: this.width,
1676
1696
  height: this.height,
1677
1697
  data: (_this_buffer_data = (_this_buffer = this.buffer) == null ? void 0 : _this_buffer.data) != null ? _this_buffer_data : buffer
1678
1698
  },
1679
- target: effects.glContext.TEXTURE_2D
1699
+ target: EFFECTS.glContext.TEXTURE_2D
1680
1700
  });
1681
1701
  }
1682
1702
  };
@@ -1874,7 +1894,7 @@ var deg2rad = Math.PI / 180;
1874
1894
  */ _this.aspect = 1.0;
1875
1895
  /**
1876
1896
  * 剪裁模式,默认是剪裁左右
1877
- */ _this.clipMode = effects.spec.CameraClipMode.landscape;
1897
+ */ _this.clipMode = EFFECTS.spec.CameraClipMode.landscape;
1878
1898
  /**
1879
1899
  * 投影矩阵
1880
1900
  */ _this.projectionMatrix = new Matrix4();
@@ -1897,7 +1917,7 @@ var deg2rad = Math.PI / 180;
1897
1917
  var _data_aspect;
1898
1918
  _this.aspect = (_data_aspect = data.aspect) != null ? _data_aspect : _this.width / _this.height;
1899
1919
  var _data_clipMode;
1900
- _this.clipMode = (_data_clipMode = data.clipMode) != null ? _data_clipMode : effects.spec.CameraClipMode.landscape;
1920
+ _this.clipMode = (_data_clipMode = data.clipMode) != null ? _data_clipMode : EFFECTS.spec.CameraClipMode.landscape;
1901
1921
  _this.update();
1902
1922
  return _this;
1903
1923
  }
@@ -1908,7 +1928,7 @@ var deg2rad = Math.PI / 180;
1908
1928
  if (this.owner !== undefined) {
1909
1929
  this.transform.fromEffectsTransform(this.owner.transform);
1910
1930
  }
1911
- var reverse = this.clipMode === effects.spec.CameraClipMode.portrait;
1931
+ var reverse = this.clipMode === EFFECTS.spec.CameraClipMode.portrait;
1912
1932
  this.projectionMatrix.perspective(this.fov * deg2rad, this.aspect, this.nearPlane, this.farPlane, reverse);
1913
1933
  this.viewMatrix = this.matrix.invert();
1914
1934
  };
@@ -1917,7 +1937,7 @@ var deg2rad = Math.PI / 180;
1917
1937
  * @param fov - 视角大小
1918
1938
  * @returns 投影矩阵
1919
1939
  */ _proto.getNewProjectionMatrix = function getNewProjectionMatrix(fov) {
1920
- var reverse = this.clipMode === effects.spec.CameraClipMode.portrait;
1940
+ var reverse = this.clipMode === EFFECTS.spec.CameraClipMode.portrait;
1921
1941
  return new Matrix4().perspective(Math.min(fov * 1.25, 140) * deg2rad, this.aspect, this.nearPlane, this.farPlane, reverse);
1922
1942
  };
1923
1943
  /**
@@ -1965,7 +1985,7 @@ var deg2rad = Math.PI / 180;
1965
1985
  * 是否剪裁上下
1966
1986
  * @returns
1967
1987
  */ _proto.isReversed = function isReversed() {
1968
- return this.clipMode === effects.spec.CameraClipMode.portrait;
1988
+ return this.clipMode === EFFECTS.spec.CameraClipMode.portrait;
1969
1989
  };
1970
1990
  /**
1971
1991
  * 获取眼睛位置
@@ -1994,7 +2014,7 @@ var deg2rad = Math.PI / 180;
1994
2014
  fov: 60,
1995
2015
  far: 1000,
1996
2016
  near: 0.001,
1997
- clipMode: effects.spec.CameraClipMode.portrait,
2017
+ clipMode: EFFECTS.spec.CameraClipMode.portrait,
1998
2018
  item: {
1999
2019
  id: "0"
2000
2020
  }
@@ -2147,11 +2167,11 @@ var deg2rad = Math.PI / 180;
2147
2167
  var color = data.color;
2148
2168
  _this.color = new Vector3(color.r, color.g, color.b);
2149
2169
  _this.intensity = data.intensity;
2150
- if (data.lightType === effects.spec.LightType.point) {
2170
+ if (data.lightType === EFFECTS.spec.LightType.point) {
2151
2171
  _this.lightType = exports.PLightType.point;
2152
2172
  var _data_range;
2153
2173
  _this.range = (_data_range = data.range) != null ? _data_range : -1;
2154
- } else if (data.lightType === effects.spec.LightType.spot) {
2174
+ } else if (data.lightType === EFFECTS.spec.LightType.spot) {
2155
2175
  _this.lightType = exports.PLightType.spot;
2156
2176
  var _data_range1;
2157
2177
  _this.range = (_data_range1 = data.range) != null ? _data_range1 : -1;
@@ -2159,7 +2179,7 @@ var deg2rad = Math.PI / 180;
2159
2179
  _this.outerConeAngle = (_data_outerConeAngle = data.outerConeAngle) != null ? _data_outerConeAngle : Math.PI;
2160
2180
  var _data_innerConeAngle;
2161
2181
  _this.innerConeAngle = (_data_innerConeAngle = data.innerConeAngle) != null ? _data_innerConeAngle : 0;
2162
- } else if (data.lightType === effects.spec.LightType.directional) {
2182
+ } else if (data.lightType === EFFECTS.spec.LightType.directional) {
2163
2183
  _this.lightType = exports.PLightType.directional;
2164
2184
  } else {
2165
2185
  _this.lightType = exports.PLightType.ambient;
@@ -2301,14 +2321,14 @@ function _assert_this_initialized(self) {
2301
2321
  */ _proto.addDepthAttachment = function addDepthAttachment(options) {
2302
2322
  var _options_storageType;
2303
2323
  this.depthAttachment = {
2304
- storageType: (_options_storageType = options.storageType) != null ? _options_storageType : effects.RenderPassAttachmentStorageType.depth_16_texture
2324
+ storageType: (_options_storageType = options.storageType) != null ? _options_storageType : EFFECTS.RenderPassAttachmentStorageType.depth_16_texture
2305
2325
  };
2306
2326
  };
2307
2327
  /**
2308
2328
  * 添加默认深度附件,数据格式是 depth_16_texture
2309
2329
  */ _proto.addDefaultDepthAttachment = function addDefaultDepthAttachment() {
2310
2330
  this.depthAttachment = {
2311
- storageType: effects.RenderPassAttachmentStorageType.depth_16_texture
2331
+ storageType: EFFECTS.RenderPassAttachmentStorageType.depth_16_texture
2312
2332
  };
2313
2333
  };
2314
2334
  /**
@@ -2323,10 +2343,10 @@ function _assert_this_initialized(self) {
2323
2343
  var _options_format, _options_type, _options_filter, _options_filter1;
2324
2344
  this.colorAttachments.push({
2325
2345
  texture: {
2326
- format: (_options_format = options.format) != null ? _options_format : effects.glContext.RGBA,
2327
- type: (_options_type = options.type) != null ? _options_type : effects.glContext.HALF_FLOAT,
2328
- minFilter: (_options_filter = options.filter) != null ? _options_filter : effects.glContext.LINEAR,
2329
- magFilter: (_options_filter1 = options.filter) != null ? _options_filter1 : effects.glContext.LINEAR
2346
+ format: (_options_format = options.format) != null ? _options_format : EFFECTS.glContext.RGBA,
2347
+ type: (_options_type = options.type) != null ? _options_type : EFFECTS.glContext.HALF_FLOAT,
2348
+ minFilter: (_options_filter = options.filter) != null ? _options_filter : EFFECTS.glContext.LINEAR,
2349
+ magFilter: (_options_filter1 = options.filter) != null ? _options_filter1 : EFFECTS.glContext.LINEAR
2330
2350
  }
2331
2351
  });
2332
2352
  };
@@ -2359,7 +2379,7 @@ function _assert_this_initialized(self) {
2359
2379
  * 包围盒 Mesh 类,负责 3D Mesh 测试包围盒的显示
2360
2380
  */ var BoxMesh = /*#__PURE__*/ function() {
2361
2381
  function BoxMesh(engine, priority) {
2362
- var material = effects.Material.create(engine, {
2382
+ var material = EFFECTS.Material.create(engine, {
2363
2383
  shader: {
2364
2384
  vertex: this.vertexShader,
2365
2385
  fragment: this.fragmentShader,
@@ -2368,10 +2388,10 @@ function _assert_this_initialized(self) {
2368
2388
  });
2369
2389
  material.depthTest = true;
2370
2390
  material.depthMask = true;
2371
- this.mesh = effects.Mesh.create(engine, {
2391
+ this.mesh = EFFECTS.Mesh.create(engine, {
2372
2392
  name: "boxMesh",
2373
2393
  material: material,
2374
- geometry: effects.Geometry.create(engine, this.geometry),
2394
+ geometry: EFFECTS.Geometry.create(engine, this.geometry),
2375
2395
  priority: priority
2376
2396
  });
2377
2397
  }
@@ -2459,14 +2479,14 @@ function _assert_this_initialized(self) {
2459
2479
  return {
2460
2480
  attributes: {
2461
2481
  aPos: {
2462
- type: effects.glContext.FLOAT,
2482
+ type: EFFECTS.glContext.FLOAT,
2463
2483
  size: 1,
2464
2484
  data: data,
2465
2485
  stride: Float32Array.BYTES_PER_ELEMENT,
2466
2486
  offset: 0
2467
2487
  }
2468
2488
  },
2469
- mode: effects.glContext.LINES,
2489
+ mode: EFFECTS.glContext.LINES,
2470
2490
  indices: {
2471
2491
  data: index
2472
2492
  },
@@ -2537,7 +2557,7 @@ function _assert_this_initialized(self) {
2537
2557
  _this.subMeshes.push(subMesh);
2538
2558
  });
2539
2559
  if (_this.subMeshes.length <= 0) {
2540
- console.warn("No primitive inside mesh item " + name);
2560
+ console.warn("No primitive inside mesh item " + name + ".");
2541
2561
  }
2542
2562
  _this.boundingBox = _this.getItemBoundingBox(meshData.interaction);
2543
2563
  return _this;
@@ -2625,7 +2645,7 @@ function _assert_this_initialized(self) {
2625
2645
  return;
2626
2646
  }
2627
2647
  if (updatedArray.length != weightsArray.length) {
2628
- throw new Error("weight array length mismatch");
2648
+ throw new Error("Weight array length mismatch.");
2629
2649
  }
2630
2650
  for(var i = 0; i < updatedArray.length; i++){
2631
2651
  updatedArray[i] = weightsArray[i];
@@ -2741,7 +2761,7 @@ function _assert_this_initialized(self) {
2741
2761
  if (inBounding === undefined) {
2742
2762
  return new Box3();
2743
2763
  }
2744
- if (inBounding.type === effects.spec.ModelBoundingType.box) {
2764
+ if (inBounding.type === EFFECTS.spec.ModelBoundingType.box) {
2745
2765
  var _inBounding_center;
2746
2766
  var center = (_inBounding_center = inBounding.center) != null ? _inBounding_center : [
2747
2767
  0,
@@ -2876,12 +2896,12 @@ function _assert_this_initialized(self) {
2876
2896
  });
2877
2897
  this.material.setMaterialStates(material);
2878
2898
  } else {
2879
- material = effects.Material.create(this.engine, {
2899
+ material = EFFECTS.Material.create(this.engine, {
2880
2900
  shader: {
2881
2901
  vertex: this.material.vertexShaderCode,
2882
2902
  fragment: this.material.fragmentShaderCode,
2883
2903
  shared: globalState.shaderShared,
2884
- glslVersion: isWebGL2 ? effects.GLSLVersion.GLSL3 : effects.GLSLVersion.GLSL1
2904
+ glslVersion: isWebGL2 ? EFFECTS.GLSLVersion.GLSL3 : EFFECTS.GLSLVersion.GLSL1
2885
2905
  },
2886
2906
  uniformSemantics: newSemantics
2887
2907
  });
@@ -3147,21 +3167,21 @@ function _assert_this_initialized(self) {
3147
3167
  * @returns 返回相应的宏定义
3148
3168
  */ _proto.getRenderMode3DDefine = function getRenderMode3DDefine(mode) {
3149
3169
  switch(mode){
3150
- case effects.spec.RenderMode3D.uv:
3170
+ case EFFECTS.spec.RenderMode3D.uv:
3151
3171
  return "DEBUG_UV";
3152
- case effects.spec.RenderMode3D.normal:
3172
+ case EFFECTS.spec.RenderMode3D.normal:
3153
3173
  return "DEBUG_NORMAL";
3154
- case effects.spec.RenderMode3D.basecolor:
3174
+ case EFFECTS.spec.RenderMode3D.basecolor:
3155
3175
  return "DEBUG_BASECOLOR";
3156
- case effects.spec.RenderMode3D.alpha:
3176
+ case EFFECTS.spec.RenderMode3D.alpha:
3157
3177
  return "DEBUG_ALPHA";
3158
- case effects.spec.RenderMode3D.metallic:
3178
+ case EFFECTS.spec.RenderMode3D.metallic:
3159
3179
  return "DEBUG_METALLIC";
3160
- case effects.spec.RenderMode3D.roughness:
3180
+ case EFFECTS.spec.RenderMode3D.roughness:
3161
3181
  return "DEBUG_ROUGHNESS";
3162
- case effects.spec.RenderMode3D.ao:
3182
+ case EFFECTS.spec.RenderMode3D.ao:
3163
3183
  return "DEBUG_OCCLUSION";
3164
- case effects.spec.RenderMode3D.emissive:
3184
+ case EFFECTS.spec.RenderMode3D.emissive:
3165
3185
  return "DEBUG_EMISSIVE";
3166
3186
  }
3167
3187
  };
@@ -3619,7 +3639,7 @@ var EffectsMeshProxy = /*#__PURE__*/ function() {
3619
3639
  this.brdfLUT = this.sceneCache.getBrdfLutTexture();
3620
3640
  this.initGlobalState(opts);
3621
3641
  if (this.maxLightCount > 8) {
3622
- console.warn("Too many light items: " + this.maxLightCount + " light(s)");
3642
+ console.warn("Too many light items: " + this.maxLightCount + " light(s).");
3623
3643
  }
3624
3644
  };
3625
3645
  _proto.initGlobalState = function initGlobalState(opts) {
@@ -3629,13 +3649,13 @@ var EffectsMeshProxy = /*#__PURE__*/ function() {
3629
3649
  globalState.isWebGL2 = capbility.level === 2;
3630
3650
  var _opts_runtimeEnv;
3631
3651
  //globalState.shaderShared = composition.env === PLAYER_OPTIONS_ENV_EDITOR;
3632
- globalState.runtimeEnv = (_opts_runtimeEnv = opts.runtimeEnv) != null ? _opts_runtimeEnv : effects.PLAYER_OPTIONS_ENV_EDITOR;
3652
+ globalState.runtimeEnv = (_opts_runtimeEnv = opts.runtimeEnv) != null ? _opts_runtimeEnv : EFFECTS.PLAYER_OPTIONS_ENV_EDITOR;
3633
3653
  var _opts_compatibleMode;
3634
3654
  globalState.compatibleMode = (_opts_compatibleMode = opts.compatibleMode) != null ? _opts_compatibleMode : "gltf";
3635
3655
  var _opts_visBoundingBox;
3636
3656
  globalState.visBoundingBox = (_opts_visBoundingBox = opts.visBoundingBox) != null ? _opts_visBoundingBox : false;
3637
3657
  var _opts_renderMode3D;
3638
- globalState.renderMode3D = (_opts_renderMode3D = opts.renderMode3D) != null ? _opts_renderMode3D : effects.spec.RenderMode3D.none;
3658
+ globalState.renderMode3D = (_opts_renderMode3D = opts.renderMode3D) != null ? _opts_renderMode3D : EFFECTS.spec.RenderMode3D.none;
3639
3659
  var _opts_renderMode3DUVGridSize;
3640
3660
  globalState.renderMode3DUVGridSize = (_opts_renderMode3DUVGridSize = opts.renderMode3DUVGridSize) != null ? _opts_renderMode3DUVGridSize : 1 / 16;
3641
3661
  };
@@ -3691,7 +3711,7 @@ var EffectsMeshProxy = /*#__PURE__*/ function() {
3691
3711
  if (mesh.parentItemId !== undefined) {
3692
3712
  this.parentId2Mesh.set(mesh.parentItemId, mesh);
3693
3713
  }
3694
- effects.addItem(this.meshList, mesh);
3714
+ EFFECTS.addItem(this.meshList, mesh);
3695
3715
  } else if (_instanceof1(item, PSkybox)) {
3696
3716
  var skybox = item;
3697
3717
  skybox.setup(this.brdfLUT);
@@ -3708,7 +3728,7 @@ var EffectsMeshProxy = /*#__PURE__*/ function() {
3708
3728
  } else {
3709
3729
  this.cameraManager.insertCamera(item);
3710
3730
  }
3711
- effects.addItem(this.itemList, item);
3731
+ EFFECTS.addItem(this.itemList, item);
3712
3732
  };
3713
3733
  /**
3714
3734
  * 从场景中删除插件元素
@@ -3719,7 +3739,7 @@ var EffectsMeshProxy = /*#__PURE__*/ function() {
3719
3739
  if (mesh.parentItemId !== undefined) {
3720
3740
  this.parentId2Mesh.delete(mesh.parentItemId);
3721
3741
  }
3722
- effects.removeItem(this.meshList, mesh);
3742
+ EFFECTS.removeItem(this.meshList, mesh);
3723
3743
  } else if (_instanceof1(item, PSkybox)) {
3724
3744
  this.skybox = undefined;
3725
3745
  } else if (_instanceof1(item, PLight)) {
@@ -3727,13 +3747,13 @@ var EffectsMeshProxy = /*#__PURE__*/ function() {
3727
3747
  } else {
3728
3748
  this.cameraManager.remove(item);
3729
3749
  }
3730
- effects.removeItem(this.itemList, item);
3750
+ EFFECTS.removeItem(this.itemList, item);
3731
3751
  };
3732
3752
  /**
3733
3753
  * 更新默认相机状态,根据传入的相机参数
3734
3754
  * @param camera - 相机参数
3735
3755
  */ _proto.updateDefaultCamera = function updateDefaultCamera(camera) {
3736
- var effectsTransfrom = new effects.Transform(_extends({}, camera, {
3756
+ var effectsTransfrom = new EFFECTS.Transform(_extends({}, camera, {
3737
3757
  valid: true
3738
3758
  }));
3739
3759
  var newTransform = new PTransform().fromEffectsTransform(effectsTransfrom);
@@ -3969,9 +3989,8 @@ var StandardShaderSource;
3969
3989
  }
3970
3990
  if (isWebGL2) {
3971
3991
  return "#version 300 es\n" + source;
3972
- } else {
3973
- return "#version 100\n" + source;
3974
3992
  }
3993
+ return "#version 100\n" + source;
3975
3994
  }
3976
3995
  StandardShaderSource.getSourceCode = getSourceCode;
3977
3996
  })(StandardShaderSource || (StandardShaderSource = {}));
@@ -4249,7 +4268,7 @@ function getQuadFilterVS() {
4249
4268
  if (func !== undefined) {
4250
4269
  return func(context);
4251
4270
  } else {
4252
- throw new Error("Invalid material type " + materialType + ", shader content " + context);
4271
+ throw new Error("Invalid material type " + materialType + ", shader content " + context + ".");
4253
4272
  }
4254
4273
  };
4255
4274
  /**
@@ -4377,12 +4396,12 @@ exports.ModelMeshComponent = /*#__PURE__*/ function(RendererComponent) {
4377
4396
  var bounding = _this.bounding;
4378
4397
  if (bounding && (force || Number.isInteger(bounding.behavior))) {
4379
4398
  var type = bounding.type;
4380
- if (type === effects.spec.ModelBoundingType.box) {
4399
+ if (type === EFFECTS.spec.ModelBoundingType.box) {
4381
4400
  if (_instanceof1(_this.content, PMesh)) {
4382
4401
  var mesh = _this.content;
4383
4402
  var customHitTest = {
4384
4403
  behavior: bounding.behavior,
4385
- type: effects.HitTestType.custom,
4404
+ type: EFFECTS.HitTestType.custom,
4386
4405
  collect: function collect(ray, pointInCanvas) {
4387
4406
  var result = mesh.hitTesting(ray.origin, ray.direction);
4388
4407
  return result;
@@ -4393,7 +4412,7 @@ exports.ModelMeshComponent = /*#__PURE__*/ function(RendererComponent) {
4393
4412
  var worldMatrixData = _this.transform.getWorldMatrix();
4394
4413
  var customHitTest1 = {
4395
4414
  behavior: bounding.behavior,
4396
- type: effects.HitTestType.custom,
4415
+ type: EFFECTS.HitTestType.custom,
4397
4416
  collect: function collect(ray, pointInCanvas) {
4398
4417
  var result = RayIntersectsBoxWithRotation(ray, worldMatrixData, bounding);
4399
4418
  return result;
@@ -4401,7 +4420,7 @@ exports.ModelMeshComponent = /*#__PURE__*/ function(RendererComponent) {
4401
4420
  };
4402
4421
  return customHitTest1;
4403
4422
  }
4404
- } else if (type === effects.spec.ModelBoundingType.sphere) {
4423
+ } else if (type === EFFECTS.spec.ModelBoundingType.sphere) {
4405
4424
  var pos = new Vector3();
4406
4425
  _this.transform.assignWorldTRS(pos);
4407
4426
  var center = new Vector3();
@@ -4508,7 +4527,7 @@ exports.ModelMeshComponent = /*#__PURE__*/ function(RendererComponent) {
4508
4527
  var size = bbox.getSize(new Vector3());
4509
4528
  this.bounding = {
4510
4529
  behavior: (_this_bounding = this.bounding) == null ? void 0 : _this_bounding.behavior,
4511
- type: effects.spec.ModelBoundingType.box,
4530
+ type: EFFECTS.spec.ModelBoundingType.box,
4512
4531
  center: [
4513
4532
  center.x,
4514
4533
  center.y,
@@ -4526,9 +4545,9 @@ exports.ModelMeshComponent = /*#__PURE__*/ function(RendererComponent) {
4526
4545
  }
4527
4546
  };
4528
4547
  return ModelMeshComponent;
4529
- }(effects.RendererComponent);
4548
+ }(EFFECTS.RendererComponent);
4530
4549
  exports.ModelMeshComponent = __decorate([
4531
- effects.effectsClass(effects.spec.DataType.MeshComponent)
4550
+ EFFECTS.effectsClass(EFFECTS.spec.DataType.MeshComponent)
4532
4551
  ], exports.ModelMeshComponent);
4533
4552
  exports.ModelSkyboxComponent = /*#__PURE__*/ function(RendererComponent) {
4534
4553
  _inherits(ModelSkyboxComponent, RendererComponent);
@@ -4600,9 +4619,9 @@ exports.ModelSkyboxComponent = /*#__PURE__*/ function(RendererComponent) {
4600
4619
  return (_this_content_visible = (_this_content = this.content) == null ? void 0 : _this_content.visible) != null ? _this_content_visible : false;
4601
4620
  };
4602
4621
  return ModelSkyboxComponent;
4603
- }(effects.RendererComponent);
4622
+ }(EFFECTS.RendererComponent);
4604
4623
  exports.ModelSkyboxComponent = __decorate([
4605
- effects.effectsClass(effects.spec.DataType.SkyboxComponent)
4624
+ EFFECTS.effectsClass(EFFECTS.spec.DataType.SkyboxComponent)
4606
4625
  ], exports.ModelSkyboxComponent);
4607
4626
  exports.ModelLightComponent = /*#__PURE__*/ function(ItemBehaviour) {
4608
4627
  _inherits(ModelLightComponent, ItemBehaviour);
@@ -4665,9 +4684,9 @@ exports.ModelLightComponent = /*#__PURE__*/ function(ItemBehaviour) {
4665
4684
  return (_this_content_visible = (_this_content = this.content) == null ? void 0 : _this_content.visible) != null ? _this_content_visible : false;
4666
4685
  };
4667
4686
  return ModelLightComponent;
4668
- }(effects.ItemBehaviour);
4687
+ }(EFFECTS.ItemBehaviour);
4669
4688
  exports.ModelLightComponent = __decorate([
4670
- effects.effectsClass(effects.spec.DataType.LightComponent)
4689
+ EFFECTS.effectsClass(EFFECTS.spec.DataType.LightComponent)
4671
4690
  ], exports.ModelLightComponent);
4672
4691
  exports.ModelCameraComponent = /*#__PURE__*/ function(ItemBehaviour) {
4673
4692
  _inherits(ModelCameraComponent, ItemBehaviour);
@@ -4745,9 +4764,9 @@ exports.ModelCameraComponent = /*#__PURE__*/ function(ItemBehaviour) {
4745
4764
  this.updateMainCamera();
4746
4765
  };
4747
4766
  return ModelCameraComponent;
4748
- }(effects.ItemBehaviour);
4767
+ }(EFFECTS.ItemBehaviour);
4749
4768
  exports.ModelCameraComponent = __decorate([
4750
- effects.effectsClass(effects.spec.DataType.CameraComponent)
4769
+ EFFECTS.effectsClass(EFFECTS.spec.DataType.CameraComponent)
4751
4770
  ], exports.ModelCameraComponent);
4752
4771
  exports.AnimationComponent = /*#__PURE__*/ function(ItemBehaviour) {
4753
4772
  _inherits(AnimationComponent, ItemBehaviour);
@@ -4798,9 +4817,9 @@ exports.AnimationComponent = /*#__PURE__*/ function(ItemBehaviour) {
4798
4817
  });
4799
4818
  };
4800
4819
  return AnimationComponent;
4801
- }(effects.ItemBehaviour);
4820
+ }(EFFECTS.ItemBehaviour);
4802
4821
  exports.AnimationComponent = __decorate([
4803
- effects.effectsClass(effects.spec.DataType.AnimationComponent)
4822
+ EFFECTS.effectsClass(EFFECTS.spec.DataType.AnimationComponent)
4804
4823
  ], exports.AnimationComponent);
4805
4824
  var ModelAnimationClip = /*#__PURE__*/ function(AnimationClip) {
4806
4825
  _inherits(ModelAnimationClip, AnimationClip);
@@ -4846,10 +4865,10 @@ var ModelAnimationClip = /*#__PURE__*/ function(AnimationClip) {
4846
4865
  var properties = curve3.property.split(".");
4847
4866
  setProperty(component, properties, value3);
4848
4867
  } else {
4849
- console.error("Can't find mesh component");
4868
+ console.error("Can't find mesh component.");
4850
4869
  }
4851
4870
  } else {
4852
- console.warn("Ignore curve: className " + curve3.className);
4871
+ console.warn("Ignore curve: className " + curve3.className + ".");
4853
4872
  }
4854
4873
  }
4855
4874
  };
@@ -4877,21 +4896,21 @@ var ModelAnimationClip = /*#__PURE__*/ function(AnimationClip) {
4877
4896
  }
4878
4897
  }
4879
4898
  if (!findTag) {
4880
- throw new Error("Can't find path in tree " + rootItem.id + ", " + path);
4899
+ throw new Error("Can't find path in tree " + rootItem.id + ", " + path + ".");
4881
4900
  }
4882
4901
  }
4883
4902
  this.path2Node[path] = target;
4884
4903
  return target;
4885
4904
  };
4886
4905
  return ModelAnimationClip;
4887
- }(effects.AnimationClip);
4906
+ }(EFFECTS.AnimationClip);
4888
4907
  function setProperty(obj, properties, value) {
4889
4908
  var len = properties.length;
4890
4909
  var current = obj;
4891
4910
  for(var i = 0; i < len - 1; i++){
4892
4911
  var propName = properties[i];
4893
4912
  if (!(propName in current) || typeof current[propName] !== "object") {
4894
- console.error("Invalid properties " + properties);
4913
+ console.error("Invalid properties " + properties + ".");
4895
4914
  return;
4896
4915
  }
4897
4916
  current = current[propName];
@@ -5134,13 +5153,13 @@ var normal = new Vector3();
5134
5153
  var blob, urlCreator, imageUrl, imageObj;
5135
5154
  return __generator(this, function(_state) {
5136
5155
  if (image.imageData === undefined) {
5137
- console.error("createTexture2D: Invalid image data from " + image);
5156
+ console.error("createTexture2D: Invalid image data from " + image + ".");
5138
5157
  // 这里不应该发生的,做个兜底
5139
5158
  return [
5140
5159
  2,
5141
- effects.Texture.create(engine, {
5160
+ EFFECTS.Texture.create(engine, {
5142
5161
  name: "createTexture2D",
5143
- sourceType: effects.TextureSourceType.data,
5162
+ sourceType: EFFECTS.TextureSourceType.data,
5144
5163
  data: {
5145
5164
  data: new Uint8Array([
5146
5165
  255,
@@ -5168,34 +5187,34 @@ var normal = new Vector3();
5168
5187
  new Promise(function(resolve, reject) {
5169
5188
  imageObj.onload = function() {
5170
5189
  var _texture_minFilter;
5171
- var minFilter = (_texture_minFilter = texture.minFilter) != null ? _texture_minFilter : effects.glContext.LINEAR_MIPMAP_LINEAR;
5190
+ var minFilter = (_texture_minFilter = texture.minFilter) != null ? _texture_minFilter : EFFECTS.glContext.LINEAR_MIPMAP_LINEAR;
5172
5191
  var premultiplyAlpha = false;
5173
5192
  if (tiny3dMode) {
5174
5193
  //if (minFilter === glContext.NEAREST_MIPMAP_LINEAR
5175
5194
  // || minFilter === glContext.LINEAR_MIPMAP_NEAREST) {
5176
- minFilter = effects.glContext.LINEAR_MIPMAP_LINEAR;
5195
+ minFilter = EFFECTS.glContext.LINEAR_MIPMAP_LINEAR;
5177
5196
  //}
5178
5197
  if (!WebGLHelper.isPow2(imageObj.width) || !WebGLHelper.isPow2(imageObj.height)) {
5179
- minFilter = effects.glContext.LINEAR;
5198
+ minFilter = EFFECTS.glContext.LINEAR;
5180
5199
  }
5181
5200
  //
5182
5201
  premultiplyAlpha = isBaseColor ? false : true;
5183
5202
  }
5184
5203
  var generateMipmap = false;
5185
- if (minFilter == effects.glContext.NEAREST_MIPMAP_NEAREST || minFilter == effects.glContext.LINEAR_MIPMAP_NEAREST || minFilter == effects.glContext.NEAREST_MIPMAP_LINEAR || minFilter == effects.glContext.LINEAR_MIPMAP_LINEAR) {
5204
+ if (minFilter == EFFECTS.glContext.NEAREST_MIPMAP_NEAREST || minFilter == EFFECTS.glContext.LINEAR_MIPMAP_NEAREST || minFilter == EFFECTS.glContext.NEAREST_MIPMAP_LINEAR || minFilter == EFFECTS.glContext.LINEAR_MIPMAP_LINEAR) {
5186
5205
  generateMipmap = true;
5187
5206
  }
5188
5207
  var _texture_wrapS, _texture_wrapT, _texture_magFilter;
5189
- var res = effects.Texture.create(engine, {
5208
+ var res = EFFECTS.Texture.create(engine, {
5190
5209
  name: "createTexture2D",
5191
- wrapS: (_texture_wrapS = texture.wrapS) != null ? _texture_wrapS : effects.glContext.REPEAT,
5192
- wrapT: (_texture_wrapT = texture.wrapT) != null ? _texture_wrapT : effects.glContext.REPEAT,
5193
- magFilter: (_texture_magFilter = texture.magFilter) != null ? _texture_magFilter : effects.glContext.LINEAR,
5210
+ wrapS: (_texture_wrapS = texture.wrapS) != null ? _texture_wrapS : EFFECTS.glContext.REPEAT,
5211
+ wrapT: (_texture_wrapT = texture.wrapT) != null ? _texture_wrapT : EFFECTS.glContext.REPEAT,
5212
+ magFilter: (_texture_magFilter = texture.magFilter) != null ? _texture_magFilter : EFFECTS.glContext.LINEAR,
5194
5213
  minFilter: minFilter,
5195
5214
  anisotropic: 1,
5196
5215
  //flipY: tex.flipY,
5197
5216
  premultiplyAlpha: premultiplyAlpha,
5198
- sourceType: effects.TextureSourceType.image,
5217
+ sourceType: EFFECTS.TextureSourceType.image,
5199
5218
  image: imageObj,
5200
5219
  generateMipmap: generateMipmap
5201
5220
  });
@@ -5361,9 +5380,9 @@ var normal = new Vector3();
5361
5380
  case 0:
5362
5381
  return [
5363
5382
  4,
5364
- effects.getDefaultTextureFactory().loadSource({
5365
- type: effects.TextureSourceType.image,
5366
- target: effects.glContext.TEXTURE_CUBE_MAP,
5383
+ EFFECTS.getDefaultTextureFactory().loadSource({
5384
+ type: EFFECTS.TextureSourceType.image,
5385
+ target: EFFECTS.glContext.TEXTURE_CUBE_MAP,
5367
5386
  map: cubeImage
5368
5387
  }, _this.cubemapTexConfig)
5369
5388
  ];
@@ -5371,7 +5390,7 @@ var normal = new Vector3();
5371
5390
  textureOptions = _state.sent();
5372
5391
  return [
5373
5392
  2,
5374
- effects.Texture.create(engine, textureOptions)
5393
+ EFFECTS.Texture.create(engine, textureOptions)
5375
5394
  ];
5376
5395
  }
5377
5396
  });
@@ -5391,9 +5410,9 @@ var normal = new Vector3();
5391
5410
  case 0:
5392
5411
  return [
5393
5412
  4,
5394
- effects.getDefaultTextureFactory().loadSource({
5395
- type: effects.TextureSourceType.mipmaps,
5396
- target: effects.glContext.TEXTURE_CUBE_MAP,
5413
+ EFFECTS.getDefaultTextureFactory().loadSource({
5414
+ type: EFFECTS.TextureSourceType.mipmaps,
5415
+ target: EFFECTS.glContext.TEXTURE_CUBE_MAP,
5397
5416
  maps: cubeImages
5398
5417
  }, _this.cubemapMipTexConfig)
5399
5418
  ];
@@ -5401,7 +5420,7 @@ var normal = new Vector3();
5401
5420
  textureOptions = _state.sent();
5402
5421
  return [
5403
5422
  2,
5404
- effects.Texture.create(engine, textureOptions)
5423
+ EFFECTS.Texture.create(engine, textureOptions)
5405
5424
  ];
5406
5425
  }
5407
5426
  });
@@ -5427,11 +5446,11 @@ var normal = new Vector3();
5427
5446
  cubemap = _state.sent();
5428
5447
  return [
5429
5448
  2,
5430
- effects.Texture.create(engine, _extends({
5449
+ EFFECTS.Texture.create(engine, _extends({
5431
5450
  name: "createTextureCubeFromBuffer",
5432
- sourceType: effects.TextureSourceType.image,
5451
+ sourceType: EFFECTS.TextureSourceType.image,
5433
5452
  cube: cubemap,
5434
- target: effects.glContext.TEXTURE_CUBE_MAP
5453
+ target: EFFECTS.glContext.TEXTURE_CUBE_MAP
5435
5454
  }, _this.cubemapTexConfig))
5436
5455
  ];
5437
5456
  }
@@ -5472,7 +5491,7 @@ var normal = new Vector3();
5472
5491
  url = "https://gw.alipayobjects.com/zos/gltf-asset/67896749597915/img" + index + ".png";
5473
5492
  return [
5474
5493
  4,
5475
- effects.loadImage(url)
5494
+ EFFECTS.loadImage(url)
5476
5495
  ];
5477
5496
  case 3:
5478
5497
  imageData = _state.sent();
@@ -5491,11 +5510,11 @@ var normal = new Vector3();
5491
5510
  case 4:
5492
5511
  return [
5493
5512
  2,
5494
- effects.Texture.create(engine, _extends({
5513
+ EFFECTS.Texture.create(engine, _extends({
5495
5514
  name: "createTextureCubeMipmapFromBuffer",
5496
- sourceType: effects.TextureSourceType.mipmaps,
5515
+ sourceType: EFFECTS.TextureSourceType.mipmaps,
5497
5516
  mipmaps: mipmaps,
5498
- target: effects.glContext.TEXTURE_CUBE_MAP
5517
+ target: EFFECTS.glContext.TEXTURE_CUBE_MAP
5499
5518
  }, _this.cubemapMipTexConfig))
5500
5519
  ];
5501
5520
  }
@@ -5523,14 +5542,14 @@ var normal = new Vector3();
5523
5542
  var options = {
5524
5543
  name: "createTextureFromImage",
5525
5544
  image: image,
5526
- sourceType: effects.TextureSourceType.image,
5545
+ sourceType: EFFECTS.TextureSourceType.image,
5527
5546
  flipY: false,
5528
- magFilter: effects.glContext.LINEAR,
5529
- minFilter: effects.glContext.LINEAR,
5530
- wrapT: effects.glContext.REPEAT,
5531
- wrapS: effects.glContext.REPEAT
5547
+ magFilter: EFFECTS.glContext.LINEAR,
5548
+ minFilter: EFFECTS.glContext.LINEAR,
5549
+ wrapT: EFFECTS.glContext.REPEAT,
5550
+ wrapS: EFFECTS.glContext.REPEAT
5532
5551
  };
5533
- return effects.Texture.create(engine, options);
5552
+ return EFFECTS.Texture.create(engine, options);
5534
5553
  };
5535
5554
  /**
5536
5555
  * 创建渲染 Pass
@@ -5541,10 +5560,10 @@ var normal = new Vector3();
5541
5560
  * @param fboOpts - FBO 参数
5542
5561
  * @returns
5543
5562
  */ WebGLHelper.createRenderPass = function createRenderPass(renderer, name, priority, meshData, fboOpts) {
5544
- var meshList = _instanceof1(meshData, effects.Mesh) ? [
5563
+ var meshList = _instanceof1(meshData, EFFECTS.Mesh) ? [
5545
5564
  meshData
5546
5565
  ] : meshData;
5547
- return new effects.RenderPass(renderer, {
5566
+ return new EFFECTS.RenderPass(renderer, {
5548
5567
  name: name,
5549
5568
  priority: priority,
5550
5569
  attachments: fboOpts.colorAttachments,
@@ -5558,8 +5577,8 @@ var normal = new Vector3();
5558
5577
  0,
5559
5578
  0
5560
5579
  ],
5561
- colorAction: effects.TextureLoadAction.clear,
5562
- depthAction: effects.TextureLoadAction.clear
5580
+ colorAction: EFFECTS.TextureLoadAction.clear,
5581
+ depthAction: EFFECTS.TextureLoadAction.clear
5563
5582
  },
5564
5583
  // storeAction: {
5565
5584
  // colorAction: TextureStoreAction.store,
@@ -5579,9 +5598,9 @@ var normal = new Vector3();
5579
5598
  * @param mesh - Mesh 对象
5580
5599
  */ WebGLHelper.deleteMesh = function deleteMesh(mesh) {
5581
5600
  mesh.dispose({
5582
- geometries: effects.DestroyOptions.destroy,
5601
+ geometries: EFFECTS.DestroyOptions.destroy,
5583
5602
  material: {
5584
- textures: effects.DestroyOptions.destroy
5603
+ textures: EFFECTS.DestroyOptions.destroy
5585
5604
  }
5586
5605
  });
5587
5606
  };
@@ -5597,14 +5616,14 @@ var normal = new Vector3();
5597
5616
  */ WebGLHelper.deleteRenderPass = function deleteRenderPass(pass) {
5598
5617
  pass.dispose({
5599
5618
  meshes: {
5600
- geometries: effects.DestroyOptions.destroy,
5619
+ geometries: EFFECTS.DestroyOptions.destroy,
5601
5620
  material: {
5602
- textures: effects.DestroyOptions.destroy
5621
+ textures: EFFECTS.DestroyOptions.destroy
5603
5622
  }
5604
5623
  },
5605
- depthStencilAttachment: effects.RenderPassDestroyAttachmentType.force,
5606
- colorAttachment: effects.RenderPassDestroyAttachmentType.force,
5607
- semantics: effects.DestroyOptions.destroy
5624
+ depthStencilAttachment: EFFECTS.RenderPassDestroyAttachmentType.force,
5625
+ colorAttachment: EFFECTS.RenderPassDestroyAttachmentType.force,
5626
+ semantics: EFFECTS.DestroyOptions.destroy
5608
5627
  });
5609
5628
  };
5610
5629
  /**
@@ -5642,18 +5661,18 @@ var normal = new Vector3();
5642
5661
  * 立方体纹理参数
5643
5662
  */ WebGLHelper.cubemapTexConfig = {
5644
5663
  name: "cubemap texture",
5645
- wrapS: effects.glContext.CLAMP_TO_EDGE,
5646
- wrapT: effects.glContext.CLAMP_TO_EDGE,
5647
- magFilter: effects.glContext.LINEAR,
5648
- minFilter: effects.glContext.LINEAR
5664
+ wrapS: EFFECTS.glContext.CLAMP_TO_EDGE,
5665
+ wrapT: EFFECTS.glContext.CLAMP_TO_EDGE,
5666
+ magFilter: EFFECTS.glContext.LINEAR,
5667
+ minFilter: EFFECTS.glContext.LINEAR
5649
5668
  };
5650
5669
  /**
5651
5670
  * 立方体纹理参数,带 Mipmap 滤波
5652
5671
  */ WebGLHelper.cubemapMipTexConfig = {
5653
- wrapS: effects.glContext.CLAMP_TO_EDGE,
5654
- wrapT: effects.glContext.CLAMP_TO_EDGE,
5655
- magFilter: effects.glContext.LINEAR,
5656
- minFilter: effects.glContext.LINEAR_MIPMAP_LINEAR
5672
+ wrapS: EFFECTS.glContext.CLAMP_TO_EDGE,
5673
+ wrapT: EFFECTS.glContext.CLAMP_TO_EDGE,
5674
+ magFilter: EFFECTS.glContext.LINEAR,
5675
+ minFilter: EFFECTS.glContext.LINEAR_MIPMAP_LINEAR
5657
5676
  };
5658
5677
  /**
5659
5678
  * Mesh 辅助类,负责 Mesh 相关的基础对象创建
@@ -5670,19 +5689,19 @@ var normal = new Vector3();
5670
5689
  var globalState = PGlobalState.getInstance();
5671
5690
  var vertexShader = material.vertexShaderCode;
5672
5691
  var fragmentShader = material.fragmentShaderCode;
5673
- var geometry = effects.Geometry.create(engine, MeshHelper.getPlaneGeometry());
5692
+ var geometry = EFFECTS.Geometry.create(engine, MeshHelper.getPlaneGeometry());
5674
5693
  var isWebGL2 = engine.gpuCapability.level === 2;
5675
- var effectsMaterial = effects.Material.create(engine, {
5694
+ var effectsMaterial = EFFECTS.Material.create(engine, {
5676
5695
  shader: {
5677
5696
  vertex: vertexShader,
5678
5697
  fragment: fragmentShader,
5679
5698
  shared: globalState.shaderShared,
5680
- glslVersion: isWebGL2 ? effects.GLSLVersion.GLSL3 : effects.GLSLVersion.GLSL1
5699
+ glslVersion: isWebGL2 ? EFFECTS.GLSLVersion.GLSL3 : EFFECTS.GLSLVersion.GLSL1
5681
5700
  },
5682
5701
  uniformSemantics: uniformSemantics
5683
5702
  });
5684
5703
  material.setMaterialStates(effectsMaterial);
5685
- return effects.Mesh.create(engine, {
5704
+ return EFFECTS.Mesh.create(engine, {
5686
5705
  name: name,
5687
5706
  worldMatrix: Matrix4.fromIdentity(),
5688
5707
  material: effectsMaterial,
@@ -5697,21 +5716,21 @@ var normal = new Vector3();
5697
5716
  return {
5698
5717
  attributes: {
5699
5718
  aPos: {
5700
- type: effects.glContext.FLOAT,
5719
+ type: EFFECTS.glContext.FLOAT,
5701
5720
  size: 3,
5702
5721
  data: data,
5703
5722
  stride: Float32Array.BYTES_PER_ELEMENT * 8,
5704
5723
  offset: 0
5705
5724
  },
5706
5725
  aUV: {
5707
- type: effects.glContext.FLOAT,
5726
+ type: EFFECTS.glContext.FLOAT,
5708
5727
  size: 2,
5709
5728
  stride: Float32Array.BYTES_PER_ELEMENT * 8,
5710
5729
  offset: Float32Array.BYTES_PER_ELEMENT * 3,
5711
5730
  dataSource: "aPos"
5712
5731
  },
5713
5732
  aNormal: {
5714
- type: effects.glContext.FLOAT,
5733
+ type: EFFECTS.glContext.FLOAT,
5715
5734
  size: 3,
5716
5735
  stride: Float32Array.BYTES_PER_ELEMENT * 8,
5717
5736
  offset: Float32Array.BYTES_PER_ELEMENT * 5,
@@ -5990,7 +6009,7 @@ var normal = new Vector3();
5990
6009
  rotationMat.transformPoint(deltaPos);
5991
6010
  var newCamPos = deltaPos.clone().add(targetPos);
5992
6011
  var viewMatrix = new Matrix4().lookAt(newCamPos, targetPos, new Vector3(0, 1, 0)).invert();
5993
- var effectsTransform = new effects.Transform();
6012
+ var effectsTransform = new EFFECTS.Transform();
5994
6013
  effectsTransform.setValid(true);
5995
6014
  effectsTransform.cloneFromMatrix(viewMatrix);
5996
6015
  return effectsTransform;
@@ -6004,7 +6023,7 @@ var normal = new Vector3();
6004
6023
  * @returns 场景信息描述
6005
6024
  */ PluginHelper.preprocessScene = function preprocessScene(scene, runtimeEnv, compatibleMode) {
6006
6025
  var _this = this;
6007
- var deviceEnv = runtimeEnv !== effects.PLAYER_OPTIONS_ENV_EDITOR;
6026
+ var deviceEnv = runtimeEnv !== EFFECTS.PLAYER_OPTIONS_ENV_EDITOR;
6008
6027
  var tiny3dMode = compatibleMode === "tiny3d";
6009
6028
  // 默认skybox如何处理需要讨论
6010
6029
  var jsonScene = scene.jsonScene;
@@ -6029,7 +6048,7 @@ var normal = new Vector3();
6029
6048
  _this.preprocessTextureOptions(dataMap, mat.textures["_EmissiveSampler"], false, tiny3dMode);
6030
6049
  });
6031
6050
  jsonScene.components.forEach(function(comp) {
6032
- if (comp.dataType === effects.spec.DataType.SkyboxComponent) {
6051
+ if (comp.dataType === EFFECTS.spec.DataType.SkyboxComponent) {
6033
6052
  loadSkybox = true;
6034
6053
  var skybox = comp;
6035
6054
  if (skybox.diffuseImage) {
@@ -6069,29 +6088,29 @@ var normal = new Vector3();
6069
6088
  if (!texOptions) {
6070
6089
  return;
6071
6090
  }
6072
- if (texOptions.target === undefined || texOptions.target === effects.glContext.TEXTURE_2D) {
6073
- texOptions.wrapS = effects.glContext.REPEAT;
6074
- texOptions.wrapT = effects.glContext.REPEAT;
6075
- texOptions.magFilter = effects.glContext.LINEAR;
6076
- texOptions.minFilter = effects.glContext.LINEAR_MIPMAP_LINEAR;
6091
+ if (texOptions.target === undefined || texOptions.target === EFFECTS.glContext.TEXTURE_2D) {
6092
+ texOptions.wrapS = EFFECTS.glContext.REPEAT;
6093
+ texOptions.wrapT = EFFECTS.glContext.REPEAT;
6094
+ texOptions.magFilter = EFFECTS.glContext.LINEAR;
6095
+ texOptions.minFilter = EFFECTS.glContext.LINEAR_MIPMAP_LINEAR;
6077
6096
  texOptions.generateMipmap = true;
6078
6097
  if (!isBaseColor) {
6079
6098
  texOptions.premultiplyAlpha = true;
6080
6099
  }
6081
- } else if (texOptions.target === effects.glContext.TEXTURE_CUBE_MAP) {
6082
- texOptions.wrapS = effects.glContext.CLAMP_TO_EDGE;
6083
- texOptions.wrapT = effects.glContext.CLAMP_TO_EDGE;
6100
+ } else if (texOptions.target === EFFECTS.glContext.TEXTURE_CUBE_MAP) {
6101
+ texOptions.wrapS = EFFECTS.glContext.CLAMP_TO_EDGE;
6102
+ texOptions.wrapT = EFFECTS.glContext.CLAMP_TO_EDGE;
6084
6103
  if (texOptions.mipmaps !== undefined) {
6085
6104
  if (texOptions.mipmaps.length === 1) {
6086
- texOptions.magFilter = effects.glContext.LINEAR;
6087
- texOptions.minFilter = effects.glContext.LINEAR;
6105
+ texOptions.magFilter = EFFECTS.glContext.LINEAR;
6106
+ texOptions.minFilter = EFFECTS.glContext.LINEAR;
6088
6107
  } else {
6089
- texOptions.magFilter = effects.glContext.LINEAR;
6090
- texOptions.minFilter = effects.glContext.LINEAR_MIPMAP_LINEAR;
6108
+ texOptions.magFilter = EFFECTS.glContext.LINEAR;
6109
+ texOptions.minFilter = EFFECTS.glContext.LINEAR_MIPMAP_LINEAR;
6091
6110
  }
6092
6111
  } else {
6093
- texOptions.magFilter = effects.glContext.LINEAR;
6094
- texOptions.minFilter = effects.glContext.LINEAR;
6112
+ texOptions.magFilter = EFFECTS.glContext.LINEAR;
6113
+ texOptions.minFilter = EFFECTS.glContext.LINEAR;
6095
6114
  }
6096
6115
  }
6097
6116
  };
@@ -6121,12 +6140,12 @@ var normal = new Vector3();
6121
6140
  sceneComp.items.forEach(function(data) {
6122
6141
  var itemId = data.id;
6123
6142
  var item = composition.getEngine().jsonSceneData[itemId];
6124
- if (item.type === effects.spec.ItemType.mesh) {
6143
+ if (item.type === EFFECTS.spec.ItemType.mesh) {
6125
6144
  var meshItem = item;
6126
6145
  var skin = meshItem.content.options.skin;
6127
6146
  var primitives = meshItem.content.options.primitives;
6128
6147
  primitives.forEach(function(prim, primId) {
6129
- if (_instanceof1(prim.geometry, effects.Geometry)) {
6148
+ if (_instanceof1(prim.geometry, EFFECTS.Geometry)) {
6130
6149
  // 可能已经创建,直接返回
6131
6150
  return;
6132
6151
  }
@@ -6135,7 +6154,7 @@ var normal = new Vector3();
6135
6154
  var studioPrim = prim;
6136
6155
  studioPrim.geometry = riGeometry;
6137
6156
  var material = prim.material;
6138
- if (material.type === effects.spec.MaterialType.pbr) {
6157
+ if (material.type === EFFECTS.spec.MaterialType.pbr) {
6139
6158
  var studioMat = studioPrim.material;
6140
6159
  studioMat.baseColorTexture = _this.getTextureObj(composition.textures, material.baseColorTexture);
6141
6160
  studioMat.metallicRoughnessTexture = _this.getTextureObj(composition.textures, material.metallicRoughnessTexture);
@@ -6153,10 +6172,10 @@ var normal = new Vector3();
6153
6172
  if (_instanceof1(inverseBindMatrices, Float32Array)) {
6154
6173
  studioSkin.inverseBindMatrices = inverseBindMatrices;
6155
6174
  } else {
6156
- console.error("setupItem3DOptions: Invalid inverseBindMatrices type, " + inverseBindMatrices);
6175
+ console.error("setupItem3DOptions: Invalid inverseBindMatrices type, " + inverseBindMatrices + ".");
6157
6176
  }
6158
6177
  }
6159
- } else if (item.type === effects.spec.ItemType.tree) {
6178
+ } else if (item.type === EFFECTS.spec.ItemType.tree) {
6160
6179
  var jsonItem = item;
6161
6180
  var studioItem = item;
6162
6181
  var jsonAnimations = jsonItem.content.options.tree.animations;
@@ -6171,24 +6190,24 @@ var normal = new Vector3();
6171
6190
  if (_instanceof1(inputArray, Float32Array)) {
6172
6191
  studioTrack.input = inputArray;
6173
6192
  } else {
6174
- console.error("setupItem3DOptions: Type of inputArray should be float32, " + inputArray);
6193
+ console.error("setupItem3DOptions: Type of inputArray should be float32, " + inputArray + ".");
6175
6194
  }
6176
6195
  if (_instanceof1(outputArray, Float32Array)) {
6177
6196
  studioTrack.output = outputArray;
6178
6197
  } else {
6179
- console.error("setupItem3DOptions: Type of outputArray should be float32, " + outputArray);
6198
+ console.error("setupItem3DOptions: Type of outputArray should be float32, " + outputArray + ".");
6180
6199
  }
6181
6200
  });
6182
6201
  });
6183
6202
  }
6184
- } else if (item.type === effects.spec.ItemType.skybox) {
6203
+ } else if (item.type === EFFECTS.spec.ItemType.skybox) {
6185
6204
  var skybox = item;
6186
6205
  var studioSkybox = item;
6187
6206
  var options = skybox.content.options;
6188
6207
  var studioOptions = studioSkybox.content.options;
6189
6208
  var specularImage = _this.getTextureObj(composition.textures, options.specularImage);
6190
6209
  if (specularImage === undefined) {
6191
- console.error("setupItem3DOptions: skybox specualrImage is undefined, " + CheckerHelper.stringify(options));
6210
+ console.error("setupItem3DOptions: skybox specualrImage is undefined, " + CheckerHelper.stringify(options) + ".");
6192
6211
  }
6193
6212
  studioOptions.specularImage = specularImage;
6194
6213
  //
@@ -6216,7 +6235,7 @@ var normal = new Vector3();
6216
6235
  attributes[name] = attribData;
6217
6236
  }
6218
6237
  geomOptions.attributes = attributes;
6219
- return effects.Geometry.create(engine, geomOptions);
6238
+ return EFFECTS.Geometry.create(engine, geomOptions);
6220
6239
  };
6221
6240
  /**
6222
6241
  * 索引数组类型转换
@@ -6232,7 +6251,7 @@ var normal = new Vector3();
6232
6251
  case WebGLRenderingContext["UNSIGNED_BYTE"]:
6233
6252
  return array;
6234
6253
  default:
6235
- console.error("Invalid index attribute type " + type);
6254
+ console.error("Invalid index attribute type " + type + ".");
6236
6255
  }
6237
6256
  };
6238
6257
  /**
@@ -6260,7 +6279,7 @@ var normal = new Vector3();
6260
6279
  // aPos, aNormal, aTangent,
6261
6280
  // aUV, aUV2, aJoints, aWeights
6262
6281
  // aTargetXXX
6263
- console.warn("Unknown attribute name: " + name);
6282
+ console.warn("Unknown attribute name: " + name + ".");
6264
6283
  }
6265
6284
  return name;
6266
6285
  };
@@ -6274,7 +6293,7 @@ var normal = new Vector3();
6274
6293
  return null;
6275
6294
  }
6276
6295
  if (index < 0 || index >= textures.length) {
6277
- console.error("Invalid index for textures: " + index + ", " + textures.length);
6296
+ console.error("Invalid index for textures: " + index + ", " + textures.length + ".");
6278
6297
  }
6279
6298
  return textures[index];
6280
6299
  };
@@ -6324,10 +6343,10 @@ var normal = new Vector3();
6324
6343
  var canvas = document.createElement("canvas");
6325
6344
  canvas.width = 512;
6326
6345
  canvas.height = 512;
6327
- return new effects.Player({
6346
+ return new EFFECTS.Player({
6328
6347
  canvas: canvas,
6329
6348
  renderFramework: "webgl2",
6330
- env: effects.PLAYER_OPTIONS_ENV_EDITOR,
6349
+ env: EFFECTS.PLAYER_OPTIONS_ENV_EDITOR,
6331
6350
  renderOptions: {
6332
6351
  willCaptureImage: true
6333
6352
  },
@@ -6359,7 +6378,7 @@ var normal = new Vector3();
6359
6378
  return __generator(this, function(_state) {
6360
6379
  return [
6361
6380
  2,
6362
- effects.loadImage(new Blob([
6381
+ EFFECTS.loadImage(new Blob([
6363
6382
  image.imageData
6364
6383
  ], {
6365
6384
  type: image.mimeType
@@ -6377,7 +6396,7 @@ var normal = new Vector3();
6377
6396
  return __generator(this, function(_state) {
6378
6397
  return [
6379
6398
  2,
6380
- effects.loadImage(new Blob([
6399
+ EFFECTS.loadImage(new Blob([
6381
6400
  image.data
6382
6401
  ], {
6383
6402
  type: image.mimeType
@@ -6400,7 +6419,7 @@ var normal = new Vector3();
6400
6419
  if (b) {
6401
6420
  resolve(b.arrayBuffer());
6402
6421
  } else {
6403
- reject(new Error("no canvas blob"));
6422
+ reject(new Error("No canvas blob."));
6404
6423
  }
6405
6424
  }, "image/png", 1);
6406
6425
  })
@@ -6562,7 +6581,7 @@ var AttributeArray = /*#__PURE__*/ function() {
6562
6581
  this.offset = (_inAttrib_offset = inAttrib.offset) != null ? _inAttrib_offset : 0;
6563
6582
  if (this.offset > 0) {
6564
6583
  if (this.offset % this.typeSize !== 0) {
6565
- console.error("Invalid offset " + this.offset + ", type size " + this.typeSize);
6584
+ console.error("Invalid offset " + this.offset + ", type size " + this.typeSize + ".");
6566
6585
  }
6567
6586
  this.offset = this.offset / this.typeSize;
6568
6587
  }
@@ -6571,7 +6590,7 @@ var AttributeArray = /*#__PURE__*/ function() {
6571
6590
  this.stride = (_inAttrib_stride = inAttrib.stride) != null ? _inAttrib_stride : 0;
6572
6591
  if (this.stride > 0) {
6573
6592
  if (this.stride % this.typeSize !== 0) {
6574
- console.error("Invalid stride " + this.stride + ", type size " + this.typeSize);
6593
+ console.error("Invalid stride " + this.stride + ", type size " + this.typeSize + ".");
6575
6594
  }
6576
6595
  this.stride = this.stride / this.typeSize;
6577
6596
  } else {
@@ -7082,9 +7101,9 @@ var AttributeArray = /*#__PURE__*/ function() {
7082
7101
  * @param v - 纹理对象
7083
7102
  * @returns
7084
7103
  */ CheckerHelper.checkTexture = function checkTexture(v) {
7085
- if (_instanceof1(v, effects.Texture)) {
7104
+ if (_instanceof1(v, EFFECTS.Texture)) {
7086
7105
  if (v.isDestroyed) {
7087
- console.error("Texture is destroyed, " + v.name);
7106
+ console.error("Texture is destroyed, " + v.name + ".");
7088
7107
  }
7089
7108
  return !v.isDestroyed;
7090
7109
  } else {
@@ -7132,14 +7151,14 @@ var AttributeArray = /*#__PURE__*/ function() {
7132
7151
  * @param v - 材质混合参数或未定义
7133
7152
  * @returns
7134
7153
  */ CheckerHelper.checkMatBlending = function checkMatBlending(v) {
7135
- return v === undefined || v === effects.spec.MaterialBlending.opaque || v === effects.spec.MaterialBlending.masked || v === effects.spec.MaterialBlending.translucent || v === effects.spec.MaterialBlending.additive;
7154
+ return v === undefined || v === EFFECTS.spec.MaterialBlending.opaque || v === EFFECTS.spec.MaterialBlending.masked || v === EFFECTS.spec.MaterialBlending.translucent || v === EFFECTS.spec.MaterialBlending.additive;
7136
7155
  };
7137
7156
  /**
7138
7157
  * 检查材质单双面模式或未定义
7139
7158
  * @param v - 材质单双面模式或未定义
7140
7159
  * @returns
7141
7160
  */ CheckerHelper.checkMatSide = function checkMatSide(v) {
7142
- return v === undefined || v === effects.spec.SideMode.BACK || v === effects.spec.SideMode.DOUBLE || v === effects.spec.SideMode.FRONT;
7161
+ return v === undefined || v === EFFECTS.spec.SideMode.BACK || v === EFFECTS.spec.SideMode.DOUBLE || v === EFFECTS.spec.SideMode.FRONT;
7143
7162
  };
7144
7163
  /**
7145
7164
  * 检查动画路径模式
@@ -7160,15 +7179,15 @@ var AttributeArray = /*#__PURE__*/ function() {
7160
7179
  * @param v - 几何体
7161
7180
  * @param s - 蒙皮参数
7162
7181
  */ CheckerHelper.assertGeometry = function assertGeometry(v, s) {
7163
- if (!_instanceof1(v, effects.Geometry)) {
7164
- console.error("Invalid geometry type " + this.stringify(v));
7182
+ if (!_instanceof1(v, EFFECTS.Geometry)) {
7183
+ console.error("Invalid geometry type " + this.stringify(v) + ".");
7165
7184
  }
7166
7185
  // @ts-expect-error
7167
7186
  if (v.isDestroyed === true) {
7168
- console.error("Geometry object is destroyed");
7187
+ console.error("Geometry object is destroyed.");
7169
7188
  }
7170
7189
  if (!this.checkNonnegative(v.getDrawStart())) {
7171
- console.error("Invalid geometry draw start: " + v.getDrawStart() + ", " + this.stringify(v));
7190
+ console.error("Invalid geometry draw start: " + v.getDrawStart() + ", " + this.stringify(v) + ".");
7172
7191
  }
7173
7192
  // // drawCount不再为负
7174
7193
  // if (!this.checkPositive(v.getDrawCount())) {
@@ -7227,7 +7246,7 @@ var AttributeArray = /*#__PURE__*/ function() {
7227
7246
  var attribArray = this.createAttributeArray(v, name);
7228
7247
  if (attribArray !== undefined) {
7229
7248
  if (attribArray.getLength() < drawCount) {
7230
- console.error(name + " Length(" + attribArray.getLength() + ") is less than draw count(" + drawCount + "), " + this.stringify(v));
7249
+ console.error(name + " Length(" + attribArray.getLength() + ") is less than draw count(" + drawCount + "), " + this.stringify(v) + ".");
7231
7250
  }
7232
7251
  }
7233
7252
  };
@@ -7260,24 +7279,24 @@ var AttributeArray = /*#__PURE__*/ function() {
7260
7279
  * @param v - 蒙皮参数
7261
7280
  */ CheckerHelper.assertModelSkinOptions = function assertModelSkinOptions(v) {
7262
7281
  if (!this.checkStringUndef(v.name)) {
7263
- console.error("Invalid skin name " + v.name + ", " + this.stringify(v));
7282
+ console.error("Invalid skin name " + v.name + ", " + this.stringify(v) + ".");
7264
7283
  }
7265
7284
  if (!this.checkNumberArray(v.joints)) {
7266
- console.error("Invalid skin joints " + v.joints + ", " + this.stringify(v));
7285
+ console.error("Invalid skin joints " + v.joints + ", " + this.stringify(v) + ".");
7267
7286
  }
7268
7287
  if (!this.checkNumberUndef(v.skeleton)) {
7269
- console.error("Invalid skin skeleton " + v.skeleton + ", " + this.stringify(v));
7288
+ console.error("Invalid skin skeleton " + v.skeleton + ", " + this.stringify(v) + ".");
7270
7289
  }
7271
7290
  if (!this.checkFloat32ArrayUndef(v.inverseBindMatrices)) {
7272
- console.error("Invalid skin inverseBindMatrices " + v.inverseBindMatrices + ", " + this.stringify(v));
7291
+ console.error("Invalid skin inverseBindMatrices " + v.inverseBindMatrices + ", " + this.stringify(v) + ".");
7273
7292
  }
7274
7293
  //
7275
7294
  if (v.inverseBindMatrices !== undefined) {
7276
7295
  if (v.inverseBindMatrices.length <= 0 || v.inverseBindMatrices.length % 16 !== 0) {
7277
- console.error("Invalid skin inverseBindMatrices length " + v.inverseBindMatrices + ", " + this.stringify(v));
7296
+ console.error("Invalid skin inverseBindMatrices length " + v.inverseBindMatrices + ", " + this.stringify(v) + ".");
7278
7297
  }
7279
7298
  if (v.joints.length * 16 !== v.inverseBindMatrices.length) {
7280
- console.error("Mismatch: skin joints and inverseBindMatrices length, " + v.joints + ", " + v.inverseBindMatrices + ", " + this.stringify(v));
7299
+ console.error("Mismatch: skin joints and inverseBindMatrices length, " + v.joints + ", " + v.inverseBindMatrices + ", " + this.stringify(v) + ".");
7281
7300
  }
7282
7301
  var mat = new Matrix4();
7283
7302
  for(var i = 0; i < v.inverseBindMatrices.length; i += 16){
@@ -7285,12 +7304,12 @@ var AttributeArray = /*#__PURE__*/ function() {
7285
7304
  mat.elements[j] = v.inverseBindMatrices[i + j];
7286
7305
  }
7287
7306
  if (Math.abs(mat.determinant()) < 1e-5) {
7288
- console.error("Determinant of inverseBindMatrices is too small " + mat.determinant() + ", index " + i / 16 + ", " + this.stringify(v));
7307
+ console.error("Determinant of inverseBindMatrices is too small " + mat.determinant() + ", index " + i / 16 + ", " + this.stringify(v) + ".");
7289
7308
  }
7290
7309
  }
7291
7310
  } else {
7292
7311
  if (v.joints.length <= 0) {
7293
- console.error("Invalid skin joints length " + v.joints + ", " + this.stringify(v));
7312
+ console.error("Invalid skin joints length " + v.joints + ", " + this.stringify(v) + ".");
7294
7313
  }
7295
7314
  }
7296
7315
  };
@@ -7298,140 +7317,140 @@ var AttributeArray = /*#__PURE__*/ function() {
7298
7317
  * 检查材质参数
7299
7318
  * @param v - 材质参数
7300
7319
  */ CheckerHelper.assertMatOptions = function assertMatOptions(v) {
7301
- if (v.type === effects.spec.MaterialType.unlit) {
7320
+ if (v.type === EFFECTS.spec.MaterialType.unlit) {
7302
7321
  if (!this.checkString(v.name)) {
7303
- console.error("Invalid material name " + v.name + ", " + this.stringify(v));
7322
+ console.error("Invalid material name " + v.name + ", " + this.stringify(v) + ".");
7304
7323
  }
7305
7324
  //
7306
7325
  if (!this.checkNonnegative4(v.baseColorFactor)) {
7307
- console.error("Invalid material baseColorFactor " + v.baseColorFactor + ", " + this.stringify(v));
7326
+ console.error("Invalid material baseColorFactor " + v.baseColorFactor + ", " + this.stringify(v) + ".");
7308
7327
  }
7309
7328
  if (!this.checkTextureUndef(v.baseColorTexture)) {
7310
- console.error("Invalid material baseColorTexture " + v.baseColorTexture + ", " + this.stringify(v));
7329
+ console.error("Invalid material baseColorTexture " + v.baseColorTexture + ", " + this.stringify(v) + ".");
7311
7330
  }
7312
7331
  if (!this.checkTexTransformUndef(v.baseColorTextureTransform)) {
7313
- console.error("Invalid material baseColorTextureTransform " + v.baseColorTextureTransform + ", " + this.stringify(v));
7332
+ console.error("Invalid material baseColorTextureTransform " + v.baseColorTextureTransform + ", " + this.stringify(v) + ".");
7314
7333
  }
7315
7334
  if (!this.checkTexCoord(v.baseColorTextureCoordinate)) {
7316
- console.error("Invalid material baseColorTextureCoordinate " + v.baseColorTextureCoordinate + ", " + this.stringify(v));
7335
+ console.error("Invalid material baseColorTextureCoordinate " + v.baseColorTextureCoordinate + ", " + this.stringify(v) + ".");
7317
7336
  }
7318
7337
  //
7319
7338
  if (!this.checkBooleanUndef(v.depthMask)) {
7320
- console.error("Invalid material depthMask " + v.depthMask + ", " + this.stringify(v));
7339
+ console.error("Invalid material depthMask " + v.depthMask + ", " + this.stringify(v) + ".");
7321
7340
  }
7322
7341
  if (!this.checkMatBlending(v.blending)) {
7323
- console.error("Invalid material blending " + v.blending + ", " + this.stringify(v));
7342
+ console.error("Invalid material blending " + v.blending + ", " + this.stringify(v) + ".");
7324
7343
  }
7325
7344
  if (!this.checkMatSide(v.side)) {
7326
- console.error("Invalid material side " + v.side + ", " + this.stringify(v));
7345
+ console.error("Invalid material side " + v.side + ", " + this.stringify(v) + ".");
7327
7346
  }
7328
- if (v.blending === effects.spec.MaterialBlending.masked) {
7347
+ if (v.blending === EFFECTS.spec.MaterialBlending.masked) {
7329
7348
  if (v.alphaCutOff === undefined) {
7330
- console.error("Material alphaCutOff is required for mask, " + this.stringify(v));
7349
+ console.error("Material alphaCutOff is required for mask, " + this.stringify(v) + ".");
7331
7350
  }
7332
7351
  }
7333
7352
  if (!this.checkNumber01Undef(v.alphaCutOff)) {
7334
- console.error("Invalid material alphaCutOff " + v.alphaCutOff + ", " + this.stringify(v));
7353
+ console.error("Invalid material alphaCutOff " + v.alphaCutOff + ", " + this.stringify(v) + ".");
7335
7354
  }
7336
- } else if (v.type === effects.spec.MaterialType.pbr) {
7355
+ } else if (v.type === EFFECTS.spec.MaterialType.pbr) {
7337
7356
  if (!this.checkString(v.name)) {
7338
- console.error("Invalid material name " + v.name + ", " + this.stringify(v));
7357
+ console.error("Invalid material name " + v.name + ", " + this.stringify(v) + ".");
7339
7358
  }
7340
7359
  //
7341
7360
  if (!this.checkNonnegative4(v.baseColorFactor)) {
7342
- console.error("Invalid material baseColorFactor " + v.baseColorFactor + ", " + this.stringify(v));
7361
+ console.error("Invalid material baseColorFactor " + v.baseColorFactor + ", " + this.stringify(v) + ".");
7343
7362
  }
7344
7363
  if (!this.checkTextureUndef(v.baseColorTexture)) {
7345
- console.error("Invalid material baseColorTexture " + v.baseColorTexture + ", " + this.stringify(v));
7364
+ console.error("Invalid material baseColorTexture " + v.baseColorTexture + ", " + this.stringify(v) + ".");
7346
7365
  }
7347
7366
  if (!this.checkTexTransformUndef(v.baseColorTextureTransform)) {
7348
- console.error("Invalid material baseColorTextureTransform " + v.baseColorTextureTransform + ", " + this.stringify(v));
7367
+ console.error("Invalid material baseColorTextureTransform " + v.baseColorTextureTransform + ", " + this.stringify(v) + ".");
7349
7368
  }
7350
7369
  if (!this.checkTexCoord(v.baseColorTextureCoordinate)) {
7351
- console.error("Invalid material baseColorTextureCoordinate " + v.baseColorTextureCoordinate + ", " + this.stringify(v));
7370
+ console.error("Invalid material baseColorTextureCoordinate " + v.baseColorTextureCoordinate + ", " + this.stringify(v) + ".");
7352
7371
  }
7353
7372
  //
7354
7373
  if (!this.checkBooleanUndef(v.useSpecularAA)) {
7355
- console.error("Invalid material useSpecularAA " + v.useSpecularAA + ", " + this.stringify(v));
7374
+ console.error("Invalid material useSpecularAA " + v.useSpecularAA + ", " + this.stringify(v) + ".");
7356
7375
  }
7357
7376
  if (!this.checkNumber01(v.metallicFactor)) {
7358
- console.error("Invalid material metallicFactor " + v.metallicFactor + ", " + this.stringify(v));
7377
+ console.error("Invalid material metallicFactor " + v.metallicFactor + ", " + this.stringify(v) + ".");
7359
7378
  }
7360
7379
  if (!this.checkNonnegative(v.roughnessFactor)) {
7361
- console.error("Invalid material roughnessFactor " + v.roughnessFactor + ", " + this.stringify(v));
7380
+ console.error("Invalid material roughnessFactor " + v.roughnessFactor + ", " + this.stringify(v) + ".");
7362
7381
  }
7363
7382
  if (!this.checkTextureUndef(v.metallicRoughnessTexture)) {
7364
- console.error("Invalid material metallicRoughnessTexture " + v.metallicRoughnessTexture + ", " + this.stringify(v));
7383
+ console.error("Invalid material metallicRoughnessTexture " + v.metallicRoughnessTexture + ", " + this.stringify(v) + ".");
7365
7384
  }
7366
7385
  if (!this.checkTexTransformUndef(v.metallicRoughnessTextureTransform)) {
7367
- console.error("Invalid material metallicRoughnessTextureTransform " + v.metallicRoughnessTextureTransform + ", " + this.stringify(v));
7386
+ console.error("Invalid material metallicRoughnessTextureTransform " + v.metallicRoughnessTextureTransform + ", " + this.stringify(v) + ".");
7368
7387
  }
7369
7388
  if (!this.checkTexCoord(v.metallicRoughnessTextureCoordinate)) {
7370
- console.error("Invalid material metallicRoughnessTextureCoordinate " + v.metallicRoughnessTextureCoordinate + ", " + this.stringify(v));
7389
+ console.error("Invalid material metallicRoughnessTextureCoordinate " + v.metallicRoughnessTextureCoordinate + ", " + this.stringify(v) + ".");
7371
7390
  }
7372
7391
  //
7373
7392
  if (!this.checkTextureUndef(v.normalTexture)) {
7374
- console.error("Invalid material normalTexture " + v.normalTexture + ", " + this.stringify(v));
7393
+ console.error("Invalid material normalTexture " + v.normalTexture + ", " + this.stringify(v) + ".");
7375
7394
  }
7376
7395
  if (!this.checkNonnegativeUndef(v.normalTextureScale)) {
7377
- console.error("Invalid material normalTextureScale " + v.normalTextureScale + ", " + this.stringify(v));
7396
+ console.error("Invalid material normalTextureScale " + v.normalTextureScale + ", " + this.stringify(v) + ".");
7378
7397
  }
7379
7398
  if (!this.checkTexTransformUndef(v.normalTextureTransform)) {
7380
- console.error("Invalid material normalTextureTransform " + v.normalTextureTransform + ", " + this.stringify(v));
7399
+ console.error("Invalid material normalTextureTransform " + v.normalTextureTransform + ", " + this.stringify(v) + ".");
7381
7400
  }
7382
7401
  if (!this.checkTexCoord(v.normalTextureCoordinate)) {
7383
- console.error("Invalid material normalTextureCoordinate " + v.normalTextureCoordinate + ", " + this.stringify(v));
7402
+ console.error("Invalid material normalTextureCoordinate " + v.normalTextureCoordinate + ", " + this.stringify(v) + ".");
7384
7403
  }
7385
7404
  //
7386
7405
  if (!this.checkTextureUndef(v.occlusionTexture)) {
7387
- console.error("Invalid material occlusionTexture " + v.occlusionTexture + ", " + this.stringify(v));
7406
+ console.error("Invalid material occlusionTexture " + v.occlusionTexture + ", " + this.stringify(v) + ".");
7388
7407
  }
7389
7408
  if (!this.checkNumber01Undef(v.occlusionTextureStrength)) {
7390
- console.error("Invalid material occlusionTextureStrength " + v.occlusionTextureStrength + ", " + this.stringify(v));
7409
+ console.error("Invalid material occlusionTextureStrength " + v.occlusionTextureStrength + ", " + this.stringify(v) + ".");
7391
7410
  }
7392
7411
  if (!this.checkTexTransformUndef(v.occlusionTextureTransform)) {
7393
- console.error("Invalid material occlusionTextureTransform " + v.occlusionTextureTransform + ", " + this.stringify(v));
7412
+ console.error("Invalid material occlusionTextureTransform " + v.occlusionTextureTransform + ", " + this.stringify(v) + ".");
7394
7413
  }
7395
7414
  if (!this.checkTexCoord(v.occlusionTextureCoordinate)) {
7396
- console.error("Invalid material occlusionTextureCoordinate " + v.occlusionTextureCoordinate + ", " + this.stringify(v));
7415
+ console.error("Invalid material occlusionTextureCoordinate " + v.occlusionTextureCoordinate + ", " + this.stringify(v) + ".");
7397
7416
  }
7398
7417
  //
7399
7418
  //
7400
7419
  if (!this.checkNonnegative4(v.emissiveFactor)) {
7401
- console.error("Invalid material emissiveFactor " + v.emissiveFactor + ", " + this.stringify(v));
7420
+ console.error("Invalid material emissiveFactor " + v.emissiveFactor + ", " + this.stringify(v) + ".");
7402
7421
  }
7403
7422
  if (!this.checkNonnegative(v.emissiveIntensity)) {
7404
- console.error("Invalid material emissiveIntensity " + v.emissiveIntensity + ", " + this.stringify(v));
7423
+ console.error("Invalid material emissiveIntensity " + v.emissiveIntensity + ", " + this.stringify(v) + ".");
7405
7424
  }
7406
7425
  if (!this.checkTextureUndef(v.emissiveTexture)) {
7407
- console.error("Invalid material emissiveTexture " + v.emissiveTexture + ", " + this.stringify(v));
7426
+ console.error("Invalid material emissiveTexture " + v.emissiveTexture + ", " + this.stringify(v) + ".");
7408
7427
  }
7409
7428
  if (!this.checkTexTransformUndef(v.emissiveTextureTransform)) {
7410
- console.error("Invalid material emissiveTextureTransform " + v.emissiveTextureTransform + ", " + this.stringify(v));
7429
+ console.error("Invalid material emissiveTextureTransform " + v.emissiveTextureTransform + ", " + this.stringify(v) + ".");
7411
7430
  }
7412
7431
  if (!this.checkTexCoord(v.emissiveTextureCoordinate)) {
7413
- console.error("Invalid material emissiveTextureCoordinate " + v.emissiveTextureCoordinate + ", " + this.stringify(v));
7432
+ console.error("Invalid material emissiveTextureCoordinate " + v.emissiveTextureCoordinate + ", " + this.stringify(v) + ".");
7414
7433
  }
7415
7434
  //
7416
7435
  if (!this.checkBooleanUndef(v.depthMask)) {
7417
- console.error("Invalid material depthMask " + v.depthMask + ", " + this.stringify(v));
7436
+ console.error("Invalid material depthMask " + v.depthMask + ", " + this.stringify(v) + ".");
7418
7437
  }
7419
7438
  if (!this.checkMatBlending(v.blending)) {
7420
- console.error("Invalid material blending " + v.blending + ", " + this.stringify(v));
7439
+ console.error("Invalid material blending " + v.blending + ", " + this.stringify(v) + ".");
7421
7440
  }
7422
7441
  if (!this.checkMatSide(v.side)) {
7423
- console.error("Invalid material side " + v.side + ", " + this.stringify(v));
7442
+ console.error("Invalid material side " + v.side + ", " + this.stringify(v) + ".");
7424
7443
  }
7425
- if (v.blending === effects.spec.MaterialBlending.masked) {
7444
+ if (v.blending === EFFECTS.spec.MaterialBlending.masked) {
7426
7445
  if (v.alphaCutOff === undefined) {
7427
- console.error("Material alphaCutOff is required for mask, " + this.stringify(v));
7446
+ console.error("Material alphaCutOff is required for mask, " + this.stringify(v) + ".");
7428
7447
  }
7429
7448
  }
7430
7449
  if (!this.checkNumber01Undef(v.alphaCutOff)) {
7431
- console.error("Invalid material alphaCutOff " + v.alphaCutOff + ", " + this.stringify(v));
7450
+ console.error("Invalid material alphaCutOff " + v.alphaCutOff + ", " + this.stringify(v) + ".");
7432
7451
  }
7433
7452
  } else {
7434
- console.error("Invalid material type " + this.stringify(v));
7453
+ console.error("Invalid material type " + this.stringify(v) + ".");
7435
7454
  }
7436
7455
  };
7437
7456
  /**
@@ -7449,7 +7468,7 @@ var AttributeArray = /*#__PURE__*/ function() {
7449
7468
  * @param v - Model 插件 Mesh 参数
7450
7469
  */ CheckerHelper.assertModelMeshOptions = function assertModelMeshOptions(v) {
7451
7470
  if (!this.checkParent(v.parent)) {
7452
- console.error("Invalid mesh parent " + v.parent + ", " + this.stringify(v));
7471
+ console.error("Invalid mesh parent " + v.parent + ", " + this.stringify(v) + ".");
7453
7472
  }
7454
7473
  if (v.skin !== undefined) {
7455
7474
  this.assertModelSkinOptions(v.skin);
@@ -7458,7 +7477,7 @@ var AttributeArray = /*#__PURE__*/ function() {
7458
7477
  for(var i = 0; i < v.primitives.length; i++){
7459
7478
  var prim = v.primitives[i];
7460
7479
  if (!this.assertPrimOptions(prim)) {
7461
- console.error("Invalid primitive " + prim + ", " + this.stringify(v));
7480
+ console.error("Invalid primitive " + prim + ", " + this.stringify(v) + ".");
7462
7481
  }
7463
7482
  var morph = new PMorph();
7464
7483
  morph.create(prim.geometry);
@@ -7468,11 +7487,11 @@ var AttributeArray = /*#__PURE__*/ function() {
7468
7487
  var morph0 = morphList[i1 - 1];
7469
7488
  var morph1 = morphList[i1];
7470
7489
  if (!morph0.equals(morph1)) {
7471
- console.error("Morph states mismatch: " + this.stringify(morph0) + ", " + this.stringify(morph1) + ", " + this.stringify(v));
7490
+ console.error("Morph states mismatch: " + this.stringify(morph0) + ", " + this.stringify(morph1) + ", " + this.stringify(v) + ".");
7472
7491
  }
7473
7492
  }
7474
7493
  if (!this.checkBooleanUndef(v.hide)) {
7475
- console.error("Invalid mesh hide " + v.hide + ", " + this.stringify(v));
7494
+ console.error("Invalid mesh hide " + v.hide + ", " + this.stringify(v) + ".");
7476
7495
  }
7477
7496
  };
7478
7497
  /**
@@ -7480,22 +7499,22 @@ var AttributeArray = /*#__PURE__*/ function() {
7480
7499
  * @param v - Model 插件相机参数
7481
7500
  */ CheckerHelper.assertModelCameraOptions = function assertModelCameraOptions(v) {
7482
7501
  if (!this.checkParent(v.parent)) {
7483
- console.error("Invalid camera parent " + v.parent + ", " + this.stringify(v));
7502
+ console.error("Invalid camera parent " + v.parent + ", " + this.stringify(v) + ".");
7484
7503
  }
7485
7504
  if (!this.checkNumberUndef(v.aspect)) {
7486
- console.error("Invalid camera aspect " + v.aspect + ", " + this.stringify(v));
7505
+ console.error("Invalid camera aspect " + v.aspect + ", " + this.stringify(v) + ".");
7487
7506
  }
7488
7507
  if (!this.checkPositive(v.near)) {
7489
- console.error("Invalid camera near " + v.near + ", " + this.stringify(v));
7508
+ console.error("Invalid camera near " + v.near + ", " + this.stringify(v) + ".");
7490
7509
  }
7491
7510
  if (!this.checkPositive(v.far) || v.far <= v.near) {
7492
- console.error("Invalid camera far " + v.far + ", " + this.stringify(v));
7511
+ console.error("Invalid camera far " + v.far + ", " + this.stringify(v) + ".");
7493
7512
  }
7494
7513
  if (!this.checkPositive(v.fov)) {
7495
- console.error("Invalid camera fov " + v.fov + ", " + this.stringify(v));
7514
+ console.error("Invalid camera fov " + v.fov + ", " + this.stringify(v) + ".");
7496
7515
  }
7497
7516
  if (!this.checkNumber01(v.clipMode)) {
7498
- console.error("Invalid camera clipMode " + v.clipMode + ", " + this.stringify(v));
7517
+ console.error("Invalid camera clipMode " + v.clipMode + ", " + this.stringify(v) + ".");
7499
7518
  }
7500
7519
  };
7501
7520
  /**
@@ -7504,58 +7523,58 @@ var AttributeArray = /*#__PURE__*/ function() {
7504
7523
  */ CheckerHelper.assertModelLightOptions = function assertModelLightOptions(v) {
7505
7524
  if (v.lightType === "directional") {
7506
7525
  if (!this.checkParent(v.parent)) {
7507
- console.error("Invalid light parent " + v.parent + ", " + this.stringify(v));
7526
+ console.error("Invalid light parent " + v.parent + ", " + this.stringify(v) + ".");
7508
7527
  }
7509
7528
  if (!this.checkNonnegative4(v.color)) {
7510
- console.error("Invalid light color " + v.color + ", " + this.stringify(v));
7529
+ console.error("Invalid light color " + v.color + ", " + this.stringify(v) + ".");
7511
7530
  }
7512
7531
  if (!this.checkNonnegative(v.intensity)) {
7513
- console.error("Invalid light intensity " + v.intensity + ", " + this.stringify(v));
7532
+ console.error("Invalid light intensity " + v.intensity + ", " + this.stringify(v) + ".");
7514
7533
  }
7515
7534
  } else if (v.lightType === "point") {
7516
7535
  if (!this.checkParent(v.parent)) {
7517
- console.error("Invalid light parent " + v.parent + ", " + this.stringify(v));
7536
+ console.error("Invalid light parent " + v.parent + ", " + this.stringify(v) + ".");
7518
7537
  }
7519
7538
  if (!this.checkNonnegative4(v.color)) {
7520
- console.error("Invalid light color " + v.color + ", " + this.stringify(v));
7539
+ console.error("Invalid light color " + v.color + ", " + this.stringify(v) + ".");
7521
7540
  }
7522
7541
  if (!this.checkNonnegative(v.intensity)) {
7523
- console.error("Invalid light intensity " + v.intensity + ", " + this.stringify(v));
7542
+ console.error("Invalid light intensity " + v.intensity + ", " + this.stringify(v) + ".");
7524
7543
  }
7525
7544
  if (!this.checkNonnegative(v.range)) {
7526
- console.error("Invalid light range " + v.range + ", " + this.stringify(v));
7545
+ console.error("Invalid light range " + v.range + ", " + this.stringify(v) + ".");
7527
7546
  }
7528
7547
  } else if (v.lightType === "spot") {
7529
7548
  if (!this.checkParent(v.parent)) {
7530
- console.error("Invalid light parent " + v.parent + ", " + this.stringify(v));
7549
+ console.error("Invalid light parent " + v.parent + ", " + this.stringify(v) + ".");
7531
7550
  }
7532
7551
  if (!this.checkNonnegative4(v.color)) {
7533
- console.error("Invalid light color " + v.color + ", " + this.stringify(v));
7552
+ console.error("Invalid light color " + v.color + ", " + this.stringify(v) + ".");
7534
7553
  }
7535
7554
  if (!this.checkNonnegative(v.intensity)) {
7536
- console.error("Invalid light intensity " + v.intensity + ", " + this.stringify(v));
7555
+ console.error("Invalid light intensity " + v.intensity + ", " + this.stringify(v) + ".");
7537
7556
  }
7538
7557
  if (!this.checkNonnegative(v.range)) {
7539
- console.error("Invalid light range " + v.range + ", " + this.stringify(v));
7558
+ console.error("Invalid light range " + v.range + ", " + this.stringify(v) + ".");
7540
7559
  }
7541
7560
  if (!this.checkNonnegative(v.innerConeAngle)) {
7542
- console.error("Invalid light innerConeAngle " + v.innerConeAngle + ", " + this.stringify(v));
7561
+ console.error("Invalid light innerConeAngle " + v.innerConeAngle + ", " + this.stringify(v) + ".");
7543
7562
  }
7544
7563
  if (!this.checkNonnegative(v.outerConeAngle)) {
7545
- console.error("Invalid light outerConeAngle " + v.outerConeAngle + ", " + this.stringify(v));
7564
+ console.error("Invalid light outerConeAngle " + v.outerConeAngle + ", " + this.stringify(v) + ".");
7546
7565
  }
7547
7566
  } else if (v.lightType === "ambient") {
7548
7567
  if (!this.checkParent(v.parent)) {
7549
- console.error("Invalid light parent " + v.parent + ", " + this.stringify(v));
7568
+ console.error("Invalid light parent " + v.parent + ", " + this.stringify(v) + ".");
7550
7569
  }
7551
7570
  if (!this.checkNonnegative4(v.color)) {
7552
- console.error("Invalid light color " + v.color + ", " + this.stringify(v));
7571
+ console.error("Invalid light color " + v.color + ", " + this.stringify(v) + ".");
7553
7572
  }
7554
7573
  if (!this.checkNonnegative(v.intensity)) {
7555
- console.error("Invalid light intensity " + v.intensity + ", " + this.stringify(v));
7574
+ console.error("Invalid light intensity " + v.intensity + ", " + this.stringify(v) + ".");
7556
7575
  }
7557
7576
  } else {
7558
- console.error("Invalid light type " + this.stringify(v));
7577
+ console.error("Invalid light type " + this.stringify(v) + ".");
7559
7578
  }
7560
7579
  };
7561
7580
  /**
@@ -7564,43 +7583,43 @@ var AttributeArray = /*#__PURE__*/ function() {
7564
7583
  */ CheckerHelper.assertModelSkyboxOptions = function assertModelSkyboxOptions(v) {
7565
7584
  var _this = this;
7566
7585
  if (!this.checkBoolean(v.renderable)) {
7567
- console.error("Invalid skybox renderable " + v.renderable + ", " + this.stringify(v));
7586
+ console.error("Invalid skybox renderable " + v.renderable + ", " + this.stringify(v) + ".");
7568
7587
  }
7569
7588
  if (!this.checkNonnegative(v.intensity)) {
7570
- console.error("Invalid skybox intensity " + v.intensity + ", " + this.stringify(v));
7589
+ console.error("Invalid skybox intensity " + v.intensity + ", " + this.stringify(v) + ".");
7571
7590
  }
7572
7591
  if (!this.checkNonnegative(v.reflectionsIntensity)) {
7573
- console.error("Invalid skybox reflectionsIntensity " + v.reflectionsIntensity + ", " + this.stringify(v));
7592
+ console.error("Invalid skybox reflectionsIntensity " + v.reflectionsIntensity + ", " + this.stringify(v) + ".");
7574
7593
  }
7575
7594
  //
7576
7595
  var c = v.irradianceCoeffs;
7577
7596
  if (c !== undefined) {
7578
7597
  if (!Array.isArray(c) || c.length != 9) {
7579
- console.error("Invalid skybox irradianceCoeffs " + c + ", " + this.stringify(v));
7598
+ console.error("Invalid skybox irradianceCoeffs " + c + ", " + this.stringify(v) + ".");
7580
7599
  }
7581
7600
  c.forEach(function(v) {
7582
7601
  if (!_this.checkVec3(v)) {
7583
- console.error("Invalid skybox irradianceCoeffs " + c + ", " + _this.stringify(v));
7602
+ console.error("Invalid skybox irradianceCoeffs " + c + ", " + _this.stringify(v) + ".");
7584
7603
  }
7585
7604
  });
7586
7605
  } else if (v.diffuseImage !== undefined) {
7587
7606
  if (!this.checkTexture(v.diffuseImage)) {
7588
- console.error("Invalid skybox diffuseImage " + v.diffuseImage + ", " + this.stringify(v));
7607
+ console.error("Invalid skybox diffuseImage " + v.diffuseImage + ", " + this.stringify(v) + ".");
7589
7608
  }
7590
7609
  } else {
7591
- console.error("Invalid skybox, irradianceCoeffs or diffuseImage should give one, " + this.stringify(v));
7610
+ console.error("Invalid skybox, irradianceCoeffs or diffuseImage should give one, " + this.stringify(v) + ".");
7592
7611
  }
7593
7612
  if (!this.checkTexture(v.specularImage)) {
7594
- console.error("Invalid skybox specularImage " + v.specularImage + ", " + this.stringify(v));
7613
+ console.error("Invalid skybox specularImage " + v.specularImage + ", " + this.stringify(v) + ".");
7595
7614
  }
7596
7615
  if (!this.checkPositive(v.specularImageSize)) {
7597
- console.error("Invalid skybox specularImageSize " + v.specularImageSize + ", " + this.stringify(v));
7616
+ console.error("Invalid skybox specularImageSize " + v.specularImageSize + ", " + this.stringify(v) + ".");
7598
7617
  }
7599
7618
  if (!this.checkPositive(v.specularMipCount)) {
7600
- console.error("Invalid skybox specularMipCount " + v.specularMipCount + ", " + this.stringify(v));
7619
+ console.error("Invalid skybox specularMipCount " + v.specularMipCount + ", " + this.stringify(v) + ".");
7601
7620
  }
7602
7621
  if (this.pow2(v.specularMipCount) > v.specularImageSize) {
7603
- console.error("Invalid skybox specularMipCount or specularImageSize, " + this.stringify(v));
7622
+ console.error("Invalid skybox specularMipCount or specularImageSize, " + this.stringify(v) + ".");
7604
7623
  }
7605
7624
  };
7606
7625
  /**
@@ -7636,14 +7655,14 @@ var AttributeArray = /*#__PURE__*/ function() {
7636
7655
  */ CheckerHelper.assertModelAnimOptions = function assertModelAnimOptions(v) {
7637
7656
  var _this = this;
7638
7657
  if (!this.checkStringUndef(v.name)) {
7639
- console.error("Invalid animation name " + v.name + ", " + this.stringify(v));
7658
+ console.error("Invalid animation name " + v.name + ", " + this.stringify(v) + ".");
7640
7659
  }
7641
7660
  if (!Array.isArray(v.tracks)) {
7642
- console.error("Invalid animation tracks " + v.tracks + ", " + this.stringify(v));
7661
+ console.error("Invalid animation tracks " + v.tracks + ", " + this.stringify(v) + ".");
7643
7662
  }
7644
7663
  v.tracks.forEach(function(t) {
7645
7664
  if (!_this.checkModelAnimTrackOptions(t)) {
7646
- console.error("Invalid animation track " + t + ", " + _this.stringify(v));
7665
+ console.error("Invalid animation track " + t + ", " + _this.stringify(v) + ".");
7647
7666
  }
7648
7667
  });
7649
7668
  };
@@ -7653,18 +7672,18 @@ var AttributeArray = /*#__PURE__*/ function() {
7653
7672
  */ CheckerHelper.assertTreeOptions = function assertTreeOptions(v) {
7654
7673
  var _this = this;
7655
7674
  if (!this.checkNumberUndef(v.animation)) {
7656
- console.error("Invalid tree animation " + v.animation + ", " + this.stringify(v));
7675
+ console.error("Invalid tree animation " + v.animation + ", " + this.stringify(v) + ".");
7657
7676
  }
7658
7677
  if (v.animations !== undefined) {
7659
7678
  if (!Array.isArray(v.animations)) {
7660
- console.error("Invalid tree animations " + v.animations + ", " + this.stringify(v));
7679
+ console.error("Invalid tree animations " + v.animations + ", " + this.stringify(v) + ".");
7661
7680
  }
7662
7681
  v.animations.forEach(function(anim) {
7663
7682
  _this.assertModelAnimOptions(anim);
7664
7683
  });
7665
7684
  if (v.animation !== undefined) {
7666
7685
  if (v.animation < -1 || v.animation >= v.animations.length) {
7667
- console.error("Invalid tree animations " + v.animations + ", " + this.stringify(v));
7686
+ console.error("Invalid tree animations " + v.animations + ", " + this.stringify(v) + ".");
7668
7687
  }
7669
7688
  }
7670
7689
  }
@@ -7685,15 +7704,15 @@ var AttributeArray = /*#__PURE__*/ function() {
7685
7704
  if (typeof object[prop] == "function") {
7686
7705
  continue;
7687
7706
  }
7688
- if (_instanceof1(object[prop], effects.Texture)) {
7707
+ if (_instanceof1(object[prop], EFFECTS.Texture)) {
7689
7708
  simpleObject[prop] = object[prop].name;
7690
7709
  continue;
7691
7710
  }
7692
- if (_instanceof1(object[prop], effects.Geometry)) {
7711
+ if (_instanceof1(object[prop], EFFECTS.Geometry)) {
7693
7712
  simpleObject[prop] = object[prop].name;
7694
7713
  continue;
7695
7714
  }
7696
- if (_instanceof1(object[prop], effects.Renderer)) {
7715
+ if (_instanceof1(object[prop], EFFECTS.Renderer)) {
7697
7716
  continue;
7698
7717
  }
7699
7718
  simpleObject[prop] = object[prop];
@@ -7861,7 +7880,7 @@ exports.CullMode = void 0;
7861
7880
  */ _proto.updateUniforms = function updateUniforms(material) {
7862
7881
  // 渲染 UV 结果输出时,设置 uv 大小
7863
7882
  var renderMode = PGlobalState.getInstance().renderMode3D;
7864
- if (renderMode === effects.spec.RenderMode3D.uv) {
7883
+ if (renderMode === EFFECTS.spec.RenderMode3D.uv) {
7865
7884
  var debugUVGridSize = PGlobalState.getInstance().renderMode3DUVGridSize;
7866
7885
  material.setFloat("_DebugUVGridSize", debugUVGridSize);
7867
7886
  }
@@ -7936,14 +7955,14 @@ exports.CullMode = void 0;
7936
7955
  material.depthTest = this.ZTest;
7937
7956
  material.depthMask = this.ZWrite;
7938
7957
  material.blendEquation = [
7939
- effects.glContext.FUNC_ADD,
7940
- effects.glContext.FUNC_ADD
7958
+ EFFECTS.glContext.FUNC_ADD,
7959
+ EFFECTS.glContext.FUNC_ADD
7941
7960
  ];
7942
7961
  material.blendFunction = [
7943
- effects.glContext.ONE,
7944
- effects.glContext.ONE_MINUS_SRC_ALPHA,
7945
- effects.glContext.ONE,
7946
- effects.glContext.ONE_MINUS_SRC_ALPHA
7962
+ EFFECTS.glContext.ONE,
7963
+ EFFECTS.glContext.ONE_MINUS_SRC_ALPHA,
7964
+ EFFECTS.glContext.ONE,
7965
+ EFFECTS.glContext.ONE_MINUS_SRC_ALPHA
7947
7966
  ];
7948
7967
  } else {
7949
7968
  if (PGlobalState.getInstance().isTiny3dMode) {
@@ -7963,12 +7982,12 @@ exports.CullMode = void 0;
7963
7982
  if (this.isDoubleSide()) {
7964
7983
  material.culling = false;
7965
7984
  } else if (this.isBackSide()) {
7966
- material.cullFace = effects.glContext.FRONT;
7967
- material.frontFace = effects.glContext.CCW;
7985
+ material.cullFace = EFFECTS.glContext.FRONT;
7986
+ material.frontFace = EFFECTS.glContext.CCW;
7968
7987
  material.culling = true;
7969
7988
  } else {
7970
- material.cullFace = effects.glContext.BACK;
7971
- material.frontFace = effects.glContext.CCW;
7989
+ material.cullFace = EFFECTS.glContext.BACK;
7990
+ material.frontFace = EFFECTS.glContext.CCW;
7972
7991
  material.culling = true;
7973
7992
  }
7974
7993
  };
@@ -8789,7 +8808,7 @@ exports.CullMode = void 0;
8789
8808
  } else {
8790
8809
  var coeffs = this.irradianceCoeffs;
8791
8810
  if (coeffs === undefined || coeffs.length != 9) {
8792
- throw new Error("Invalid skybox irradiance coeffs " + coeffs);
8811
+ throw new Error("Invalid skybox irradiance coeffs " + coeffs + ".");
8793
8812
  }
8794
8813
  var aliasName = [
8795
8814
  "l00",
@@ -8845,18 +8864,18 @@ exports.PSkyboxType = void 0;
8845
8864
  ];
8846
8865
  return [
8847
8866
  4,
8848
- effects.loadImage(imageList[i])
8867
+ EFFECTS.loadImage(imageList[i])
8849
8868
  ];
8850
8869
  case 2:
8851
8870
  image = _state.sent();
8852
8871
  if (i > 0) {
8853
8872
  if (i % 6 === 0) {
8854
8873
  if (image.width * 2 !== lastImage.width || image.height * 2 !== lastImage.height) {
8855
- throw new Error("Invalid cube map list1: index " + i + ", image0 " + lastImage + ", image1 " + image);
8874
+ throw new Error("Invalid cube map list1: index " + i + ", image0 " + lastImage + ", image1 " + image + ".");
8856
8875
  }
8857
8876
  } else {
8858
8877
  if (image.width !== lastImage.width || image.height !== lastImage.height) {
8859
- throw new Error("Invalid cube map list2: index " + i + ", image0 " + lastImage + ", image1 " + image);
8878
+ throw new Error("Invalid cube map list2: index " + i + ", image0 " + lastImage + ", image1 " + image + ".");
8860
8879
  }
8861
8880
  }
8862
8881
  }
@@ -8893,18 +8912,18 @@ exports.PSkyboxType = void 0;
8893
8912
  brdfURL = "https://gw.alipayobjects.com/zos/gltf-asset/61420044606400/lut-ggx.png";
8894
8913
  return [
8895
8914
  4,
8896
- effects.loadImage(brdfURL)
8915
+ EFFECTS.loadImage(brdfURL)
8897
8916
  ];
8898
8917
  case 1:
8899
8918
  brdfLutImage = _state.sent();
8900
8919
  brdfLutOpts = {
8901
8920
  name: "brdfLut",
8902
- wrapS: effects.glContext.CLAMP_TO_EDGE,
8903
- wrapT: effects.glContext.CLAMP_TO_EDGE,
8904
- magFilter: effects.glContext.LINEAR,
8905
- minFilter: effects.glContext.LINEAR,
8921
+ wrapS: EFFECTS.glContext.CLAMP_TO_EDGE,
8922
+ wrapT: EFFECTS.glContext.CLAMP_TO_EDGE,
8923
+ magFilter: EFFECTS.glContext.LINEAR,
8924
+ minFilter: EFFECTS.glContext.LINEAR,
8906
8925
  anisotropic: 1,
8907
- sourceType: effects.TextureSourceType.image,
8926
+ sourceType: EFFECTS.TextureSourceType.image,
8908
8927
  image: brdfLutImage,
8909
8928
  generateMipmap: false,
8910
8929
  flipY: false,
@@ -8935,7 +8954,7 @@ exports.PSkyboxType = void 0;
8935
8954
  ];
8936
8955
  case 1:
8937
8956
  brdfLutOpts = _state.sent();
8938
- brdfLutTexture = effects.Texture.create(engine, brdfLutOpts);
8957
+ brdfLutTexture = EFFECTS.Texture.create(engine, brdfLutOpts);
8939
8958
  return [
8940
8959
  2,
8941
8960
  brdfLutTexture
@@ -9015,10 +9034,10 @@ exports.PSkyboxType = void 0;
9015
9034
  id: specularCubeData.textureOptions.id
9016
9035
  };
9017
9036
  var componentData = {
9018
- id: effects.generateGUID(),
9019
- dataType: effects.spec.DataType.SkyboxComponent,
9037
+ id: EFFECTS.generateGUID(),
9038
+ dataType: EFFECTS.spec.DataType.SkyboxComponent,
9020
9039
  item: {
9021
- id: effects.generateGUID()
9040
+ id: EFFECTS.generateGUID()
9022
9041
  },
9023
9042
  renderable: renderable,
9024
9043
  intensity: intensity,
@@ -9071,7 +9090,7 @@ exports.PSkyboxType = void 0;
9071
9090
  params.specularImage.forEach(function(cubemap) {
9072
9091
  var mipmap = [];
9073
9092
  cubemap.forEach(function(image) {
9074
- var imageId = effects.generateGUID();
9093
+ var imageId = EFFECTS.generateGUID();
9075
9094
  imageDatas.push({
9076
9095
  id: imageId,
9077
9096
  // @ts-expect-error
@@ -9084,10 +9103,10 @@ exports.PSkyboxType = void 0;
9084
9103
  mipmaps.push(mipmap);
9085
9104
  });
9086
9105
  var textureOptions = _extends({
9087
- id: effects.generateGUID(),
9088
- dataType: effects.spec.DataType.Texture,
9089
- sourceType: effects.TextureSourceType.mipmaps,
9090
- target: effects.glContext.TEXTURE_CUBE_MAP,
9106
+ id: EFFECTS.generateGUID(),
9107
+ dataType: EFFECTS.spec.DataType.Texture,
9108
+ sourceType: EFFECTS.TextureSourceType.mipmaps,
9109
+ target: EFFECTS.glContext.TEXTURE_CUBE_MAP,
9091
9110
  // @ts-expect-error
9092
9111
  mipmaps: mipmaps
9093
9112
  }, WebGLHelper.cubemapMipTexConfig);
@@ -9131,7 +9150,7 @@ exports.PSkyboxType = void 0;
9131
9150
  var imageDatas = [];
9132
9151
  var cubemap = [];
9133
9152
  params.diffuseImage.forEach(function(image) {
9134
- var imageId = effects.generateGUID();
9153
+ var imageId = EFFECTS.generateGUID();
9135
9154
  imageDatas.push({
9136
9155
  id: imageId,
9137
9156
  // @ts-expect-error
@@ -9142,10 +9161,10 @@ exports.PSkyboxType = void 0;
9142
9161
  });
9143
9162
  });
9144
9163
  var textureOptions = _extends({
9145
- id: effects.generateGUID(),
9146
- dataType: effects.spec.DataType.Texture,
9147
- sourceType: effects.TextureSourceType.mipmaps,
9148
- target: effects.glContext.TEXTURE_CUBE_MAP,
9164
+ id: EFFECTS.generateGUID(),
9165
+ dataType: EFFECTS.spec.DataType.Texture,
9166
+ sourceType: EFFECTS.TextureSourceType.mipmaps,
9167
+ target: EFFECTS.glContext.TEXTURE_CUBE_MAP,
9149
9168
  // @ts-expect-error
9150
9169
  mipmaps: [
9151
9170
  cubemap
@@ -9390,11 +9409,11 @@ exports.PSkyboxType = void 0;
9390
9409
  this.loadSkybox = loadSkybox;
9391
9410
  if (this.brdfLutTexture === undefined || this.brdfLutTexture.isDestroyed) {
9392
9411
  if (CompositionCache.brdfLutTexOptions === undefined) {
9393
- throw new Error("Please load brdfLutTexOptions at first");
9412
+ throw new Error("Please load brdfLutTexOptions at first.");
9394
9413
  }
9395
9414
  //
9396
9415
  var brdfLutTextureName = "brdfLutTexture";
9397
- this.brdfLutTexture = effects.Texture.create(this.engine, CompositionCache.brdfLutTexOptions);
9416
+ this.brdfLutTexture = EFFECTS.Texture.create(this.engine, CompositionCache.brdfLutTexOptions);
9398
9417
  this.deleteTexture(brdfLutTextureName);
9399
9418
  this.setTexture(brdfLutTextureName, this.brdfLutTexture);
9400
9419
  }
@@ -9423,7 +9442,7 @@ exports.PSkyboxType = void 0;
9423
9442
  if (tex !== undefined) {
9424
9443
  return tex;
9425
9444
  }
9426
- var newTex = effects.Texture.create(this.engine, options);
9445
+ var newTex = EFFECTS.Texture.create(this.engine, options);
9427
9446
  this.textureCache.set(name, newTex);
9428
9447
  return newTex;
9429
9448
  };
@@ -9638,9 +9657,9 @@ exports.PSkyboxType = void 0;
9638
9657
  id: "ModelPluginItem",
9639
9658
  name: "ModelPluginItem",
9640
9659
  duration: 9999999,
9641
- endBehavior: effects.spec.END_BEHAVIOR_FORWARD
9660
+ endBehavior: EFFECTS.spec.END_BEHAVIOR_FORWARD
9642
9661
  };
9643
- var item = new effects.VFXItem(composition.getEngine(), props);
9662
+ var item = new EFFECTS.VFXItem(composition.getEngine(), props);
9644
9663
  composition.addItem(item);
9645
9664
  //
9646
9665
  var comp = item.addComponent(exports.ModelPluginComponent);
@@ -9710,33 +9729,33 @@ exports.PSkyboxType = void 0;
9710
9729
  var pbrShaderData = {
9711
9730
  id: PBRShaderGUID,
9712
9731
  name: "PBR Shader",
9713
- dataType: effects.spec.DataType.Shader,
9732
+ dataType: EFFECTS.spec.DataType.Shader,
9714
9733
  fragment: pbrShaderCode.fragmentShaderCode,
9715
9734
  vertex: pbrShaderCode.vertexShaderCode,
9716
9735
  // @ts-expect-error
9717
- glslVersion: isWebGL2 ? effects.GLSLVersion.GLSL3 : effects.GLSLVersion.GLSL1
9736
+ glslVersion: isWebGL2 ? EFFECTS.GLSLVersion.GLSL3 : EFFECTS.GLSLVersion.GLSL1
9718
9737
  };
9719
9738
  var unlitShaderData = {
9720
9739
  id: UnlitShaderGUID,
9721
9740
  name: "Unlit Shader",
9722
- dataType: effects.spec.DataType.Shader,
9741
+ dataType: EFFECTS.spec.DataType.Shader,
9723
9742
  fragment: unlitShaderCode.fragmentShaderCode,
9724
9743
  vertex: unlitShaderCode.vertexShaderCode,
9725
9744
  // @ts-expect-error
9726
- glslVersion: isWebGL2 ? effects.GLSLVersion.GLSL3 : effects.GLSLVersion.GLSL1
9745
+ glslVersion: isWebGL2 ? EFFECTS.GLSLVersion.GLSL3 : EFFECTS.GLSLVersion.GLSL1
9727
9746
  };
9728
9747
  renderer.engine.addEffectsObjectData(pbrShaderData);
9729
9748
  renderer.engine.addEffectsObjectData(unlitShaderData);
9730
9749
  return Promise.resolve();
9731
9750
  };
9732
9751
  return ModelPlugin;
9733
- }(effects.AbstractPlugin);
9752
+ }(EFFECTS.AbstractPlugin);
9734
9753
  exports.ModelPluginComponent = /*#__PURE__*/ function(ItemBehaviour) {
9735
9754
  _inherits(ModelPluginComponent, ItemBehaviour);
9736
9755
  function ModelPluginComponent(engine, options) {
9737
9756
  var _this;
9738
9757
  _this = ItemBehaviour.call(this, engine) || this;
9739
- _this.runtimeEnv = effects.PLAYER_OPTIONS_ENV_EDITOR;
9758
+ _this.runtimeEnv = EFFECTS.PLAYER_OPTIONS_ENV_EDITOR;
9740
9759
  _this.compatibleMode = "gltf";
9741
9760
  _this.renderSkybox = true;
9742
9761
  _this.visBoundingBox = false;
@@ -9748,7 +9767,7 @@ exports.ModelPluginComponent = /*#__PURE__*/ function(ItemBehaviour) {
9748
9767
  /**
9749
9768
  * 3D 渲染模式,支持可视化渲染中间结果
9750
9769
  * none 表示正常的渲染结果
9751
- */ _this.renderMode3D = effects.spec.RenderMode3D.none;
9770
+ */ _this.renderMode3D = EFFECTS.spec.RenderMode3D.none;
9752
9771
  /**
9753
9772
  * UV 渲染模式中,指定棋盘格的大小,相对于大小为 1 的纹理
9754
9773
  * 取值范围(0, 1)
@@ -9799,8 +9818,8 @@ exports.ModelPluginComponent = /*#__PURE__*/ function(ItemBehaviour) {
9799
9818
  var newPosition = invWorldMatrix.transformPoint(position);
9800
9819
  component.setTransform(newPosition);
9801
9820
  // 正式版本不会走到这个流程,只在测试时使用
9802
- console.info("Scene AABB [" + sceneAABB.min.toArray() + "], [" + sceneAABB.max.toArray() + "]");
9803
- console.info("Update camera position [" + newPosition.toArray() + "]");
9821
+ console.info("Scene AABB [" + sceneAABB.min.toArray() + "], [" + sceneAABB.max.toArray() + "].");
9822
+ console.info("Update camera position [" + newPosition.toArray() + "].");
9804
9823
  }
9805
9824
  }
9806
9825
  });
@@ -9884,9 +9903,9 @@ exports.ModelPluginComponent = /*#__PURE__*/ function(ItemBehaviour) {
9884
9903
  return lightItemCount;
9885
9904
  };
9886
9905
  return ModelPluginComponent;
9887
- }(effects.ItemBehaviour);
9906
+ }(EFFECTS.ItemBehaviour);
9888
9907
  exports.ModelPluginComponent = __decorate([
9889
- effects.effectsClass(effects.spec.DataType.ModelPluginComponent)
9908
+ EFFECTS.effectsClass(EFFECTS.spec.DataType.ModelPluginComponent)
9890
9909
  ], exports.ModelPluginComponent);
9891
9910
  /**
9892
9911
  * 获取场景管理器,从合成中查找
@@ -9977,7 +9996,7 @@ exports.ModelPluginComponent = __decorate([
9977
9996
  var nodes = options.nodes.map(function(node, i) {
9978
9997
  return {
9979
9998
  name: node.name || node.id || i + "",
9980
- transform: new effects.Transform(_extends({}, node.transform, {
9999
+ transform: new EFFECTS.Transform(_extends({}, node.transform, {
9981
10000
  valid: true
9982
10001
  }), topTransform),
9983
10002
  id: "^" + (node.id || i),
@@ -10033,7 +10052,7 @@ exports.ModelTreeComponent = /*#__PURE__*/ function(ItemBehaviour) {
10033
10052
  /**
10034
10053
  * 组件开始,查询合成中场景管理器并设置到动画管理器中
10035
10054
  */ _proto.start = function start() {
10036
- this.item.type = effects.spec.ItemType.tree;
10055
+ this.item.type = EFFECTS.spec.ItemType.tree;
10037
10056
  this.content.baseTransform.setValid(true);
10038
10057
  var sceneManager = getSceneManager(this);
10039
10058
  if (sceneManager) {
@@ -10080,9 +10099,9 @@ exports.ModelTreeComponent = /*#__PURE__*/ function(ItemBehaviour) {
10080
10099
  }
10081
10100
  };
10082
10101
  return ModelTreeComponent;
10083
- }(effects.ItemBehaviour);
10102
+ }(EFFECTS.ItemBehaviour);
10084
10103
  exports.ModelTreeComponent = __decorate([
10085
- effects.effectsClass(effects.spec.DataType.TreeComponent)
10104
+ EFFECTS.effectsClass(EFFECTS.spec.DataType.TreeComponent)
10086
10105
  ], exports.ModelTreeComponent);
10087
10106
 
10088
10107
  /**
@@ -10101,7 +10120,7 @@ exports.ModelTreeComponent = __decorate([
10101
10120
  return _this;
10102
10121
  }
10103
10122
  return ModelTreePlugin;
10104
- }(effects.AbstractPlugin);
10123
+ }(EFFECTS.AbstractPlugin);
10105
10124
 
10106
10125
  exports.CameraGestureType = void 0;
10107
10126
  (function(CameraGestureType) {
@@ -10150,11 +10169,11 @@ var CameraGestureHandlerImp = /*#__PURE__*/ function() {
10150
10169
  // can't find camera item, throw error message
10151
10170
  var item = this.getItem();
10152
10171
  if (item === undefined) {
10153
- console.warn("can't find camera item " + this.startParams.target);
10172
+ console.warn("[CameraGestureHandlerImp] Unable to locate camera item with ID: " + this.startParams.target + ".");
10154
10173
  return this.composition.camera.getOptions();
10155
10174
  }
10156
10175
  var camera = this.composition.camera;
10157
- var effectsTransfrom = new effects.Transform(_extends({}, camera.getOptions(), {
10176
+ var effectsTransfrom = new EFFECTS.Transform(_extends({}, camera.getOptions(), {
10158
10177
  valid: true
10159
10178
  }));
10160
10179
  var cameraTransform = new PTransform().fromEffectsTransform(effectsTransfrom);
@@ -10321,7 +10340,7 @@ var CameraGestureHandlerImp = /*#__PURE__*/ function() {
10321
10340
  this.startParams.type = exports.CameraGestureType.none;
10322
10341
  var item = this.getItem();
10323
10342
  if (item === undefined) {
10324
- console.warn("can't find camera item");
10343
+ console.warn("[CameraGestureHandlerImp] Can't find camera item.");
10325
10344
  return;
10326
10345
  }
10327
10346
  this.setPosition(item, position);
@@ -10331,7 +10350,7 @@ var CameraGestureHandlerImp = /*#__PURE__*/ function() {
10331
10350
  this.startParams.type = exports.CameraGestureType.none;
10332
10351
  var item = this.getItem();
10333
10352
  if (item === undefined) {
10334
- console.warn("can't find camera item");
10353
+ console.warn("[CameraGestureHandlerImp] Can't find camera item.");
10335
10354
  return;
10336
10355
  }
10337
10356
  this.setQuaternion(item, quat);
@@ -10341,7 +10360,7 @@ var CameraGestureHandlerImp = /*#__PURE__*/ function() {
10341
10360
  this.startParams.type = exports.CameraGestureType.none;
10342
10361
  var item = this.getItem();
10343
10362
  if (item === undefined) {
10344
- console.warn("can't find camera item");
10363
+ console.warn("[CameraGestureHandlerImp] Can't find camera item.");
10345
10364
  return;
10346
10365
  }
10347
10366
  var newDistance = distance != null ? distance : 5;
@@ -10390,7 +10409,7 @@ var CameraGestureHandlerImp = /*#__PURE__*/ function() {
10390
10409
  };
10391
10410
  _proto.getCameraTransform = function getCameraTransform() {
10392
10411
  var camera = this.composition.camera;
10393
- var transform = new effects.Transform(camera.getOptions());
10412
+ var transform = new EFFECTS.Transform(camera.getOptions());
10394
10413
  transform.setValid(true);
10395
10414
  return transform;
10396
10415
  };
@@ -10398,7 +10417,7 @@ var CameraGestureHandlerImp = /*#__PURE__*/ function() {
10398
10417
  this.startParams = args;
10399
10418
  this.updateCameraTransform(this.composition.camera.getOptions());
10400
10419
  if (!this.getItem()) {
10401
- console.warn("invalid target");
10420
+ console.warn("[CameraGestureHandlerImp] Invalid target specified in startGesture.");
10402
10421
  }
10403
10422
  return this.composition.camera.getOptions();
10404
10423
  };
@@ -10406,7 +10425,7 @@ var CameraGestureHandlerImp = /*#__PURE__*/ function() {
10406
10425
  if (this.getCurrentType() === arg.type) {
10407
10426
  var item = this.getItem();
10408
10427
  if (item === undefined) {
10409
- console.warn("can't find camera item");
10428
+ console.warn("[CameraGestureHandlerImp] Can't find camera item.");
10410
10429
  return this.composition.camera.getOptions();
10411
10430
  }
10412
10431
  var _arg_speed;
@@ -10460,10 +10479,10 @@ var CameraGestureHandlerImp = /*#__PURE__*/ function() {
10460
10479
  item.transform.setQuaternion(newRotation1.x, newRotation1.y, newRotation1.z, newRotation1.w);
10461
10480
  this.setTransform(item, newPosition, item.transform.rotation);
10462
10481
  } else {
10463
- console.warn("not implement");
10482
+ console.warn("[CameraGestureHandlerImp] Movement type not implemented.");
10464
10483
  }
10465
10484
  } else {
10466
- console.warn("invalid move type");
10485
+ console.warn("[CameraGestureHandlerImp] Invalid move type specified: " + arg.type);
10467
10486
  }
10468
10487
  return this.composition.camera.getOptions();
10469
10488
  };
@@ -10495,7 +10514,7 @@ var CameraGestureHandlerImp = /*#__PURE__*/ function() {
10495
10514
  this.startParams.target = "";
10496
10515
  };
10497
10516
  _proto.updateCameraTransform = function updateCameraTransform(cameraOptions) {
10498
- var effectsTransfrom = new effects.Transform(cameraOptions);
10517
+ var effectsTransfrom = new EFFECTS.Transform(cameraOptions);
10499
10518
  effectsTransfrom.setValid(true);
10500
10519
  this.cameraTransform.fromEffectsTransform(effectsTransfrom);
10501
10520
  this.cameraCoordiante.fromPTransform(this.cameraTransform);
@@ -10515,7 +10534,7 @@ var LoaderHelper = /*#__PURE__*/ function() {
10515
10534
  };
10516
10535
  };
10517
10536
  LoaderHelper.getEffectsTransformFromMat4 = function getEffectsTransformFromMat4(mat) {
10518
- var transform = new effects.Transform({
10537
+ var transform = new EFFECTS.Transform({
10519
10538
  valid: true
10520
10539
  });
10521
10540
  transform.cloneFromMatrix(mat);
@@ -10732,7 +10751,7 @@ var LoaderImpl = /*#__PURE__*/ function() {
10732
10751
  var nodeList = scene.nodes.map(function(node, nodeIndex) {
10733
10752
  var children = node.children.map(function(child) {
10734
10753
  if (child.nodeIndex === undefined) {
10735
- throw new Error("Undefined nodeIndex for child " + child);
10754
+ throw new Error("Undefined nodeIndex for child " + child + ".");
10736
10755
  }
10737
10756
  return child.nodeIndex;
10738
10757
  });
@@ -10741,7 +10760,7 @@ var LoaderImpl = /*#__PURE__*/ function() {
10741
10760
  var scale;
10742
10761
  if (node.matrix !== undefined) {
10743
10762
  if (node.matrix.length !== 16) {
10744
- throw new Error("Invalid matrix length " + node.matrix.length + " for node " + node);
10763
+ throw new Error("Invalid matrix length " + node.matrix.length + " for node " + node + ".");
10745
10764
  }
10746
10765
  var mat = Matrix4.fromArray(node.matrix);
10747
10766
  var transform = mat.getTransform();
@@ -10774,7 +10793,7 @@ var LoaderImpl = /*#__PURE__*/ function() {
10774
10793
  });
10775
10794
  var rootNodes = scene.rootNodes.map(function(root) {
10776
10795
  if (root.nodeIndex === undefined) {
10777
- throw new Error("Undefined nodeIndex for root " + root);
10796
+ throw new Error("Undefined nodeIndex for root " + root + ".");
10778
10797
  }
10779
10798
  return root.nodeIndex;
10780
10799
  });
@@ -10819,18 +10838,18 @@ var LoaderImpl = /*#__PURE__*/ function() {
10819
10838
  _proto.createTextureCube = function createTextureCube(cubeImages, level0Size) {
10820
10839
  var _this = this;
10821
10840
  if (cubeImages.length == 0) {
10822
- throw new Error("createTextureCube: Invalid cubeImages length " + cubeImages);
10841
+ throw new Error("createTextureCube: Invalid cubeImages length " + cubeImages + ".");
10823
10842
  }
10824
10843
  var mipmaps = [];
10825
10844
  cubeImages.forEach(function(cubeImage) {
10826
10845
  if (cubeImage.length != 6) {
10827
- throw new Error("createTextureCube: cubeimage count should always be 6, " + cubeImage);
10846
+ throw new Error("createTextureCube: cubeimage count should always be 6, " + cubeImage + ".");
10828
10847
  }
10829
10848
  //
10830
10849
  var imgList = [];
10831
10850
  cubeImage.forEach(function(img) {
10832
10851
  if (img.imageData === undefined) {
10833
- throw new Error("createTextureCube: Invalid image data from " + img);
10852
+ throw new Error("createTextureCube: Invalid image data from " + img + ".");
10834
10853
  }
10835
10854
  //
10836
10855
  imgList.push({
@@ -10898,7 +10917,7 @@ var LoaderImpl = /*#__PURE__*/ function() {
10898
10917
  };
10899
10918
  _proto.createDefaultSkybox = function createDefaultSkybox(typeName) {
10900
10919
  if (typeName !== "NFT" && typeName !== "FARM") {
10901
- throw new Error("Invalid skybox type name " + typeName);
10920
+ throw new Error("Invalid skybox type specified: '" + typeName + "'. Valid types are: 'NFT', 'FARM'.");
10902
10921
  }
10903
10922
  //
10904
10923
  var typ = typeName === "NFT" ? exports.PSkyboxType.NFT : exports.PSkyboxType.FARM;
@@ -10929,7 +10948,7 @@ var LoaderImpl = /*#__PURE__*/ function() {
10929
10948
  };
10930
10949
  gltfResource = options.gltf.resource;
10931
10950
  if (typeof gltfResource === "string" || _instanceof1(gltfResource, Uint8Array)) {
10932
- throw new Error("Please load resource by GLTFTools at first");
10951
+ throw new Error("Please load the resource using GLTFTools first.");
10933
10952
  }
10934
10953
  _this._gltfScene = gltfResource.scenes[0];
10935
10954
  _this._gltfSkins = _this._gltfScene.skins;
@@ -10977,7 +10996,7 @@ var LoaderImpl = /*#__PURE__*/ function() {
10977
10996
  });
10978
10997
  sceneAABB = new Box3();
10979
10998
  _this._gltfScene.rootNodes.forEach(function(root) {
10980
- var parentTransform = new effects.Transform({
10999
+ var parentTransform = new EFFECTS.Transform({
10981
11000
  valid: true
10982
11001
  });
10983
11002
  _this._computeSceneAABB(root, parentTransform, sceneAABB);
@@ -11140,7 +11159,7 @@ var LoaderImpl = /*#__PURE__*/ function() {
11140
11159
  var texIndex = texInfo.index;
11141
11160
  var tex = this.getTextureManager().getTexture(matIndex, texIndex, isBaseColor);
11142
11161
  if (tex === undefined && noWarning !== true) {
11143
- console.warn("Can't find texture for mat " + matIndex + ", tex " + JSON.stringify(texInfo) + ", basecolor " + isBaseColor);
11162
+ console.warn("Can't find texture for mat " + matIndex + ", tex " + JSON.stringify(texInfo) + ", basecolor " + isBaseColor + ".");
11144
11163
  }
11145
11164
  return tex;
11146
11165
  };
@@ -11159,7 +11178,7 @@ var LoaderImpl = /*#__PURE__*/ function() {
11159
11178
  name: scene.name,
11160
11179
  duration: this.getItemDuration(),
11161
11180
  endBehavior: this.getItemEndBehavior(),
11162
- type: effects.spec.ItemType.tree,
11181
+ type: EFFECTS.spec.ItemType.tree,
11163
11182
  content: {
11164
11183
  options: {
11165
11184
  tree: treeOptions
@@ -11172,7 +11191,7 @@ var LoaderImpl = /*#__PURE__*/ function() {
11172
11191
  var _this = this;
11173
11192
  var meshIndex = node.mesh;
11174
11193
  if (meshIndex === undefined) {
11175
- throw new Error("Invalid mesh index in node " + node);
11194
+ throw new Error("Invalid mesh index in node " + node + ".");
11176
11195
  }
11177
11196
  var skin;
11178
11197
  if (node.skin !== undefined) {
@@ -11191,7 +11210,7 @@ var LoaderImpl = /*#__PURE__*/ function() {
11191
11210
  var geometry = _this.createGeometry(prim, skin !== undefined);
11192
11211
  var material = _this.createMaterial(mat);
11193
11212
  material.baseColorTexture = _this.getTexture2D(matIndex, mat.baseColorTexture, true);
11194
- if (material.type === effects.spec.MaterialType.pbr) {
11213
+ if (material.type === EFFECTS.spec.MaterialType.pbr) {
11195
11214
  material.metallicRoughnessTexture = _this.getTexture2D(matIndex, mat.metallicRoughnessTexture, false);
11196
11215
  material.normalTexture = _this.getTexture2D(matIndex, mat.normalTexture, false);
11197
11216
  material.emissiveTexture = _this.getTexture2D(matIndex, mat.emissiveTexture, false);
@@ -11213,8 +11232,8 @@ var LoaderImpl = /*#__PURE__*/ function() {
11213
11232
  var boxSize = aabb.getSize(new Vector3());
11214
11233
  var boxCenter = aabb.getCenter(new Vector3());
11215
11234
  var interaction = {
11216
- behavior: effects.spec.InteractBehavior.NOTIFY,
11217
- type: effects.spec.ModelBoundingType.box,
11235
+ behavior: EFFECTS.spec.InteractBehavior.NOTIFY,
11236
+ type: EFFECTS.spec.ModelBoundingType.box,
11218
11237
  size: [
11219
11238
  boxSize.x,
11220
11239
  boxSize.y,
@@ -11233,7 +11252,7 @@ var LoaderImpl = /*#__PURE__*/ function() {
11233
11252
  name: mesh.name,
11234
11253
  duration: this.getItemDuration(),
11235
11254
  endBehavior: this.getItemEndBehavior(),
11236
- type: effects.spec.ItemType.mesh,
11255
+ type: EFFECTS.spec.ItemType.mesh,
11237
11256
  pluginName: "model",
11238
11257
  content: {
11239
11258
  options: meshOptions,
@@ -11256,7 +11275,7 @@ var LoaderImpl = /*#__PURE__*/ function() {
11256
11275
  name: (_light_name = light.name) != null ? _light_name : "light",
11257
11276
  duration: this.getItemDuration(),
11258
11277
  endBehavior: this.getItemEndBehavior(),
11259
- type: effects.spec.ItemType.light,
11278
+ type: EFFECTS.spec.ItemType.light,
11260
11279
  pluginName: "model",
11261
11280
  content: {
11262
11281
  options: lightOptions
@@ -11298,7 +11317,7 @@ var LoaderImpl = /*#__PURE__*/ function() {
11298
11317
  name: "skybox",
11299
11318
  duration: this.getItemDuration(),
11300
11319
  endBehavior: this.getItemEndBehavior(),
11301
- type: effects.spec.ItemType.skybox,
11320
+ type: EFFECTS.spec.ItemType.skybox,
11302
11321
  pluginName: "model",
11303
11322
  content: {
11304
11323
  options: this._skyboxOptions
@@ -11325,7 +11344,7 @@ var LoaderImpl = /*#__PURE__*/ function() {
11325
11344
  transformData.scale = node.scale;
11326
11345
  }
11327
11346
  }
11328
- var nodeTransform = new effects.Transform(transformData, parentTransform);
11347
+ var nodeTransform = new EFFECTS.Transform(transformData, parentTransform);
11329
11348
  nodeTransform.setValid(true);
11330
11349
  //
11331
11350
  if (node.mesh !== undefined) {
@@ -11416,7 +11435,7 @@ var LoaderImpl = /*#__PURE__*/ function() {
11416
11435
  };
11417
11436
  _proto.getItemEndBehavior = function getItemEndBehavior() {
11418
11437
  var _this__sceneOptions_effects_endBehavior;
11419
- return (_this__sceneOptions_effects_endBehavior = this._sceneOptions.effects.endBehavior) != null ? _this__sceneOptions_effects_endBehavior : effects.spec.ItemEndBehavior.loop;
11438
+ return (_this__sceneOptions_effects_endBehavior = this._sceneOptions.effects.endBehavior) != null ? _this__sceneOptions_effects_endBehavior : EFFECTS.spec.ItemEndBehavior.loop;
11420
11439
  };
11421
11440
  _proto.getSkyboxType = function getSkyboxType() {
11422
11441
  var typeName = this._sceneOptions.gltf.skyboxType;
@@ -11508,7 +11527,7 @@ var GeometryProxy = /*#__PURE__*/ function() {
11508
11527
  var attrib = this.positionAttrib;
11509
11528
  attributes["aPos"] = this._getBufferAttrib(attrib);
11510
11529
  } else {
11511
- throw new Error("Position attribute missing");
11530
+ throw new Error("Position attribute missing.");
11512
11531
  }
11513
11532
  if (this.hasNormal) {
11514
11533
  var attrib1 = this.normalAttrib;
@@ -11555,21 +11574,21 @@ var GeometryProxy = /*#__PURE__*/ function() {
11555
11574
  }
11556
11575
  var indexArray = this.indexArray;
11557
11576
  if (indexArray !== undefined) {
11558
- return effects.Geometry.create(this.engine, {
11577
+ return EFFECTS.Geometry.create(this.engine, {
11559
11578
  attributes: attributes,
11560
11579
  indices: {
11561
11580
  data: indexArray
11562
11581
  },
11563
11582
  drawStart: 0,
11564
11583
  drawCount: indexArray.length,
11565
- mode: effects.glContext.TRIANGLES
11584
+ mode: EFFECTS.glContext.TRIANGLES
11566
11585
  });
11567
11586
  } else {
11568
- return effects.Geometry.create(this.engine, {
11587
+ return EFFECTS.Geometry.create(this.engine, {
11569
11588
  attributes: attributes,
11570
11589
  drawStart: 0,
11571
11590
  drawCount: this.positionAttrib.array.length / 3,
11572
- mode: effects.glContext.TRIANGLES
11591
+ mode: EFFECTS.glContext.TRIANGLES
11573
11592
  });
11574
11593
  }
11575
11594
  }
@@ -11739,19 +11758,19 @@ var MaterialProxy = /*#__PURE__*/ function() {
11739
11758
  get: function get() {
11740
11759
  var mat = this.gltfMaterial;
11741
11760
  var isUnlit = GLTFHelper.isUnlitMaterial(mat);
11742
- var blending = effects.spec.MaterialBlending.opaque;
11761
+ var blending = EFFECTS.spec.MaterialBlending.opaque;
11743
11762
  switch(mat.alphaMode){
11744
11763
  case "OPAQUE":
11745
- blending = effects.spec.MaterialBlending.opaque;
11764
+ blending = EFFECTS.spec.MaterialBlending.opaque;
11746
11765
  break;
11747
11766
  case "MASK":
11748
- blending = effects.spec.MaterialBlending.masked;
11767
+ blending = EFFECTS.spec.MaterialBlending.masked;
11749
11768
  break;
11750
11769
  case "BLEND":
11751
- blending = effects.spec.MaterialBlending.translucent;
11770
+ blending = EFFECTS.spec.MaterialBlending.translucent;
11752
11771
  break;
11753
11772
  }
11754
- var side = mat.doubleSided ? effects.spec.SideMode.DOUBLE : effects.spec.SideMode.FRONT;
11773
+ var side = mat.doubleSided ? EFFECTS.spec.SideMode.DOUBLE : EFFECTS.spec.SideMode.FRONT;
11755
11774
  var enableShadow = false;
11756
11775
  var _mat_alphaCutOff;
11757
11776
  var alphaCutOff = (_mat_alphaCutOff = mat.alphaCutOff) != null ? _mat_alphaCutOff : 0.5;
@@ -11760,7 +11779,7 @@ var MaterialProxy = /*#__PURE__*/ function() {
11760
11779
  var _mat_extras;
11761
11780
  return {
11762
11781
  name: name,
11763
- type: effects.spec.MaterialType.unlit,
11782
+ type: EFFECTS.spec.MaterialType.unlit,
11764
11783
  baseColorTexture: this.baseColorTextureObj,
11765
11784
  baseColorTextureCoordinate: this.baseColorTextureCoord,
11766
11785
  baseColorTextureTransform: this.baseColorTextureTransfrom,
@@ -11775,7 +11794,7 @@ var MaterialProxy = /*#__PURE__*/ function() {
11775
11794
  var _mat_extras1;
11776
11795
  return {
11777
11796
  name: name,
11778
- type: effects.spec.MaterialType.pbr,
11797
+ type: EFFECTS.spec.MaterialType.pbr,
11779
11798
  baseColorTexture: this.baseColorTextureObj,
11780
11799
  baseColorTextureCoordinate: this.baseColorTextureCoord,
11781
11800
  baseColorTextureTransform: this.baseColorTextureTransfrom,
@@ -12005,21 +12024,21 @@ var JSONConverter = /*#__PURE__*/ function() {
12005
12024
  this.treeInfo = new TreeInfo();
12006
12025
  this.engine = player.renderer.engine;
12007
12026
  this.renderer = player.renderer;
12008
- this.downloader = new effects.Downloader();
12027
+ this.downloader = new EFFECTS.Downloader();
12009
12028
  }
12010
12029
  var _proto = JSONConverter.prototype;
12011
12030
  _proto.processScene = function processScene(sceneData) {
12012
12031
  var _this = this;
12013
12032
  return _async_to_generator(function() {
12014
- var sceneJSON, oldScene, binFiles, _iterator, _step, bin, _, newScene;
12033
+ var sceneJSON, _tmp, oldScene, binFiles, _iterator, _step, bin, _, newScene;
12015
12034
  return __generator(this, function(_state) {
12016
12035
  switch(_state.label){
12017
12036
  case 0:
12018
- if (!_instanceof1(sceneData, Object)) return [
12037
+ if (!EFFECTS.isObject(sceneData)) return [
12019
12038
  3,
12020
12039
  1
12021
12040
  ];
12022
- sceneJSON = sceneData;
12041
+ _tmp = sceneData;
12023
12042
  return [
12024
12043
  3,
12025
12044
  3
@@ -12030,16 +12049,17 @@ var JSONConverter = /*#__PURE__*/ function() {
12030
12049
  _this.loadJSON(sceneData)
12031
12050
  ];
12032
12051
  case 2:
12033
- sceneJSON = _state.sent();
12052
+ _tmp = _state.sent();
12034
12053
  _state.label = 3;
12035
12054
  case 3:
12055
+ sceneJSON = _tmp;
12036
12056
  // @ts-expect-error
12037
12057
  sceneJSON.textures.forEach(function(tex) {
12038
12058
  if (tex.source === undefined) {
12039
12059
  tex.source = 0;
12040
12060
  }
12041
12061
  });
12042
- oldScene = effects.getStandardJSON(sceneJSON);
12062
+ oldScene = EFFECTS.getStandardJSON(sceneJSON);
12043
12063
  binFiles = [];
12044
12064
  if (!oldScene.bins) return [
12045
12065
  3,
@@ -12151,7 +12171,7 @@ var JSONConverter = /*#__PURE__*/ function() {
12151
12171
  loadedMipmaps = _state.sent();
12152
12172
  newMipmaps = loadedMipmaps.map(function(mipmaps) {
12153
12173
  return mipmaps.map(function(img) {
12154
- var id = effects.generateGUID();
12174
+ var id = EFFECTS.generateGUID();
12155
12175
  var sceneImage = {
12156
12176
  url: img,
12157
12177
  id: id
@@ -12169,7 +12189,7 @@ var JSONConverter = /*#__PURE__*/ function() {
12169
12189
  mipmaps: newMipmaps,
12170
12190
  sourceFrom: {
12171
12191
  target: target,
12172
- type: effects.TextureSourceType.mipmaps,
12192
+ type: EFFECTS.TextureSourceType.mipmaps,
12173
12193
  mipmaps: mipmaps.map(function(mipmap) {
12174
12194
  return mipmap.map(function(pointer) {
12175
12195
  return [
@@ -12215,26 +12235,26 @@ var JSONConverter = /*#__PURE__*/ function() {
12215
12235
  var newComponents = newScene.components;
12216
12236
  for(var _iterator = _create_for_of_iterator_helper_loose(oldScene.components), _step; !(_step = _iterator()).done;){
12217
12237
  var comp = _step.value;
12218
- if (comp.dataType === effects.spec.DataType.SkyboxComponent) {
12238
+ if (comp.dataType === EFFECTS.spec.DataType.SkyboxComponent) {
12219
12239
  newComponents.push(this.createSkyboxComponent(comp, newScene));
12220
- } else if (comp.dataType === effects.spec.DataType.LightComponent) {
12240
+ } else if (comp.dataType === EFFECTS.spec.DataType.LightComponent) {
12221
12241
  newComponents.push(this.createLightComponent(comp, newScene));
12222
- } else if (comp.dataType === effects.spec.DataType.CameraComponent) {
12242
+ } else if (comp.dataType === EFFECTS.spec.DataType.CameraComponent) {
12223
12243
  newComponents.push(comp);
12224
- console.warn("Find camera component", comp);
12225
- } else if (comp.dataType === effects.spec.DataType.TreeComponent) {
12244
+ console.warn("Camera component found: " + comp + ".");
12245
+ } else if (comp.dataType === EFFECTS.spec.DataType.TreeComponent) {
12226
12246
  var treeComp = comp;
12227
12247
  this.createItemsFromTreeComponent(comp, newScene, oldScene);
12228
12248
  treeComp.options.tree.animation = undefined;
12229
12249
  treeComp.options.tree.animations = undefined;
12230
12250
  newComponents.push(comp);
12231
- } else if (comp.dataType !== effects.spec.DataType.MeshComponent) {
12251
+ } else if (comp.dataType !== EFFECTS.spec.DataType.MeshComponent) {
12232
12252
  newComponents.push(comp);
12233
12253
  }
12234
12254
  }
12235
12255
  for(var _iterator1 = _create_for_of_iterator_helper_loose(oldScene.components), _step1; !(_step1 = _iterator1()).done;){
12236
12256
  var comp1 = _step1.value;
12237
- if (comp1.dataType === effects.spec.DataType.MeshComponent) {
12257
+ if (comp1.dataType === EFFECTS.spec.DataType.MeshComponent) {
12238
12258
  newComponents.push(this.createMeshComponent(comp1, newScene, oldScene));
12239
12259
  }
12240
12260
  }
@@ -12265,7 +12285,7 @@ var JSONConverter = /*#__PURE__*/ function() {
12265
12285
  2,
12266
12286
  new Promise(function(resolve, reject) {
12267
12287
  _this.downloader.downloadJSON(url, resolve, function(status, responseText) {
12268
- reject(new Error("Couldn't load JSON " + JSON.stringify(url) + ": status " + status + ", " + responseText));
12288
+ reject(new Error("Failed to load JSON from URL '" + url + "': status " + status + " - " + responseText + ". Please check the URL or network settings."));
12269
12289
  });
12270
12290
  })
12271
12291
  ];
@@ -12294,7 +12314,7 @@ var JSONConverter = /*#__PURE__*/ function() {
12294
12314
  _pointer_ = pointer[1], index = _pointer_[0], start = _pointer_[1], length = _pointer_[2];
12295
12315
  bin = bins[index];
12296
12316
  if (!bin) {
12297
- throw new Error("invalid bin pointer: " + JSON.stringify(pointer));
12317
+ throw new Error("Invalid bin pointer: " + JSON.stringify(pointer) + ".");
12298
12318
  }
12299
12319
  return [
12300
12320
  2,
@@ -12363,7 +12383,7 @@ var JSONConverter = /*#__PURE__*/ function() {
12363
12383
  });
12364
12384
  var geometryData = getGeometryDataFromPropsList(geometryPropsList);
12365
12385
  if (!geometryData) {
12366
- throw new Error("no primitives");
12386
+ throw new Error("No primitives available to process.");
12367
12387
  }
12368
12388
  newScene.geometries.push(geometryData);
12369
12389
  (_newScene_materials = newScene.materials).push.apply(_newScene_materials, [].concat(materialDatas));
@@ -12390,12 +12410,12 @@ var JSONConverter = /*#__PURE__*/ function() {
12390
12410
  }
12391
12411
  }
12392
12412
  if (parentItemId === component.item.id) {
12393
- throw new Error("Can't item " + component.item);
12413
+ throw new Error("Can't item " + component.item + ".");
12394
12414
  }
12395
12415
  var treeItem = this.treeInfo.getTreeItemByNodeId(parentItemId);
12396
12416
  var treeNodeList = this.treeInfo.getTreeNodeListByNodeId(parentItemId);
12397
12417
  if (!treeItem || !treeNodeList) {
12398
- throw new Error("Can't find tree node list for " + component.item);
12418
+ throw new Error("Failed to retrieve tree node list for item with ID " + component.item.id + ". Ensure the item exists and has a valid tree structure.");
12399
12419
  }
12400
12420
  var rootBoneItem = this.setupBoneData(geometryData, meshOptions.skin, oldScene, treeItem, treeNodeList);
12401
12421
  meshComponent.rootBone = {
@@ -12423,13 +12443,13 @@ var JSONConverter = /*#__PURE__*/ function() {
12423
12443
  treeData.nodes.forEach(function(node, index) {
12424
12444
  var _node_name;
12425
12445
  var item = {
12426
- id: effects.generateGUID(),
12446
+ id: EFFECTS.generateGUID(),
12427
12447
  parentId: treeItem.id,
12428
12448
  name: (_node_name = node.name) != null ? _node_name : "node" + index,
12429
12449
  duration: treeItem.duration,
12430
12450
  // @ts-expect-error
12431
12451
  type: "ECS",
12432
- dataType: effects.spec.DataType.VFXItemData,
12452
+ dataType: EFFECTS.spec.DataType.VFXItemData,
12433
12453
  visible: treeItem.visible,
12434
12454
  endBehavior: treeItem.endBehavior,
12435
12455
  delay: treeItem.delay,
@@ -12494,8 +12514,8 @@ var JSONConverter = /*#__PURE__*/ function() {
12494
12514
  var _this = this;
12495
12515
  var animation = treeOptions.animation, animations = treeOptions.animations;
12496
12516
  var animationComponent = {
12497
- id: effects.generateGUID(),
12498
- dataType: effects.spec.DataType.AnimationComponent,
12517
+ id: EFFECTS.generateGUID(),
12518
+ dataType: EFFECTS.spec.DataType.AnimationComponent,
12499
12519
  item: {
12500
12520
  id: treeItem.id
12501
12521
  },
@@ -12507,9 +12527,9 @@ var JSONConverter = /*#__PURE__*/ function() {
12507
12527
  var bins = oldScene.bins;
12508
12528
  animations.forEach(function(anim) {
12509
12529
  var clipData = {
12510
- id: effects.generateGUID(),
12530
+ id: EFFECTS.generateGUID(),
12511
12531
  name: anim.name,
12512
- dataType: effects.spec.DataType.AnimationClip,
12532
+ dataType: EFFECTS.spec.DataType.AnimationClip,
12513
12533
  positionCurves: [],
12514
12534
  rotationCurves: [],
12515
12535
  scaleCurves: [],
@@ -12524,13 +12544,13 @@ var JSONConverter = /*#__PURE__*/ function() {
12524
12544
  var inputArray = typedArrayFromBinary(bins, track.input);
12525
12545
  var outputArray = typedArrayFromBinary(bins, track.output);
12526
12546
  if (!_instanceof1(inputArray, Float32Array)) {
12527
- throw new Error("Type of inputArray should be float32, " + inputArray);
12547
+ throw new Error("Type of inputArray should be float32, " + inputArray + ".");
12528
12548
  }
12529
12549
  if (!_instanceof1(outputArray, Float32Array)) {
12530
- throw new Error("Type of outputArray should be float32, " + outputArray);
12550
+ throw new Error("Type of outputArray should be float32, " + outputArray + ".");
12531
12551
  }
12532
12552
  if (track.interpolation !== "LINEAR") {
12533
- throw new Error("Invalid interpolation type " + track.interpolation);
12553
+ throw new Error("Invalid interpolation type " + track.interpolation + ".");
12534
12554
  }
12535
12555
  if (track.path === "rotation") {
12536
12556
  var points = [];
@@ -12554,7 +12574,7 @@ var JSONConverter = /*#__PURE__*/ function() {
12554
12574
  controlPoints.push(p2.toArray());
12555
12575
  }
12556
12576
  lineValue.push([
12557
- effects.spec.BezierKeyframeType.LINE,
12577
+ EFFECTS.spec.BezierKeyframeType.LINE,
12558
12578
  [
12559
12579
  inputArray[i],
12560
12580
  i
@@ -12564,7 +12584,7 @@ var JSONConverter = /*#__PURE__*/ function() {
12564
12584
  var node = _this.treeInfo.getTreeNode(treeItem.id, track.node);
12565
12585
  var path = _this.treeInfo.getNodePath(node.id);
12566
12586
  var keyFrames = [
12567
- effects.spec.ValueType.BEZIER_CURVE_QUAT,
12587
+ EFFECTS.spec.ValueType.BEZIER_CURVE_QUAT,
12568
12588
  [
12569
12589
  lineValue,
12570
12590
  points,
@@ -12592,7 +12612,7 @@ var JSONConverter = /*#__PURE__*/ function() {
12592
12612
  var lineValue1 = [];
12593
12613
  for(var i2 = 0; i2 < inputArray.length; i2++){
12594
12614
  lineValue1.push([
12595
- effects.spec.BezierKeyframeType.LINE,
12615
+ EFFECTS.spec.BezierKeyframeType.LINE,
12596
12616
  [
12597
12617
  inputArray[i2],
12598
12618
  outputArray[i2 * component + c]
@@ -12600,7 +12620,7 @@ var JSONConverter = /*#__PURE__*/ function() {
12600
12620
  ]);
12601
12621
  }
12602
12622
  var keyFrames1 = [
12603
- effects.spec.ValueType.BEZIER_CURVE,
12623
+ EFFECTS.spec.ValueType.BEZIER_CURVE,
12604
12624
  lineValue1
12605
12625
  ];
12606
12626
  clipData.floatCurves.push({
@@ -12629,7 +12649,7 @@ var JSONConverter = /*#__PURE__*/ function() {
12629
12649
  controlPoints1.push(p21.toArray());
12630
12650
  }
12631
12651
  lineValue2.push([
12632
- effects.spec.BezierKeyframeType.LINE,
12652
+ EFFECTS.spec.BezierKeyframeType.LINE,
12633
12653
  [
12634
12654
  inputArray[i3],
12635
12655
  i3
@@ -12639,7 +12659,7 @@ var JSONConverter = /*#__PURE__*/ function() {
12639
12659
  var node2 = _this.treeInfo.getTreeNode(treeItem.id, track.node);
12640
12660
  var path2 = _this.treeInfo.getNodePath(node2.id);
12641
12661
  var keyFrames2 = [
12642
- effects.spec.ValueType.BEZIER_CURVE_PATH,
12662
+ EFFECTS.spec.ValueType.BEZIER_CURVE_PATH,
12643
12663
  [
12644
12664
  lineValue2,
12645
12665
  points1,
@@ -12671,7 +12691,7 @@ var JSONConverter = /*#__PURE__*/ function() {
12671
12691
  newScene.components.push(animationComponent);
12672
12692
  };
12673
12693
  _proto.getMaterialData = function getMaterialData(material, scene) {
12674
- if (material.type === effects.spec.MaterialType.unlit) {
12694
+ if (material.type === EFFECTS.spec.MaterialType.unlit) {
12675
12695
  var floats = {};
12676
12696
  if (material.alphaCutOff !== undefined) {
12677
12697
  floats["_AlphaCutoff"] = material.alphaCutOff;
@@ -12684,9 +12704,9 @@ var JSONConverter = /*#__PURE__*/ function() {
12684
12704
  textures["_BaseColorSampler"] = this.getTextureData(scene, floats, material.baseColorTexture, material.baseColorTextureTransform);
12685
12705
  }
12686
12706
  var newMaterial = {
12687
- id: effects.generateGUID(),
12707
+ id: EFFECTS.generateGUID(),
12688
12708
  name: material.name,
12689
- dataType: effects.spec.DataType.Material,
12709
+ dataType: EFFECTS.spec.DataType.Material,
12690
12710
  shader: {
12691
12711
  id: UnlitShaderGUID
12692
12712
  },
@@ -12741,9 +12761,9 @@ var JSONConverter = /*#__PURE__*/ function() {
12741
12761
  textures1["_EmissiveSampler"] = this.getTextureData(scene, floats1, material.emissiveTexture, material.emissiveTextureTransform);
12742
12762
  }
12743
12763
  var newMaterial1 = {
12744
- id: effects.generateGUID(),
12764
+ id: EFFECTS.generateGUID(),
12745
12765
  name: material.name,
12746
- dataType: effects.spec.DataType.Material,
12766
+ dataType: EFFECTS.spec.DataType.Material,
12747
12767
  shader: {
12748
12768
  id: PBRShaderGUID
12749
12769
  },
@@ -12760,12 +12780,12 @@ var JSONConverter = /*#__PURE__*/ function() {
12760
12780
  }
12761
12781
  };
12762
12782
  _proto.setupMaterial = function setupMaterial(oldMat, newMat) {
12763
- if (oldMat.blending === effects.spec.MaterialBlending.translucent) {
12764
- newMat.stringTags["RenderType"] = effects.spec.RenderType.Transparent;
12783
+ if (oldMat.blending === EFFECTS.spec.MaterialBlending.translucent) {
12784
+ newMat.stringTags["RenderType"] = EFFECTS.spec.RenderType.Transparent;
12765
12785
  } else {
12766
- newMat.stringTags["RenderType"] = effects.spec.RenderType.Opaque;
12786
+ newMat.stringTags["RenderType"] = EFFECTS.spec.RenderType.Opaque;
12767
12787
  }
12768
- if (oldMat.blending === effects.spec.MaterialBlending.masked) {
12788
+ if (oldMat.blending === EFFECTS.spec.MaterialBlending.masked) {
12769
12789
  newMat.floats["AlphaClip"] = 1;
12770
12790
  var _oldMat_alphaCutOff;
12771
12791
  newMat.floats["_Cutoff"] = (_oldMat_alphaCutOff = oldMat.alphaCutOff) != null ? _oldMat_alphaCutOff : 0;
@@ -12773,16 +12793,16 @@ var JSONConverter = /*#__PURE__*/ function() {
12773
12793
  newMat.floats["AlphaClip"] = 0;
12774
12794
  }
12775
12795
  switch(oldMat.side){
12776
- case effects.spec.SideMode.BACK:
12777
- newMat.stringTags["RenderFace"] = effects.spec.RenderFace.Back;
12796
+ case EFFECTS.spec.SideMode.BACK:
12797
+ newMat.stringTags["RenderFace"] = EFFECTS.spec.RenderFace.Back;
12778
12798
  break;
12779
- case effects.spec.SideMode.DOUBLE:
12780
- newMat.stringTags["RenderFace"] = effects.spec.RenderFace.Both;
12799
+ case EFFECTS.spec.SideMode.DOUBLE:
12800
+ newMat.stringTags["RenderFace"] = EFFECTS.spec.RenderFace.Both;
12781
12801
  break;
12782
12802
  default:
12783
- newMat.stringTags["RenderFace"] = effects.spec.RenderFace.Front;
12803
+ newMat.stringTags["RenderFace"] = EFFECTS.spec.RenderFace.Front;
12784
12804
  }
12785
- if (oldMat.type === effects.spec.MaterialType.pbr) {
12805
+ if (oldMat.type === EFFECTS.spec.MaterialType.pbr) {
12786
12806
  newMat.floats["_SpecularAA"] = oldMat.useSpecularAA ? 1 : 0;
12787
12807
  }
12788
12808
  var _oldMat_depthMask;
@@ -12866,7 +12886,7 @@ var JSONConverter = /*#__PURE__*/ function() {
12866
12886
  var bins = oldScene.bins;
12867
12887
  var joints = skin.joints, skeleton = skin.skeleton, inverseBindMatrices = skin.inverseBindMatrices;
12868
12888
  if (!inverseBindMatrices) {
12869
- throw new Error("inverseBindMatrices is undefined " + skin);
12889
+ throw new Error("'inverseBindMatrices' is undefined for the skin configuration: " + JSON.stringify(skin) + ". Ensure 'inverseBindMatrices' is properly defined in your skin data.");
12870
12890
  }
12871
12891
  var bindMatrixArray = typedArrayFromBinary(bins, inverseBindMatrices);
12872
12892
  geom.inverseBindMatrices = Array.from(bindMatrixArray);
@@ -12875,12 +12895,12 @@ var JSONConverter = /*#__PURE__*/ function() {
12875
12895
  if (skeleton !== undefined) {
12876
12896
  rootBoneItem = treeNodeList[skeleton];
12877
12897
  } else {
12878
- console.warn("Root bone is missing");
12898
+ console.warn("Root bone is missing for the skeleton. Defaulting to the primary tree item as the root bone.");
12879
12899
  }
12880
12900
  joints.forEach(function(joint) {
12881
12901
  var node = treeNodeList[joint];
12882
12902
  if (node !== rootBoneItem && node.parentId === rootBoneItem.parentId) {
12883
- console.error("Find invalid node for rootBoneItem and adjust rootBoneItem");
12903
+ console.error("Invalid node detected for 'rootBoneItem'. Adjusting 'rootBoneItem' to the primary tree item. Please verify the tree structure.");
12884
12904
  rootBoneItem = treeItem;
12885
12905
  }
12886
12906
  });
@@ -12918,12 +12938,12 @@ var TreeInfo = /*#__PURE__*/ function() {
12918
12938
  _proto.add = function add(treeItem, treeNodeList) {
12919
12939
  var _this = this;
12920
12940
  if (this.tree2NodeList[treeItem.id]) {
12921
- throw new Error("Find duplicate treeItem id: " + treeItem.id);
12941
+ throw new Error("Duplicate treeItem ID detected: " + treeItem.id + ". Ensure each tree item has a unique ID.");
12922
12942
  }
12923
12943
  this.tree2NodeList[treeItem.id] = treeNodeList;
12924
12944
  treeNodeList.forEach(function(node) {
12925
12945
  if (_this.nodeList2Tree[node.id]) {
12926
- throw new Error("Find duplicate tree node id: " + node.id);
12946
+ throw new Error("Duplicate tree node ID found: " + node.id + ". Each node in the tree must have a unique ID.");
12927
12947
  }
12928
12948
  _this.nodeList2Tree[node.id] = treeItem;
12929
12949
  _this.nodeId2Node[node.id] = node;
@@ -12952,7 +12972,7 @@ var TreeInfo = /*#__PURE__*/ function() {
12952
12972
  _proto.getTreeNodeListByNodeId = function getTreeNodeListByNodeId(id) {
12953
12973
  var treeItem = this.nodeList2Tree[id];
12954
12974
  if (!treeItem) {
12955
- throw new Error("Invalid id " + id);
12975
+ throw new Error("Invalid id " + id + ".");
12956
12976
  }
12957
12977
  return this.getTreeNodeListByTreeId(treeItem.id);
12958
12978
  };
@@ -12979,11 +12999,11 @@ var TreeInfo = /*#__PURE__*/ function() {
12979
12999
  }();
12980
13000
  function getGeometryDataFromOptions(geomOptions) {
12981
13001
  var vertexCount = 0;
12982
- var verticesType = effects.spec.VertexFormatType.Float32;
13002
+ var verticesType = EFFECTS.spec.VertexFormatType.Float32;
12983
13003
  var verticesNormalize = false;
12984
- var uvsType = effects.spec.VertexFormatType.Float32;
13004
+ var uvsType = EFFECTS.spec.VertexFormatType.Float32;
12985
13005
  var uvsNormalize = false;
12986
- var normalsType = effects.spec.VertexFormatType.Float32;
13006
+ var normalsType = EFFECTS.spec.VertexFormatType.Float32;
12987
13007
  var normalsNormalize = false;
12988
13008
  var _geomOptions_name;
12989
13009
  var modelData = {
@@ -13003,21 +13023,21 @@ function getGeometryDataFromOptions(geomOptions) {
13003
13023
  var _attribData_normalize;
13004
13024
  verticesNormalize = (_attribData_normalize = attribData.normalize) != null ? _attribData_normalize : false;
13005
13025
  var _attribData_type;
13006
- verticesType = effects.glType2VertexFormatType((_attribData_type = attribData.type) != null ? _attribData_type : effects.glContext.FLOAT);
13026
+ verticesType = EFFECTS.glType2VertexFormatType((_attribData_type = attribData.type) != null ? _attribData_type : EFFECTS.glContext.FLOAT);
13007
13027
  } else if (attrib === "aNormal") {
13008
13028
  // @ts-expect-error
13009
13029
  modelData.normals = attribData.data;
13010
13030
  var _attribData_normalize1;
13011
13031
  normalsNormalize = (_attribData_normalize1 = attribData.normalize) != null ? _attribData_normalize1 : false;
13012
13032
  var _attribData_type1;
13013
- normalsType = effects.glType2VertexFormatType((_attribData_type1 = attribData.type) != null ? _attribData_type1 : effects.glContext.FLOAT);
13033
+ normalsType = EFFECTS.glType2VertexFormatType((_attribData_type1 = attribData.type) != null ? _attribData_type1 : EFFECTS.glContext.FLOAT);
13014
13034
  } else if (attrib === "aUV1") {
13015
13035
  // @ts-expect-error
13016
13036
  modelData.uvs = attribData.data;
13017
13037
  var _attribData_normalize2;
13018
13038
  uvsNormalize = (_attribData_normalize2 = attribData.normalize) != null ? _attribData_normalize2 : false;
13019
13039
  var _attribData_type2;
13020
- uvsType = effects.glType2VertexFormatType((_attribData_type2 = attribData.type) != null ? _attribData_type2 : effects.glContext.FLOAT);
13040
+ uvsType = EFFECTS.glType2VertexFormatType((_attribData_type2 = attribData.type) != null ? _attribData_type2 : EFFECTS.glContext.FLOAT);
13021
13041
  }
13022
13042
  }
13023
13043
  var verticesOffset = getOffset(verticesType, 3, vertexCount);
@@ -13038,32 +13058,32 @@ function getGeometryDataFromOptions(geomOptions) {
13038
13058
  }
13039
13059
  modelData.indices = indices1;
13040
13060
  }
13041
- var indicesType = effects.spec.IndexFormatType.UInt16;
13061
+ var indicesType = EFFECTS.spec.IndexFormatType.UInt16;
13042
13062
  if (modelData.indices.BYTES_PER_ELEMENT === 4) {
13043
- indicesType = effects.spec.IndexFormatType.UInt32;
13063
+ indicesType = EFFECTS.spec.IndexFormatType.UInt32;
13044
13064
  }
13045
13065
  var geometryData = {
13046
- id: effects.generateGUID(),
13047
- dataType: effects.spec.DataType.Geometry,
13066
+ id: EFFECTS.generateGUID(),
13067
+ dataType: EFFECTS.spec.DataType.Geometry,
13048
13068
  vertexData: {
13049
13069
  vertexCount: vertexCount,
13050
13070
  channels: [
13051
13071
  {
13052
- semantic: effects.spec.VertexBufferSemantic.Position,
13072
+ semantic: EFFECTS.spec.VertexBufferSemantic.Position,
13053
13073
  offset: 0,
13054
13074
  format: verticesType,
13055
13075
  dimension: 3,
13056
13076
  normalize: verticesNormalize
13057
13077
  },
13058
13078
  {
13059
- semantic: effects.spec.VertexBufferSemantic.Uv,
13079
+ semantic: EFFECTS.spec.VertexBufferSemantic.Uv,
13060
13080
  offset: verticesOffset,
13061
13081
  format: uvsType,
13062
13082
  dimension: 2,
13063
13083
  normalize: uvsNormalize
13064
13084
  },
13065
13085
  {
13066
- semantic: effects.spec.VertexBufferSemantic.Normal,
13086
+ semantic: EFFECTS.spec.VertexBufferSemantic.Normal,
13067
13087
  offset: verticesOffset + uvsOffset,
13068
13088
  format: normalsType,
13069
13089
  dimension: 3,
@@ -13072,7 +13092,7 @@ function getGeometryDataFromOptions(geomOptions) {
13072
13092
  ]
13073
13093
  },
13074
13094
  subMeshes: [],
13075
- mode: effects.spec.GeometryType.TRIANGLES,
13095
+ mode: EFFECTS.spec.GeometryType.TRIANGLES,
13076
13096
  indexFormat: indicesType,
13077
13097
  indexOffset: verticesOffset + uvsOffset + normalsOffset,
13078
13098
  buffer: encodeVertexData(modelData)
@@ -13138,11 +13158,11 @@ function getGeometryDataFromPropsList(geomPropsList) {
13138
13158
  }
13139
13159
  function getOffset(formatType, dimension, count) {
13140
13160
  switch(formatType){
13141
- case effects.spec.VertexFormatType.Int8:
13142
- case effects.spec.VertexFormatType.UInt8:
13161
+ case EFFECTS.spec.VertexFormatType.Int8:
13162
+ case EFFECTS.spec.VertexFormatType.UInt8:
13143
13163
  return dimension * count;
13144
- case effects.spec.VertexFormatType.Int16:
13145
- case effects.spec.VertexFormatType.UInt16:
13164
+ case EFFECTS.spec.VertexFormatType.Int16:
13165
+ case EFFECTS.spec.VertexFormatType.UInt16:
13146
13166
  return dimension * count * 2;
13147
13167
  default:
13148
13168
  return dimension * count * 4;
@@ -13166,7 +13186,7 @@ function createGeometryData(props, subMeshes) {
13166
13186
  var attribData1 = props.attributes[attrib1];
13167
13187
  var semantic = vertexBufferSemanticMap[attrib1];
13168
13188
  if (!semantic) {
13169
- throw new Error("Invalid attrib " + attrib1);
13189
+ throw new Error("Invalid attrib " + attrib1 + ".");
13170
13190
  }
13171
13191
  // @ts-expect-error
13172
13192
  vertexCount = attribData1.data.length / attribData1.size;
@@ -13174,7 +13194,7 @@ function createGeometryData(props, subMeshes) {
13174
13194
  var vertexChannel = {
13175
13195
  semantic: semantic,
13176
13196
  offset: bufferOffset,
13177
- format: effects.glType2VertexFormatType((_attribData_type = attribData1.type) != null ? _attribData_type : effects.glContext.FLOAT),
13197
+ format: EFFECTS.glType2VertexFormatType((_attribData_type = attribData1.type) != null ? _attribData_type : EFFECTS.glContext.FLOAT),
13178
13198
  dimension: attribData1.size,
13179
13199
  normalize: attribData1.normalize
13180
13200
  };
@@ -13186,15 +13206,15 @@ function createGeometryData(props, subMeshes) {
13186
13206
  bufferOffset += subBuffer.byteLength;
13187
13207
  }
13188
13208
  var geometryData = {
13189
- id: effects.generateGUID(),
13190
- dataType: effects.spec.DataType.Geometry,
13209
+ id: EFFECTS.generateGUID(),
13210
+ dataType: EFFECTS.spec.DataType.Geometry,
13191
13211
  vertexData: {
13192
13212
  vertexCount: vertexCount,
13193
13213
  channels: vertexChannels
13194
13214
  },
13195
13215
  subMeshes: subMeshes,
13196
- mode: effects.spec.GeometryType.TRIANGLES,
13197
- indexFormat: effects.spec.IndexFormatType.UInt16,
13216
+ mode: EFFECTS.spec.GeometryType.TRIANGLES,
13217
+ indexFormat: EFFECTS.spec.IndexFormatType.UInt16,
13198
13218
  indexOffset: -1,
13199
13219
  buffer: ""
13200
13220
  };
@@ -13204,7 +13224,7 @@ function createGeometryData(props, subMeshes) {
13204
13224
  buffer.set(subBuffer1, bufferOffset);
13205
13225
  geometryData.indexOffset = bufferOffset;
13206
13226
  if (_instanceof1(indices, Uint32Array)) {
13207
- geometryData.indexFormat = effects.spec.IndexFormatType.UInt32;
13227
+ geometryData.indexFormat = EFFECTS.spec.IndexFormatType.UInt32;
13208
13228
  }
13209
13229
  }
13210
13230
  geometryData.buffer = toBase64String(buffer);
@@ -13359,11 +13379,11 @@ var vertexBufferSemanticMap = {
13359
13379
  a_Target_Tangent3: "TANGENT_BS3"
13360
13380
  };
13361
13381
 
13362
- effects.registerPlugin("tree", ModelTreePlugin, effects.VFXItem, true);
13363
- effects.registerPlugin("model", ModelPlugin, effects.VFXItem);
13364
- var version = "2.0.0-alpha.16";
13365
- effects.logger.info("plugin model version: " + version);
13366
- if (version !== effects.version) {
13382
+ EFFECTS.registerPlugin("tree", ModelTreePlugin, EFFECTS.VFXItem, true);
13383
+ EFFECTS.registerPlugin("model", ModelPlugin, EFFECTS.VFXItem);
13384
+ var version = "2.0.0-alpha.18";
13385
+ EFFECTS.logger.info("Plugin model version: " + version + ".");
13386
+ if (version !== EFFECTS__namespace.version) {
13367
13387
  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!");
13368
13388
  }
13369
13389