@galacean/effects-threejs 2.4.5 → 2.4.7
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 +40 -74
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +2 -2
- package/dist/index.min.js.map +1 -1
- package/dist/index.mjs +40 -74
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
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.4.
|
|
6
|
+
* Version: v2.4.7
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
'use strict';
|
|
@@ -19099,8 +19099,6 @@ exports.ParticleSystem = /*#__PURE__*/ function(Component) {
|
|
|
19099
19099
|
finish = true;
|
|
19100
19100
|
}
|
|
19101
19101
|
}
|
|
19102
|
-
} else {
|
|
19103
|
-
break;
|
|
19104
19102
|
}
|
|
19105
19103
|
// @ts-expect-error
|
|
19106
19104
|
}while ((node = node.pre) && !finish);
|
|
@@ -21163,13 +21161,12 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
21163
21161
|
_this._textures = [];
|
|
21164
21162
|
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;
|
|
21165
21163
|
_this.renderer = renderer;
|
|
21166
|
-
_this._textures = scene.
|
|
21164
|
+
_this._textures = scene.textures;
|
|
21167
21165
|
var _scene_jsonScene_renderSettings_postProcessingEnabled;
|
|
21168
21166
|
_this.postProcessingEnabled = (_scene_jsonScene_renderSettings_postProcessingEnabled = (_scene_jsonScene_renderSettings = scene.jsonScene.renderSettings) == null ? void 0 : _scene_jsonScene_renderSettings.postProcessingEnabled) != null ? _scene_jsonScene_renderSettings_postProcessingEnabled : false;
|
|
21169
21167
|
_this.getEngine().renderLevel = scene.renderLevel;
|
|
21170
21168
|
if (reusable) {
|
|
21171
21169
|
_this.keepResource = true;
|
|
21172
|
-
scene.textures = undefined;
|
|
21173
21170
|
scene.consumed = true;
|
|
21174
21171
|
}
|
|
21175
21172
|
var sourceContent = scene.jsonScene.compositions[0];
|
|
@@ -26286,8 +26283,9 @@ var TextComponentBase = /*#__PURE__*/ function() {
|
|
|
26286
26283
|
this.isDirty = true;
|
|
26287
26284
|
};
|
|
26288
26285
|
/**
|
|
26289
|
-
*
|
|
26290
|
-
* @param value
|
|
26286
|
+
* 设置字体样式
|
|
26287
|
+
* @param value 设置字体样式
|
|
26288
|
+
* @default "normal"
|
|
26291
26289
|
* @returns
|
|
26292
26290
|
*/ _proto.setFontStyle = function setFontStyle(value) {
|
|
26293
26291
|
if (this.textStyle.fontStyle === value) {
|
|
@@ -27438,7 +27436,6 @@ function getStandardInteractContent(ui) {
|
|
|
27438
27436
|
var currentMaskComponent;
|
|
27439
27437
|
var componentMap = new Map();
|
|
27440
27438
|
var itemMap = new Map();
|
|
27441
|
-
var refCompositions = new Map();
|
|
27442
27439
|
/**
|
|
27443
27440
|
* 3.1 版本数据适配
|
|
27444
27441
|
* - 富文本插件名称的适配
|
|
@@ -27486,27 +27483,20 @@ var refCompositions = new Map();
|
|
|
27486
27483
|
function version32Migration(json) {
|
|
27487
27484
|
componentMap.clear();
|
|
27488
27485
|
itemMap.clear();
|
|
27489
|
-
refCompositions.clear();
|
|
27490
27486
|
var compositions = json.compositions, items = json.items, components = json.components;
|
|
27491
27487
|
// 处理旧蒙版数据
|
|
27492
|
-
var mainComp = compositions[0];
|
|
27493
27488
|
for(var _iterator = _create_for_of_iterator_helper_loose(components), _step; !(_step = _iterator()).done;){
|
|
27494
27489
|
var component = _step.value;
|
|
27495
27490
|
componentMap.set(component.id, component);
|
|
27496
27491
|
}
|
|
27497
|
-
for(var _iterator1 = _create_for_of_iterator_helper_loose(
|
|
27498
|
-
var
|
|
27499
|
-
if (comp.id === json.compositionId) {
|
|
27500
|
-
mainComp = comp;
|
|
27501
|
-
} else {
|
|
27502
|
-
refCompositions.set(comp.id, comp);
|
|
27503
|
-
}
|
|
27504
|
-
}
|
|
27505
|
-
for(var _iterator2 = _create_for_of_iterator_helper_loose(items), _step2; !(_step2 = _iterator2()).done;){
|
|
27506
|
-
var item = _step2.value;
|
|
27492
|
+
for(var _iterator1 = _create_for_of_iterator_helper_loose(items), _step1; !(_step1 = _iterator1()).done;){
|
|
27493
|
+
var item = _step1.value;
|
|
27507
27494
|
itemMap.set(item.id, item);
|
|
27508
27495
|
}
|
|
27509
|
-
|
|
27496
|
+
for(var _iterator2 = _create_for_of_iterator_helper_loose(compositions), _step2; !(_step2 = _iterator2()).done;){
|
|
27497
|
+
var comp = _step2.value;
|
|
27498
|
+
processContent(comp);
|
|
27499
|
+
}
|
|
27510
27500
|
return json;
|
|
27511
27501
|
}
|
|
27512
27502
|
function version33Migration(json) {
|
|
@@ -27591,12 +27581,6 @@ function processContent(composition) {
|
|
|
27591
27581
|
processMask(component);
|
|
27592
27582
|
}
|
|
27593
27583
|
}
|
|
27594
|
-
// 处理预合成的渲染顺序
|
|
27595
|
-
if (itemProps.type === ItemType.composition) {
|
|
27596
|
-
var refId = itemProps.content.options.refId;
|
|
27597
|
-
var comp = refCompositions.get(refId);
|
|
27598
|
-
comp && processContent(comp);
|
|
27599
|
-
}
|
|
27600
27584
|
}
|
|
27601
27585
|
}
|
|
27602
27586
|
function processMask(renderContent) {
|
|
@@ -28985,7 +28969,7 @@ var seed$1 = 1;
|
|
|
28985
28969
|
});
|
|
28986
28970
|
});
|
|
28987
28971
|
loadResourcePromise = /*#__PURE__*/ _async_to_generator(function() {
|
|
28988
|
-
var scene, link,
|
|
28972
|
+
var scene, link, _ref, jsonScene, pluginSystem, _jsonScene_bins, bins, images, fonts, _ref1, loadedBins, loadedImages, loadedTextures, totalTime;
|
|
28989
28973
|
return __generator(this, function(_state) {
|
|
28990
28974
|
switch(_state.label){
|
|
28991
28975
|
case 0:
|
|
@@ -29016,37 +29000,23 @@ var seed$1 = 1;
|
|
|
29016
29000
|
case 3:
|
|
29017
29001
|
if (!exports.Scene.isJSONObject(rawJSON)) return [
|
|
29018
29002
|
3,
|
|
29019
|
-
|
|
29003
|
+
4
|
|
29020
29004
|
];
|
|
29021
|
-
// 已经加载过的 可能需要更新数据模板
|
|
29022
29005
|
scene = _extends({}, rawJSON);
|
|
29023
|
-
jsonScene = scene.jsonScene, pluginSystem = scene.pluginSystem, loadedImages = scene.images;
|
|
29024
|
-
images = jsonScene.images;
|
|
29025
|
-
_this.assignImagesToAssets(images, loadedImages);
|
|
29026
|
-
return [
|
|
29027
|
-
4,
|
|
29028
|
-
Promise.all([
|
|
29029
|
-
hookTimeInfo("plugin:processAssets", function() {
|
|
29030
|
-
return _this.processPluginAssets(jsonScene, pluginSystem, options);
|
|
29031
|
-
})
|
|
29032
|
-
])
|
|
29033
|
-
];
|
|
29034
|
-
case 4:
|
|
29035
|
-
_state.sent();
|
|
29036
29006
|
return [
|
|
29037
29007
|
3,
|
|
29038
|
-
|
|
29008
|
+
9
|
|
29039
29009
|
];
|
|
29040
|
-
case
|
|
29010
|
+
case 4:
|
|
29041
29011
|
return [
|
|
29042
29012
|
4,
|
|
29043
29013
|
hookTimeInfo("processJSON", function() {
|
|
29044
29014
|
return _this.processJSON(rawJSON);
|
|
29045
29015
|
})
|
|
29046
29016
|
];
|
|
29047
|
-
case
|
|
29048
|
-
_ref = _state.sent(),
|
|
29049
|
-
_jsonScene_bins =
|
|
29017
|
+
case 5:
|
|
29018
|
+
_ref = _state.sent(), jsonScene = _ref.jsonScene, pluginSystem = _ref.pluginSystem;
|
|
29019
|
+
_jsonScene_bins = jsonScene.bins, bins = _jsonScene_bins === void 0 ? [] : _jsonScene_bins, images = jsonScene.images, fonts = jsonScene.fonts;
|
|
29050
29020
|
return [
|
|
29051
29021
|
4,
|
|
29052
29022
|
Promise.all([
|
|
@@ -29054,48 +29024,50 @@ var seed$1 = 1;
|
|
|
29054
29024
|
return _this.processBins(bins);
|
|
29055
29025
|
}),
|
|
29056
29026
|
hookTimeInfo("processImages", function() {
|
|
29057
|
-
return _this.processImages(
|
|
29027
|
+
return _this.processImages(images, compressedTexture);
|
|
29058
29028
|
}),
|
|
29059
29029
|
hookTimeInfo("plugin:processAssets", function() {
|
|
29060
|
-
return _this.processPluginAssets(
|
|
29030
|
+
return _this.processPluginAssets(jsonScene, pluginSystem, options);
|
|
29061
29031
|
}),
|
|
29062
29032
|
hookTimeInfo("processFontURL", function() {
|
|
29063
29033
|
return _this.processFontURL(fonts);
|
|
29064
29034
|
})
|
|
29065
29035
|
])
|
|
29066
29036
|
];
|
|
29067
|
-
case
|
|
29068
|
-
_ref1 = _state.sent(), loadedBins = _ref1[0],
|
|
29037
|
+
case 6:
|
|
29038
|
+
_ref1 = _state.sent(), loadedBins = _ref1[0], loadedImages = _ref1[1];
|
|
29069
29039
|
return [
|
|
29070
29040
|
4,
|
|
29071
29041
|
hookTimeInfo("processTextures", function() {
|
|
29072
|
-
return _this.processTextures(
|
|
29042
|
+
return _this.processTextures(loadedImages, loadedBins, jsonScene);
|
|
29073
29043
|
})
|
|
29074
29044
|
];
|
|
29075
|
-
case
|
|
29045
|
+
case 7:
|
|
29076
29046
|
loadedTextures = _state.sent();
|
|
29077
29047
|
scene = {
|
|
29078
29048
|
timeInfos: timeInfos,
|
|
29079
29049
|
url: url,
|
|
29080
29050
|
renderLevel: _this.options.renderLevel,
|
|
29081
29051
|
storage: {},
|
|
29082
|
-
pluginSystem:
|
|
29083
|
-
jsonScene:
|
|
29052
|
+
pluginSystem: pluginSystem,
|
|
29053
|
+
jsonScene: jsonScene,
|
|
29084
29054
|
bins: loadedBins,
|
|
29085
|
-
|
|
29086
|
-
|
|
29055
|
+
textureOptions: loadedTextures,
|
|
29056
|
+
textures: [],
|
|
29057
|
+
images: loadedImages,
|
|
29058
|
+
assets: _this.assets
|
|
29087
29059
|
};
|
|
29088
29060
|
// 触发插件系统 pluginSystem 的回调 prepareResource
|
|
29089
29061
|
return [
|
|
29090
29062
|
4,
|
|
29091
29063
|
hookTimeInfo("plugin:prepareResource", function() {
|
|
29092
|
-
return
|
|
29064
|
+
return pluginSystem.loadResources(scene, _this.options);
|
|
29093
29065
|
})
|
|
29094
29066
|
];
|
|
29095
|
-
case
|
|
29067
|
+
case 8:
|
|
29096
29068
|
_state.sent();
|
|
29097
|
-
_state.label =
|
|
29098
|
-
case
|
|
29069
|
+
_state.label = 9;
|
|
29070
|
+
case 9:
|
|
29099
29071
|
totalTime = performance.now() - startTime;
|
|
29100
29072
|
logger.info("Load asset: totalTime: " + totalTime.toFixed(4) + "ms " + timeInfoMessages.join(" ") + ", url: " + assetUrl + ".");
|
|
29101
29073
|
window.clearTimeout(loadTimer);
|
|
@@ -29690,16 +29662,10 @@ function createTextureOptionsBySource(image, sourceFrom, id) {
|
|
|
29690
29662
|
};
|
|
29691
29663
|
_proto.initializeTexture = function initializeTexture(scene) {
|
|
29692
29664
|
for(var i = 0; i < scene.textureOptions.length; i++){
|
|
29693
|
-
|
|
29694
|
-
|
|
29695
|
-
|
|
29696
|
-
|
|
29697
|
-
textureOptions = this.engine.findObject({
|
|
29698
|
-
id: scene.textureOptions[i].id
|
|
29699
|
-
});
|
|
29700
|
-
scene.textureOptions[i] = textureOptions;
|
|
29701
|
-
}
|
|
29702
|
-
textureOptions.initialize();
|
|
29665
|
+
scene.textures[i] = this.engine.findObject({
|
|
29666
|
+
id: scene.textureOptions[i].id
|
|
29667
|
+
});
|
|
29668
|
+
scene.textures[i].initialize();
|
|
29703
29669
|
}
|
|
29704
29670
|
};
|
|
29705
29671
|
_proto.prepareAssets = function prepareAssets(scene, assets) {
|
|
@@ -31684,7 +31650,7 @@ registerPlugin("sprite", SpriteLoader, exports.VFXItem);
|
|
|
31684
31650
|
registerPlugin("particle", ParticleLoader, exports.VFXItem);
|
|
31685
31651
|
registerPlugin("cal", CalculateLoader, exports.VFXItem);
|
|
31686
31652
|
registerPlugin("interact", InteractLoader, exports.VFXItem);
|
|
31687
|
-
var version$1 = "2.4.
|
|
31653
|
+
var version$1 = "2.4.7";
|
|
31688
31654
|
logger.info("Core version: " + version$1 + ".");
|
|
31689
31655
|
|
|
31690
31656
|
var _obj;
|
|
@@ -33286,7 +33252,7 @@ setMaxSpriteMeshItemCount(8);
|
|
|
33286
33252
|
*/ Mesh.create = function(engine, props) {
|
|
33287
33253
|
return new ThreeMesh(engine, props);
|
|
33288
33254
|
};
|
|
33289
|
-
var version = "2.4.
|
|
33255
|
+
var version = "2.4.7";
|
|
33290
33256
|
logger.info("THREEJS plugin version: " + version + ".");
|
|
33291
33257
|
|
|
33292
33258
|
exports.AbstractPlugin = AbstractPlugin;
|