@galacean/effects-threejs 2.0.0-alpha.4 → 2.0.0-alpha.5
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 +18 -21
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +4 -4
- package/dist/index.min.js.map +1 -1
- package/dist/index.mjs +18 -21
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
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: v2.0.0-alpha.
|
|
6
|
+
* Version: v2.0.0-alpha.5
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import * as THREE from 'three';
|
|
@@ -6574,7 +6574,7 @@ function generateGUID$1() {
|
|
|
6574
6574
|
* Name: @galacean/effects-specification
|
|
6575
6575
|
* Description: Galacean Effects JSON Specification
|
|
6576
6576
|
* Author: Ant Group CO., Ltd.
|
|
6577
|
-
* Version: v2.0.0-alpha.
|
|
6577
|
+
* Version: v2.0.0-alpha.3
|
|
6578
6578
|
*/
|
|
6579
6579
|
|
|
6580
6580
|
typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
@@ -21108,7 +21108,7 @@ function getPluginUsageInfo(name) {
|
|
|
21108
21108
|
* Name: @galacean/effects-specification
|
|
21109
21109
|
* Description: Galacean Effects JSON Specification
|
|
21110
21110
|
* Author: Ant Group CO., Ltd.
|
|
21111
|
-
* Version: v2.0.0-alpha.
|
|
21111
|
+
* Version: v2.0.0-alpha.3
|
|
21112
21112
|
*/
|
|
21113
21113
|
|
|
21114
21114
|
const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
@@ -22643,7 +22643,7 @@ function version22Migration(json) {
|
|
|
22643
22643
|
*/
|
|
22644
22644
|
function version30Migration(json) {
|
|
22645
22645
|
var e_1, _a;
|
|
22646
|
-
var _b, _c, _d, _e;
|
|
22646
|
+
var _b, _c, _d, _e, _f, _g, _h, _j;
|
|
22647
22647
|
var result = Object.assign({}, json, {
|
|
22648
22648
|
items: [],
|
|
22649
22649
|
components: [],
|
|
@@ -22671,15 +22671,15 @@ function version30Migration(json) {
|
|
|
22671
22671
|
}
|
|
22672
22672
|
}
|
|
22673
22673
|
var _loop_1 = function (composition) {
|
|
22674
|
-
var e_2,
|
|
22674
|
+
var e_2, _m, e_3, _o;
|
|
22675
22675
|
// composition 的 endbehaviour 兼容
|
|
22676
22676
|
if (composition.endBehavior === END_BEHAVIOR_PAUSE_AND_DESTROY || composition.endBehavior === END_BEHAVIOR_PAUSE) {
|
|
22677
22677
|
composition.endBehavior = END_BEHAVIOR_FREEZE;
|
|
22678
22678
|
}
|
|
22679
22679
|
var itemGuidMap = {};
|
|
22680
22680
|
try {
|
|
22681
|
-
for (var
|
|
22682
|
-
var item =
|
|
22681
|
+
for (var _p = (e_2 = void 0, __values(composition.items)), _q = _p.next(); !_q.done; _q = _p.next()) {
|
|
22682
|
+
var item = _q.value;
|
|
22683
22683
|
itemGuidMap[item.id] = generateGUID();
|
|
22684
22684
|
// TODO: 编辑器测试用,上线后删除
|
|
22685
22685
|
//@ts-expect-error
|
|
@@ -22690,7 +22690,7 @@ function version30Migration(json) {
|
|
|
22690
22690
|
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
22691
22691
|
finally {
|
|
22692
22692
|
try {
|
|
22693
|
-
if (
|
|
22693
|
+
if (_q && !_q.done && (_m = _p.return)) _m.call(_p);
|
|
22694
22694
|
}
|
|
22695
22695
|
finally { if (e_2) throw e_2.error; }
|
|
22696
22696
|
}
|
|
@@ -22711,8 +22711,8 @@ function version30Migration(json) {
|
|
|
22711
22711
|
composition.items[index] = { id: item.id };
|
|
22712
22712
|
});
|
|
22713
22713
|
try {
|
|
22714
|
-
for (var
|
|
22715
|
-
var item =
|
|
22714
|
+
for (var _r = (e_3 = void 0, __values(result.items)), _s = _r.next(); !_s.done; _s = _r.next()) {
|
|
22715
|
+
var item = _s.value;
|
|
22716
22716
|
// 原 texture 索引转为统一 guid 索引
|
|
22717
22717
|
if (item.content) {
|
|
22718
22718
|
if (item.content.renderer) {
|
|
@@ -22761,13 +22761,10 @@ function version30Migration(json) {
|
|
|
22761
22761
|
var startSize = item.transform.size;
|
|
22762
22762
|
// 兼容旧JSON(anchor和particleOrigin可能同时存在)
|
|
22763
22763
|
if (!renderer.anchor && renderer.particleOrigin !== undefined) {
|
|
22764
|
-
|
|
22765
|
-
item.transform.position.
|
|
22766
|
-
//@ts-expect-error
|
|
22767
|
-
item.transform.position.y += -realAnchor[1] * startSize.y;
|
|
22764
|
+
item.transform.position.x += -realAnchor[0] * ((_f = startSize === null || startSize === void 0 ? void 0 : startSize.x) !== null && _f !== void 0 ? _f : 1);
|
|
22765
|
+
item.transform.position.y += -realAnchor[1] * ((_g = startSize === null || startSize === void 0 ? void 0 : startSize.y) !== null && _g !== void 0 ? _g : 1);
|
|
22768
22766
|
}
|
|
22769
|
-
|
|
22770
|
-
item.transform.anchor = { x: realAnchor[0] * startSize.x, y: realAnchor[1] * startSize.y };
|
|
22767
|
+
item.transform.anchor = { x: realAnchor[0] * ((_h = startSize === null || startSize === void 0 ? void 0 : startSize.x) !== null && _h !== void 0 ? _h : 1), y: realAnchor[1] * ((_j = startSize === null || startSize === void 0 ? void 0 : startSize.y) !== null && _j !== void 0 ? _j : 1) };
|
|
22771
22768
|
}
|
|
22772
22769
|
}
|
|
22773
22770
|
if (item.type === ItemType.particle) {
|
|
@@ -22919,22 +22916,22 @@ function version30Migration(json) {
|
|
|
22919
22916
|
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
22920
22917
|
finally {
|
|
22921
22918
|
try {
|
|
22922
|
-
if (
|
|
22919
|
+
if (_s && !_s.done && (_o = _r.return)) _o.call(_r);
|
|
22923
22920
|
}
|
|
22924
22921
|
finally { if (e_3) throw e_3.error; }
|
|
22925
22922
|
}
|
|
22926
22923
|
};
|
|
22927
22924
|
try {
|
|
22928
22925
|
// 更正Composition.endBehavior
|
|
22929
|
-
for (var
|
|
22930
|
-
var composition =
|
|
22926
|
+
for (var _k = __values(json.compositions), _l = _k.next(); !_l.done; _l = _k.next()) {
|
|
22927
|
+
var composition = _l.value;
|
|
22931
22928
|
_loop_1(composition);
|
|
22932
22929
|
}
|
|
22933
22930
|
}
|
|
22934
22931
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
22935
22932
|
finally {
|
|
22936
22933
|
try {
|
|
22937
|
-
if (
|
|
22934
|
+
if (_l && !_l.done && (_a = _k.return)) _a.call(_k);
|
|
22938
22935
|
}
|
|
22939
22936
|
finally { if (e_1) throw e_1.error; }
|
|
22940
22937
|
}
|
|
@@ -28092,7 +28089,7 @@ Geometry.create = function (engine, options) {
|
|
|
28092
28089
|
Mesh.create = function (engine, props) {
|
|
28093
28090
|
return new ThreeMesh(engine, props);
|
|
28094
28091
|
};
|
|
28095
|
-
var version = "2.0.0-alpha.
|
|
28092
|
+
var version = "2.0.0-alpha.5";
|
|
28096
28093
|
logger.info('THREEJS plugin version: ' + version);
|
|
28097
28094
|
|
|
28098
28095
|
export { AbstractPlugin, ActivationPlayable, AssetLoader, AssetManager, BYTES_TYPE_MAP, Behaviour, BezierSegments, 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, CalculateLoader, Camera, CameraController, CameraVFXItemLoader, Component, Composition, CompositionComponent, CompositionSourceManager, CurveValue, DEFAULT_FONTS, DataType$1 as DataType, Database, DestroyOptions, Downloader, EFFECTS_COPY_MESH_NAME, EVENT_TYPE_CLICK, EVENT_TYPE_TOUCH_END, EVENT_TYPE_TOUCH_MOVE, EVENT_TYPE_TOUCH_START, EffectComponent, EffectsObject, Engine, EventSystem, FILTER_NAME_NONE, FilterMode, Float16ArrayWrapper, FrameBuffer, GLSLVersion, GPUCapability, Geometry, GlobalUniforms, GradientValue, HELP_LINK, HitTestType, InteractBehavior$1 as InteractBehavior, InteractComponent, InteractLoader, InteractMesh, Item, ItemBehaviour, KTXTexture, LineSegments, LinearValue, Material, MaterialDataBlock, MaterialRenderType, Mesh, OrderType, PLAYER_OPTIONS_ENV_EDITOR, POST_PROCESS_SETTINGS, ParticleBehaviourPlayable, ParticleLoader, ParticleMesh, ParticleSystem, ParticleSystemRenderer, PassTextureCache, PathSegments, 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, RendererComponent, 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, SerializationHelper, Shader, ShaderCompileResultStatus, ShaderType, ShaderVariant, SpriteColorPlayable, SpriteComponent, SpriteLoader, StaticValue, TEMPLATE_USE_OFFSCREEN_CANVAS, TEXTURE_UNIFORM_MAP, TextComponent, TextLoader, Texture, TextureFactory, TextureLoadAction, TextureSourceType, TextureStoreAction, ThreeComposition, ThreeDisplayObject, ThreeEngine, ThreeMaterial, ThreeSpriteComponent, ThreeTexture, Ticker, TimelineClip, TimelineComponent, Track, Transform, TransformAnimationPlayable, TransformAnimationPlayableAsset, VFXItem, ValueGetter, addByOrder, addItem, addItemWithOrder, alphaFrame_frag as alphaFrameFrag, alphaMask_frag as alphaMaskFrag, assertExist, asserts, blend, bloomMix_frag as bloomMixVert, bloomThreshold_frag as bloomThresholdVert, calculateTranslation, cameraMove_frag as cameraMoveFrag, cameraMove_vert as cameraMoveVert, canvasPool, colorGradingFrag, colorStopsFromGradient, colorToArr$1 as colorToArr, combineImageTemplate, combineImageTemplate1, combineImageTemplate1Async, combineImageTemplate2, combineImageTemplate2Async, combineImageTemplateAsync, compatible_frag as compatibleFrag, compatible_vert as compatibleVert, copy as copyFrag, createCopyShader, createGLContext, createKeyFrameMeta, createShaderWithMarcos, createShape, createVFXItem, createValueGetter, deepClone, defaultGlobalVolume, defaultPlugins, delay_frag as delayFrag, deserializeMipmapTexture, distortion_frag as distortionFrag, distortion_vert as distortionVert, earcut, effectsClass, effectsClassStore, enlargeBuffer, ensureVec3, findPreviousRenderPass, gaussianDown_frag as gaussianDownFrag, gaussianDownHFrag, gaussianDownVFrag, gaussianUpFrag, generateEmptyTypedArray, generateGUID$1 as generateGUID, generateHalfFloatTexture, getBackgroundImage, getColorFromGradientStops, getConfig, getDefaultTemplateCanvasPool, getDefaultTextureFactory, getGeometryByShape, getGeometryTriangles, getImageItemRenderInfo, getKTXTextureOptions, getKeyFrameMetaByRawValue, getMergedStore, getParticleMeshShader, getPixelRatio, getPreMultiAlpha, getStandardComposition, getStandardImage, getStandardItem, getStandardJSON, getTextureSize, glContext, gpuTimer, imageDataFromColor, imageDataFromGradient, initErrors, initGLContext, integrate, interpolateColor, isAndroid, isArray, isFunction, isIOS, isObject, isScene, isSceneWithOptions, isSimulatorCellPhone, isString, isUniformStruct, isUniformStructArray, isWebGL2, item_define as itemDefine, itemFrag, itemFrameFrag, itemVert, loadBinary, loadBlob, loadImage, loadVideo, loadWebPOptional, logger, index$1 as math, maxSpriteMeshItemCount, maxSpriteTextureCount, modifyMaxKeyframeShader, nearestPowerOfTwo, noop, parsePercent$1 as parsePercent, particleFrag, particleOriginTranslateMap$1 as particleOriginTranslateMap, particleVert, pluginLoaderMap, random, registerPlugin, removeItem, requestAsync, rotateVec2, screenMeshVert, serialize, setBlendMode, setConfig, setDefaultTextureFactory, setMaskMode, setMaxSpriteMeshItemCount, setRayFromCamera, setSideMode, setSpriteMeshMaxFragmentTextures, setSpriteMeshMaxItemCountByGPU, setUniformValue, sortByOrder, index as spec, spriteMeshShaderFromFilter, spriteMeshShaderFromRenderInfo, spriteMeshShaderIdFromRenderInfo, thresholdFrag, throwDestroyedError, trailVert, translatePoint, trianglesFromRect, unregisterPlugin, valIfUndefined, value, valueDefine, vecAssign, vecFill, vecMulCombine, vecNormalize, version };
|