@galacean/effects-threejs 2.5.2 → 2.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * Description: Galacean Effects runtime threejs plugin for the web
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 燃然,飂兮,十弦,云垣,茂安,意绮
6
- * Version: v2.5.2
6
+ * Version: v2.5.4
7
7
  */
8
8
 
9
9
  'use strict';
@@ -5949,8 +5949,8 @@ function initGLContext() {
5949
5949
  copy(WebGLRenderingContext);
5950
5950
  copy(WebGLRenderingContext.prototype);
5951
5951
  } else {
5952
- initErrors.push(// iOS 16 lockdown mode
5953
- "iOS16 lockdown mode, WebGL Constants not in global");
5952
+ initErrors.push(isIOS() ? // iOS 16 lockdown mode
5953
+ "iOS16 lockdown mode, WebGL Constants not in global" : "WebGL Constants not in global, please check your environment");
5954
5954
  }
5955
5955
  if (!initErrors.length && !("HALF_FLOAT" in glContext)) {
5956
5956
  // @ts-expect-error set default value
@@ -6570,7 +6570,9 @@ function _loadVideo() {
6570
6570
  return [
6571
6571
  2,
6572
6572
  new Promise(function(resolve, reject) {
6573
- var pending = video.play();
6573
+ var pending = video.play().catch(function(e) {
6574
+ reject(e);
6575
+ });
6574
6576
  if (pending) {
6575
6577
  void pending.then(function() {
6576
6578
  return resolve(video);
@@ -14312,7 +14314,11 @@ function buildEasingCurve(leftKeyframe, rightKeyframe) {
14312
14314
  if (BezierMap[str]) {
14313
14315
  bezEasing = BezierMap[str];
14314
14316
  } else {
14315
- bezEasing = new BezierEasing(x1, y1, x2, y2);
14317
+ if (decimalEqual(valueInterval, 0)) {
14318
+ bezEasing = new BezierEasing();
14319
+ } else {
14320
+ bezEasing = new BezierEasing(x1, y1, x2, y2);
14321
+ }
14316
14322
  BezierMap[str] = bezEasing;
14317
14323
  }
14318
14324
  return {
@@ -21454,8 +21460,6 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
21454
21460
  /**
21455
21461
  * 是否开启后处理
21456
21462
  */ _this.postProcessingEnabled = false;
21457
- // TODO: 待优化
21458
- _this.assigned = false;
21459
21463
  /**
21460
21464
  * 销毁状态位
21461
21465
  */ _this.destroyed = false;
@@ -21521,7 +21525,6 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
21521
21525
  aspect: width / height
21522
21526
  }));
21523
21527
  _this.url = scene.url;
21524
- _this.assigned = true;
21525
21528
  _this.interactive = true;
21526
21529
  _this.handleItemMessage = handleItemMessage;
21527
21530
  _this.createRenderFrame();
@@ -21693,7 +21696,7 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
21693
21696
  * 合成更新,针对所有 item 的更新
21694
21697
  * @param deltaTime - 更新的时间步长
21695
21698
  */ _proto.update = function update(deltaTime) {
21696
- if (!this.assigned || this.getPaused()) {
21699
+ if (this.getPaused()) {
21697
21700
  return;
21698
21701
  }
21699
21702
  // scene VFXItem components lifetime function.
@@ -26401,14 +26404,10 @@ var TextComponentBase = /*#__PURE__*/ function() {
26401
26404
  _proto.getLineCount = function getLineCount(text, init) {
26402
26405
  var context = this.context;
26403
26406
  var _this_textLayout = this.textLayout, letterSpace = _this_textLayout.letterSpace, overflow = _this_textLayout.overflow;
26404
- var fontScale = init ? this.textStyle.fontSize / 10 : 1 / this.textStyle.fontScale;
26405
- var width = this.textLayout.width + this.textStyle.fontOffset;
26407
+ var fontScale = init ? this.textStyle.fontSize / 10 * this.textStyle.fontScale : this.textStyle.fontScale;
26408
+ var width = (this.textLayout.width + this.textStyle.fontOffset) * this.textStyle.fontScale;
26406
26409
  var lineCount = 1;
26407
26410
  var x = 0;
26408
- //设置context.font的字号
26409
- // if (context) {
26410
- // context.font = this.getFontDesc(this.textStyle.fontSize);
26411
- // }
26412
26411
  for(var i = 0; i < text.length; i++){
26413
26412
  var _context_measureText;
26414
26413
  var str = text[i];
@@ -28597,7 +28596,7 @@ function getStandardSpriteContent(sprite, transform) {
28597
28596
  return ret;
28598
28597
  }
28599
28598
 
28600
- var version$2 = "2.5.2";
28599
+ var version$2 = "2.5.4";
28601
28600
  var v0 = /^(\d+)\.(\d+)\.(\d+)(-(\w+)\.\d+)?$/;
28602
28601
  var standardVersion = /^(\d+)\.(\d+)$/;
28603
28602
  var reverseParticle = false;
@@ -31847,7 +31846,7 @@ registerPlugin("sprite", SpriteLoader, exports.VFXItem);
31847
31846
  registerPlugin("particle", ParticleLoader, exports.VFXItem);
31848
31847
  registerPlugin("cal", CalculateLoader, exports.VFXItem);
31849
31848
  registerPlugin("interact", InteractLoader, exports.VFXItem);
31850
- var version$1 = "2.5.2";
31849
+ var version$1 = "2.5.4";
31851
31850
  logger.info("Core version: " + version$1 + ".");
31852
31851
 
31853
31852
  var _obj;
@@ -33449,7 +33448,7 @@ setMaxSpriteMeshItemCount(8);
33449
33448
  */ Mesh.create = function(engine, props) {
33450
33449
  return new ThreeMesh(engine, props);
33451
33450
  };
33452
- var version = "2.5.2";
33451
+ var version = "2.5.4";
33453
33452
  logger.info("THREEJS plugin version: " + version + ".");
33454
33453
 
33455
33454
  exports.AbstractPlugin = AbstractPlugin;