@galacean/effects-threejs 2.5.0-alpha.2 → 2.5.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.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.0-alpha.2
6
+ * Version: v2.5.0-alpha.3
7
7
  */
8
8
 
9
9
  'use strict';
@@ -12893,16 +12893,17 @@ var singleSplits = [
12893
12893
  };
12894
12894
  this.configureMaterial(this.renderer);
12895
12895
  if (baseRenderComponentData.geometry) {
12896
- this.geometry = this.engine.findObject(baseRenderComponentData.geometry);
12896
+ var baseGeometry = this.engine.findObject(baseRenderComponentData.geometry);
12897
12897
  var uvTransform = baseRenderComponentData.splits && !baseRenderComponentData.textureSheetAnimation ? baseRenderComponentData.splits[0] : singleSplits[0];
12898
12898
  var x = uvTransform[0];
12899
12899
  var y = uvTransform[1];
12900
12900
  var isRotate90 = uvTransform[4];
12901
12901
  var width = isRotate90 ? uvTransform[3] : uvTransform[2];
12902
12902
  var height = isRotate90 ? uvTransform[2] : uvTransform[3];
12903
- var aUV = this.geometry.getAttributeData("aUV");
12904
- var aPos = this.geometry.getAttributeData("aPos");
12905
- if (aUV && aPos) {
12903
+ var aUV = baseGeometry.getAttributeData("aUV");
12904
+ var aPos = baseGeometry.getAttributeData("aPos");
12905
+ var indices = baseGeometry.getIndexData();
12906
+ if (aUV && aPos && indices) {
12906
12907
  var vertexCount = aUV.length / 2;
12907
12908
  for(var i = 0; i < vertexCount; i++){
12908
12909
  var positionOffset = i * 3;
@@ -12912,6 +12913,19 @@ var singleSplits = [
12912
12913
  aUV[uvOffset] = (positionX + 0.5) * width + x;
12913
12914
  aUV[uvOffset + 1] = (positionY + 0.5) * height + y;
12914
12915
  }
12916
+ this.geometry.setAttributeData("aPos", aPos.slice());
12917
+ this.geometry.setAttributeData("aUV", aUV.slice());
12918
+ this.geometry.setIndexData(indices.slice());
12919
+ this.geometry.setDrawCount(indices.length);
12920
+ }
12921
+ this.geometry.subMeshes.length = 0;
12922
+ for(var _iterator = _create_for_of_iterator_helper_loose(baseGeometry.subMeshes), _step; !(_step = _iterator()).done;){
12923
+ var subMesh = _step.value;
12924
+ this.geometry.subMeshes.push({
12925
+ offset: subMesh.offset,
12926
+ indexCount: subMesh.indexCount,
12927
+ vertexCount: subMesh.vertexCount
12928
+ });
12915
12929
  }
12916
12930
  } else {
12917
12931
  this.geometry = this.defaultGeometry;
@@ -21270,7 +21284,6 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
21270
21284
  /**
21271
21285
  * 合成暂停/播放 标识
21272
21286
  */ _this.paused = false;
21273
- _this.lastVideoUpdateTime = 0;
21274
21287
  _this.isEndCalled = false;
21275
21288
  _this._textures = [];
21276
21289
  var _props_reusable = props.reusable, reusable = _props_reusable === void 0 ? false : _props_reusable, _props_speed = props.speed, speed = _props_speed === void 0 ? 1 : _props_speed, _props_baseRenderOrder = props.baseRenderOrder, baseRenderOrder = _props_baseRenderOrder === void 0 ? 0 : _props_baseRenderOrder, renderer = props.renderer, event = props.event, width = props.width, height = props.height, handleItemMessage = props.handleItemMessage;
@@ -21512,7 +21525,6 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
21512
21525
  var previousCompositionTime = this.time;
21513
21526
  this.updateCompositionTime(deltaTime * this.speed / 1000);
21514
21527
  var deltaTimeInMs = (this.time - previousCompositionTime) * 1000;
21515
- this.updateVideo();
21516
21528
  // 更新 model-tree-plugin
21517
21529
  this.updatePluginLoaders(deltaTimeInMs);
21518
21530
  this.sceneTicking.update.tick(deltaTimeInMs);
@@ -21546,20 +21558,6 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
21546
21558
  }
21547
21559
  };
21548
21560
  /**
21549
- * 更新视频数据到纹理
21550
- * @override
21551
- */ _proto.updateVideo = function updateVideo() {
21552
- var now = performance.now();
21553
- // 视频固定30帧更新
21554
- if (now - this.lastVideoUpdateTime > 33) {
21555
- var _this_textures;
21556
- ((_this_textures = this.textures) != null ? _this_textures : []).forEach(function(tex) {
21557
- return tex == null ? void 0 : tex.uploadCurrentVideoFrame();
21558
- });
21559
- this.lastVideoUpdateTime = now;
21560
- }
21561
- };
21562
- /**
21563
21561
  * 更新相机
21564
21562
  * @override
21565
21563
  */ _proto.updateCamera = function updateCamera() {
@@ -22819,6 +22817,7 @@ exports.SpriteComponent = /*#__PURE__*/ function(BaseRenderComponent) {
22819
22817
  _this.engine.renderErrors.add(e);
22820
22818
  });
22821
22819
  }
