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