@galacean/effects-core 2.4.1-alpha.0 → 2.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.js +25 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +25 -14
- package/dist/index.mjs.map +1 -1
- package/dist/material/mask-ref-manager.d.ts +1 -1
- package/dist/material/types.d.ts +0 -2
- package/dist/plugin-system.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Description: Galacean Effects runtime core for the web
|
|
4
4
|
* Author: Ant Group CO., Ltd.
|
|
5
5
|
* Contributors: 燃然,飂兮,十弦,云垣,茂安,意绮
|
|
6
|
-
* Version: v2.4.1
|
|
6
|
+
* Version: v2.4.1
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
'use strict';
|
|
@@ -869,7 +869,7 @@ function unregisterPlugin(name) {
|
|
|
869
869
|
removeItem(defaultPlugins, name);
|
|
870
870
|
}
|
|
871
871
|
var PluginSystem = /*#__PURE__*/ function() {
|
|
872
|
-
function PluginSystem() {
|
|
872
|
+
function PluginSystem(pluginNames) {
|
|
873
873
|
var loaders = {};
|
|
874
874
|
var loaded = [];
|
|
875
875
|
var addLoader = function(name) {
|
|
@@ -880,12 +880,15 @@ var PluginSystem = /*#__PURE__*/ function() {
|
|
|
880
880
|
}
|
|
881
881
|
};
|
|
882
882
|
defaultPlugins.forEach(addLoader);
|
|
883
|
-
|
|
884
|
-
var
|
|
885
|
-
if (!
|
|
886
|
-
throw new Error("The plugin '" +
|
|
883
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(pluginNames), _step; !(_step = _iterator()).done;){
|
|
884
|
+
var customPluginName = _step.value;
|
|
885
|
+
if (!pluginLoaderMap[customPluginName]) {
|
|
886
|
+
throw new Error("The plugin '" + customPluginName + "' not found." + getPluginUsageInfo(customPluginName));
|
|
887
887
|
}
|
|
888
|
-
|
|
888
|
+
}
|
|
889
|
+
this.plugins = Object.keys(loaders).map(function(name) {
|
|
890
|
+
var pluginConstructor = pluginLoaderMap[name];
|
|
891
|
+
var loader = new pluginConstructor();
|
|
889
892
|
loader.name = name;
|
|
890
893
|
return loader;
|
|
891
894
|
}).sort(function(a, b) {
|
|
@@ -7624,6 +7627,7 @@ exports.MaterialRenderType = void 0;
|
|
|
7624
7627
|
var MaskProcessor = /*#__PURE__*/ function() {
|
|
7625
7628
|
function MaskProcessor(engine) {
|
|
7626
7629
|
this.engine = engine;
|
|
7630
|
+
this.maskable = null;
|
|
7627
7631
|
this.stencilClearAction = {
|
|
7628
7632
|
stencilAction: exports.TextureLoadAction.clear
|
|
7629
7633
|
};
|
|
@@ -7640,15 +7644,18 @@ var MaskProcessor = /*#__PURE__*/ function() {
|
|
|
7640
7644
|
maskMode = exports.MaskMode.MASK;
|
|
7641
7645
|
} else if (mode === ObscuredMode.OBSCURED || mode === ObscuredMode.REVERSE_OBSCURED) {
|
|
7642
7646
|
maskMode = mode === ObscuredMode.OBSCURED ? exports.MaskMode.OBSCURED : exports.MaskMode.REVERSE_OBSCURED;
|
|
7643
|
-
|
|
7647
|
+
if (ref) {
|
|
7648
|
+
this.maskable = ref;
|
|
7649
|
+
}
|
|
7644
7650
|
}
|
|
7645
7651
|
}
|
|
7646
7652
|
return maskMode;
|
|
7647
7653
|
};
|
|
7648
7654
|
_proto.drawStencilMask = function drawStencilMask(renderer) {
|
|
7649
|
-
|
|
7650
|
-
|
|
7651
|
-
|
|
7655
|
+
if (this.maskable) {
|
|
7656
|
+
renderer.clear(this.stencilClearAction);
|
|
7657
|
+
this.maskable.drawStencilMask(renderer);
|
|
7658
|
+
}
|
|
7652
7659
|
};
|
|
7653
7660
|
return MaskProcessor;
|
|
7654
7661
|
}();
|
|
@@ -12562,6 +12569,9 @@ function getBezier2DValue(out, t, p0, p1, cpx0, cpy0, cpx1, cpy1) {
|
|
|
12562
12569
|
/**
|
|
12563
12570
|
* @internal
|
|
12564
12571
|
*/ _proto.drawStencilMask = function drawStencilMask(renderer) {
|
|
12572
|
+
if (!this.isActiveAndEnabled) {
|
|
12573
|
+
return;
|
|
12574
|
+
}
|
|
12565
12575
|
var previousColorMask = this.material.colorMask;
|
|
12566
12576
|
this.material.colorMask = false;
|
|
12567
12577
|
this.draw(renderer);
|
|
@@ -29070,12 +29080,13 @@ var seed = 1;
|
|
|
29070
29080
|
_proto.processJSON = function processJSON(json) {
|
|
29071
29081
|
var _this = this;
|
|
29072
29082
|
return _async_to_generator(function() {
|
|
29073
|
-
var jsonScene, pluginSystem;
|
|
29083
|
+
var jsonScene, _jsonScene_plugins, plugins, pluginSystem;
|
|
29074
29084
|
return __generator(this, function(_state) {
|
|
29075
29085
|
switch(_state.label){
|
|
29076
29086
|
case 0:
|
|
29077
29087
|
jsonScene = getStandardJSON(json);
|
|
29078
|
-
|
|
29088
|
+
_jsonScene_plugins = jsonScene.plugins, plugins = _jsonScene_plugins === void 0 ? [] : _jsonScene_plugins;
|
|
29089
|
+
pluginSystem = new PluginSystem(plugins);
|
|
29079
29090
|
return [
|
|
29080
29091
|
4,
|
|
29081
29092
|
pluginSystem.processRawJSON(jsonScene, _this.options)
|
|
@@ -31626,7 +31637,7 @@ registerPlugin("sprite", SpriteLoader, exports.VFXItem);
|
|
|
31626
31637
|
registerPlugin("particle", ParticleLoader, exports.VFXItem);
|
|
31627
31638
|
registerPlugin("cal", CalculateLoader, exports.VFXItem);
|
|
31628
31639
|
registerPlugin("interact", InteractLoader, exports.VFXItem);
|
|
31629
|
-
var version = "2.4.1
|
|
31640
|
+
var version = "2.4.1";
|
|
31630
31641
|
logger.info("Core version: " + version + ".");
|
|
31631
31642
|
|
|
31632
31643
|
exports.AbstractPlugin = AbstractPlugin;
|