22820
+ this.renderer.texture.uploadCurrentVideoFrame();
22822
22821
  }
22823
22822
  if (ta) {
22824
22823
  var _this_material_getVector4;
@@ -26832,10 +26831,10 @@ var SerializationHelper = /*#__PURE__*/ function() {
26832
26831
  }
26833
26832
  var _proto = AssetLoader.prototype;
26834
26833
  _proto.loadGUID = function loadGUID(dataPath) {
26835
- var guid = dataPath.id;
26836
26834
  if (!dataPath) {
26837
26835
  return null;
26838
26836
  }
26837
+ var guid = dataPath.id;
26839
26838
  var effectsObjectData = this.findData(guid);
26840
26839
  var effectsObject;
26841
26840
  if (!effectsObjectData) {
@@ -28415,7 +28414,7 @@ function getStandardSpriteContent(sprite, transform) {
28415
28414
  return ret;
28416
28415
  }
28417
28416
 
28418
- var version$2 = "2.5.0-alpha.2";
28417
+ var version$2 = "2.5.0-alpha.3";
28419
28418
  var v0 = /^(\d+)\.(\d+)\.(\d+)(-(\w+)\.\d+)?$/;
28420
28419
  var standardVersion = /^(\d+)\.(\d+)$/;
28421
28420
  var reverseParticle = false;
@@ -31665,7 +31664,7 @@ registerPlugin("sprite", SpriteLoader, exports.VFXItem);
31665
31664
  registerPlugin("particle", ParticleLoader, exports.VFXItem);
31666
31665
  registerPlugin("cal", CalculateLoader, exports.VFXItem);
31667
31666
  registerPlugin("interact", InteractLoader, exports.VFXItem);
31668
- var version$1 = "2.5.0-alpha.2";
31667
+ var version$1 = "2.5.0-alpha.3";
31669
31668
  logger.info("Core version: " + version$1 + ".");
31670
31669
 
31671
31670
  var _obj;
@@ -33267,7 +33266,7 @@ setMaxSpriteMeshItemCount(8);
33267
33266
  */ Mesh.create = function(engine, props) {
33268
33267
  return new ThreeMesh(engine, props);
33269
33268
  };
33270
- var version = "2.5.0-alpha.2";
33269
+ var version = "2.5.0-alpha.3";
33271
33270
  logger.info("THREEJS plugin version: " + version + ".");
33272
33271
 
33273
33272
  exports.AbstractPlugin = AbstractPlugin;