@galacean/effects-threejs 1.4.0-beta.1 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -3,7 +3,7 @@
3
3
  * Description: Galacean Effects runtime threejs plugin for the web
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 燃然,飂兮,十弦,云垣,茂安,意绮
6
- * Version: v1.4.0-beta.1
6
+ * Version: v1.4.1
7
7
  */
8
8
 
9
9
  import * as THREE from 'three';
@@ -684,7 +684,7 @@ function asserts(condition, msg) {
684
684
  * Name: @galacean/effects-specification
685
685
  * Description: Galacean Effects JSON Specification
686
686
  * Author: Ant Group CO., Ltd.
687
- * Version: v1.2.0-beta.0
687
+ * Version: v1.2.0
688
688
  */
689
689
 
690
690
  /*********************************************/
@@ -8275,7 +8275,7 @@ var map$1 = (_a$5 = {},
8275
8275
  },
8276
8276
  _a$5[ValueType$1.BEZIER_CURVE_PATH] = function (props) {
8277
8277
  if (props[0].length === 1) {
8278
- return new StaticValue(new Vector3(props[0][0][1][1], props[1][0][1][1], props[2][0][1][1]));
8278
+ return new StaticValue(new (Vector3.bind.apply(Vector3, __spreadArray$2([void 0], __read$3(props[1][0]), false)))());
8279
8279
  }
8280
8280
  return new BezierCurvePath(props);
8281
8281
  },
@@ -9938,9 +9938,7 @@ var CameraController = /** @class */ (function () {
9938
9938
  position.z += translateOverLifetime.z.getValue(lifetime);
9939
9939
  if (translateOverLifetime.path) {
9940
9940
  var val = translateOverLifetime.path.getValue(lifetime);
9941
- position.x += val[0];
9942
- position.y += val[1];
9943
- position.z += val[2];
9941
+ position.add(val);
9944
9942
  }
9945
9943
  }
9946
9944
  if (rotationOverLifetime) {
@@ -21866,7 +21864,7 @@ var filters = {
21866
21864
  * Name: @galacean/effects-specification
21867
21865
  * Description: Galacean Effects JSON Specification
21868
21866
  * Author: Ant Group CO., Ltd.
21869
- * Version: v1.2.0-beta.0
21867
+ * Version: v1.2.0
21870
21868
  */
21871
21869
 
21872
21870
  /*********************************************/
@@ -23355,6 +23353,9 @@ function version24Migration(json) {
23355
23353
  }
23356
23354
  function convertParam(content) {
23357
23355
  var e_2, _a;
23356
+ if (!content) {
23357
+ return;
23358
+ }
23358
23359
  try {
23359
23360
  for (var _b = __values(Object.keys(content)), _c = _b.next(); !_c.done; _c = _b.next()) {
23360
23361
  var key = _c.value;
@@ -24525,18 +24526,14 @@ var CompVFXItem = /** @class */ (function (_super) {
24525
24526
  // 设置预合成作为元素时的时长、结束行为和渲染延时
24526
24527
  if (Item.isComposition(itemProps)) {
24527
24528
  var refId = itemProps.content.options.refId;
24528
- var props = this.composition.refCompositionProps.get(refId);
24529
- if (!props) {
24530
- throw new Error("\u5F15\u7528\u7684Id: ".concat(refId, " \u7684\u9884\u5408\u6210\u4E0D\u5B58\u5728"));
24531
- }
24532
- props.content = itemProps.content;
24533
- item = new CompVFXItem(__assign$1(__assign$1({}, props), { refId: refId, delay: itemProps.delay, id: itemProps.id, name: itemProps.name, duration: itemProps.duration, endBehavior: itemProps.endBehavior, parentId: itemProps.parentId, transform: itemProps.transform }), this.composition);
24529
+ item = new CompVFXItem(__assign$1({ refId: refId }, itemProps), this.composition);
24534
24530
  item.contentProps = itemProps.content;
24535
24531
  item.transform.parentTransform = this.transform;
24536
24532
  this.composition.refContent.push(item);
24537
24533
  if (item.endBehavior === END_BEHAVIOR_RESTART$1) {
24538
24534
  this.composition.autoRefTex = false;
24539
24535
  }
24536
+ item.createContent();
24540
24537
  }
24541
24538
  else {
24542
24539
  item = createVFXItem(this.itemProps[i], this.composition);
@@ -24668,6 +24665,17 @@ var CompVFXItem = /** @class */ (function (_super) {
24668
24665
  CompVFXItem.prototype.handleVisibleChanged = function (visible) {
24669
24666
  this.items.forEach(function (item) { return item.setVisible(visible); });
24670
24667
  };
24668
+ CompVFXItem.prototype.setScale = function (x, y, z) {
24669
+ if (this.content) {
24670
+ this.content.startSize = new Vector3(x, y, z);
24671
+ }
24672
+ };
24673
+ CompVFXItem.prototype.scale = function (x, y, z) {
24674
+ if (this.content) {
24675
+ var startSize = this.content.startSize.clone();
24676
+ this.content.startSize = new Vector3(x * startSize.x, y * startSize.y, z * startSize.z);
24677
+ }
24678
+ };
24671
24679
  CompVFXItem.prototype.getUpdateTime = function (t) {
24672
24680
  var startTime = this.startTimeInms;
24673
24681
  var now = this.timeInms;
@@ -27369,7 +27377,7 @@ Geometry.create = function (engine, options) {
27369
27377
  Mesh.create = function (engine, props) {
27370
27378
  return new ThreeMesh(engine, props);
27371
27379
  };
27372
- var version = "1.4.0-beta.1";
27380
+ var version = "1.4.1";
27373
27381
  logger.info('THREEJS plugin version: ' + version);
27374
27382
 
27375
27383
  export { AbstractPlugin, AssetManager, BYTES_TYPE_MAP, BezierCurve, BezierCurvePath, COMPRESSED_TEXTURE, CONSTANT_MAP_BLEND, CONSTANT_MAP_DEPTH, CONSTANT_MAP_STENCIL_FUNC, CONSTANT_MAP_STENCIL_OP, COPY_FRAGMENT_SHADER, COPY_MESH_SHADER_ID, COPY_VERTEX_SHADER, CalculateItem, CalculateLoader, CalculateVFXItem, Camera, CameraController, CameraVFXItem, CameraVFXItemLoader, Composition, CompositionSourceManager, DEFAULT_FONTS, DestroyOptions, Downloader, EFFECTS_COPY_MESH_NAME, EVENT_TYPE_CLICK, EVENT_TYPE_TOUCH_END, EVENT_TYPE_TOUCH_MOVE, EVENT_TYPE_TOUCH_START, Engine, EventSystem, FILTER_NAME_NONE, FilterMode, FilterSpriteVFXItem, Float16ArrayWrapper, FrameBuffer, GLSLVersion, GPUCapability, Geometry, GlobalUniforms, GradientValue, HELP_LINK, HitTestType, InteractBehavior$1 as InteractBehavior, InteractItem, InteractLoader, InteractMesh, InteractVFXItem, Item, KTXTexture, LineSegments, LinearValue, Material, MaterialDataBlock, MaterialRenderType, Mesh, OrderType, PLAYER_OPTIONS_ENV_EDITOR, POST_PROCESS_SETTINGS, ParticleLoader, ParticleMesh, ParticleSystem, ParticleVFXItem, PassTextureCache, PluginSystem, QCanvasViewer, QText, QTextWrapMode, RENDER_PASS_NAME_PREFIX, RENDER_PREFER_LOOKUP_TEXTURE, RUNTIME_ENV, RandomSetValue, RandomValue, RandomVectorValue, RenderBuffer, RenderFrame, RenderPass, RenderPassAttachmentStorageType, RenderPassDestroyAttachmentType, RenderPassPriorityNormal, RenderPassPriorityPostprocess, RenderPassPriorityPrepare, RenderTargetHandle, RenderTextureFormat, Renderer, SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_0, SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_SIZE_0, SEMANTIC_PRE_COLOR_ATTACHMENT_0, SEMANTIC_PRE_COLOR_ATTACHMENT_SIZE_0, SPRITE_VERTEX_STRIDE, SemanticMap, Shader, ShaderCompileResultStatus, ShaderType, SpriteItem, SpriteLoader, SpriteMesh, SpriteVFXItem, StaticValue, TEMPLATE_USE_OFFSCREEN_CANVAS, TEXTURE_UNIFORM_MAP, TextItem, TextLoader, TextMesh, TextVFXItem, Texture, TextureFactory, TextureLoadAction, TextureSourceType, TextureStoreAction, ThreeComposition, ThreeDisplayObject, ThreeMaterial, ThreeTexture, Ticker, TimelineComponent, Transform, VFXItem, ValueGetter, addByOrder, addItem, addItemWithOrder, alphaFrameFrag, alphaMaskFrag, assertExist, asserts, blend, bloomMixVert, bloomThresholdVert, calculateTranslation, cameraMove_frag as cameraMoveFrag, cameraMoveVert, canvasPool, colorGradingFrag, colorStopsFromGradient, colorToArr$1 as colorToArr, combineImageTemplate, combineImageTemplate1, combineImageTemplate1Async, combineImageTemplate2, combineImageTemplate2Async, combineImageTemplateAsync, compatible_frag as compatibleFrag, compatible_vert as compatibleVert, convertAnchor, copyFrag, createCopyShader, createFilter, createFilterShaders, createGLContext, createKeyFrameMeta, createShaderWithMarcos, createShape, createVFXItem, createValueGetter, decimalEqual, deepClone, defaultGlobalVolume, defaultPlugins, delayFrag, deserializeMipmapTexture, distortionFrag, distortionVert, earcut, enlargeBuffer, ensureVec3, filters, findPreviousRenderPass, gaussianDown_frag as gaussianDownFrag, gaussianDownHFrag, gaussianDownVFrag, gaussianUpFrag, generateEmptyTypedArray, generateHalfFloatTexture, getBackgroundImage, getColorFromGradientStops, getConfig, getDefaultTemplateCanvasPool, getDefaultTextureFactory, getGeometryByShape, getGeometryTriangles, getImageItemRenderInfo, getKTXTextureOptions, getKeyFrameMetaByRawValue, getParticleMeshShader, getPixelRatio, getPreMultiAlpha, getStandardComposition, getStandardImage, getStandardItem, getStandardJSON, getTextureSize, glContext, gpuTimer, imageDataFromColor, imageDataFromGradient, initErrors, initGLContext, integrate, interpolateColor, isAndroid, isArray, isFunction, isIOS, isObject, isScene, isSimulatorCellPhone, isString, isUniformStruct, isUniformStructArray, isWebGL2, itemFrag, itemFrameFrag, itemVert, loadBinary, loadBlob, loadImage, loadMedia, loadVideo, loadWebPOptional, logger, index as math, maxSpriteMeshItemCount, maxSpriteTextureCount, modifyMaxKeyframeShader, nearestPowerOfTwo, noop, numberToFix, parsePercent$1 as parsePercent, particleFrag, particleOriginTranslateMap, particleUniformTypeMap, particleVert, pluginLoaderMap, pointOnLine, random, registerFilter, registerFilters, registerPlugin, removeItem, requestAsync, rotateVec2, screenMeshVert, setBlendMode, setConfig, setDefaultTextureFactory, setMaskMode, setMaxSpriteMeshItemCount, setRayFromCamera, setSideMode, setSpriteMeshMaxFragmentTextures, setSpriteMeshMaxItemCountByGPU, setUniformValue, sortByOrder, index$1 as spec, spriteMeshShaderFromFilter, spriteMeshShaderFromRenderInfo, spriteMeshShaderIdFromRenderInfo, thresholdFrag, throwDestroyedError, trailVert, translatePoint, trianglesFromRect, unregisterPlugin, valIfUndefined, value, valueDefine, vecAssign, vecFill, vecMulCombine, vecNormalize, version };