@galacean/effects-threejs 2.5.5 → 2.5.6
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 -6
- 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 +18 -7
- 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.5.
|
|
6
|
+
* Version: v2.5.6
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
'use strict';
|
|
@@ -488,6 +488,8 @@ function getPixelRatio() {
|
|
|
488
488
|
}
|
|
489
489
|
return 1;
|
|
490
490
|
}
|
|
491
|
+
// window 对象不存在时需要判断
|
|
492
|
+
var canUseBOM = typeof window !== "undefined";
|
|
491
493
|
function isIOS() {
|
|
492
494
|
// real ios device not in simulator
|
|
493
495
|
return !!navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform);
|
|
@@ -5938,6 +5940,8 @@ function gpuTimer(gl) {
|
|
|
5938
5940
|
|
|
5939
5941
|
var initErrors = [];
|
|
5940
5942
|
var glContext = {};
|
|
5943
|
+
var IOS16_LOCKDOWN_MODE = "iOS16 lockdown mode, WebGL Constants not in global";
|
|
5944
|
+
var WEBGL_CONSTANTS_NOT_IN_GLOBAL = "WebGL Constants not in global, please check your environment";
|
|
5941
5945
|
if (!initErrors.length) {
|
|
5942
5946
|
initGLContext();
|
|
5943
5947
|
}
|
|
@@ -5949,8 +5953,12 @@ function initGLContext() {
|
|
|
5949
5953
|
copy(WebGLRenderingContext);
|
|
5950
5954
|
copy(WebGLRenderingContext.prototype);
|
|
5951
5955
|
} else {
|
|
5952
|
-
|
|
5953
|
-
|
|
5956
|
+
if (canUseBOM) {
|
|
5957
|
+
initErrors.push(// iOS 16 lockdown mode
|
|
5958
|
+
isIOS() ? IOS16_LOCKDOWN_MODE : WEBGL_CONSTANTS_NOT_IN_GLOBAL);
|
|
5959
|
+
} else {
|
|
5960
|
+
initErrors.push(WEBGL_CONSTANTS_NOT_IN_GLOBAL);
|
|
5961
|
+
}
|
|
5954
5962
|
}
|
|
5955
5963
|
if (!initErrors.length && !("HALF_FLOAT" in glContext)) {
|
|
5956
5964
|
// @ts-expect-error set default value
|
|
@@ -13503,6 +13511,7 @@ var EventSystem = /*#__PURE__*/ function() {
|
|
|
13503
13511
|
var touchstart = "mousedown";
|
|
13504
13512
|
var touchmove = "mousemove";
|
|
13505
13513
|
var touchend = "mouseup";
|
|
13514
|
+
var touchcancel = "mouseleave";
|
|
13506
13515
|
var getTouchEventValue = function(event, x, y, dx, dy) {
|
|
13507
13516
|
if (dx === void 0) dx = 0;
|
|
13508
13517
|
if (dy === void 0) dy = 0;
|
|
@@ -13556,6 +13565,7 @@ var EventSystem = /*#__PURE__*/ function() {
|
|
|
13556
13565
|
touchstart = "touchstart";
|
|
13557
13566
|
touchmove = "touchmove";
|
|
13558
13567
|
touchend = "touchend";
|
|
13568
|
+
touchcancel = "touchcancel";
|
|
13559
13569
|
}
|
|
13560
13570
|
var _obj;
|
|
13561
13571
|
this.nativeHandlers = (_obj = {}, _obj[touchstart] = function(event) {
|
|
@@ -13598,6 +13608,7 @@ var EventSystem = /*#__PURE__*/ function() {
|
|
|
13598
13608
|
}
|
|
13599
13609
|
currentTouch = 0;
|
|
13600
13610
|
}, _obj);
|
|
13611
|
+
this.nativeHandlers[touchcancel] = this.nativeHandlers[touchend];
|
|
13601
13612
|
Object.keys(this.nativeHandlers).forEach(function(name) {
|
|
13602
13613
|
var _this_target;
|
|
13603
13614
|
(_this_target = _this.target) == null ? void 0 : _this_target.addEventListener(String(name), _this.nativeHandlers[name]);
|
|
@@ -28600,7 +28611,7 @@ function getStandardSpriteContent(sprite, transform) {
|
|
|
28600
28611
|
return ret;
|
|
28601
28612
|
}
|
|
28602
28613
|
|
|
28603
|
-
var version$2 = "2.5.
|
|
28614
|
+
var version$2 = "2.5.6";
|
|
28604
28615
|
var v0 = /^(\d+)\.(\d+)\.(\d+)(-(\w+)\.\d+)?$/;
|
|
28605
28616
|
var standardVersion = /^(\d+)\.(\d+)$/;
|
|
28606
28617
|
var reverseParticle = false;
|
|
@@ -31850,7 +31861,7 @@ registerPlugin("sprite", SpriteLoader, exports.VFXItem);
|
|
|
31850
31861
|
registerPlugin("particle", ParticleLoader, exports.VFXItem);
|
|
31851
31862
|
registerPlugin("cal", CalculateLoader, exports.VFXItem);
|
|
31852
31863
|
registerPlugin("interact", InteractLoader, exports.VFXItem);
|
|
31853
|
-
var version$1 = "2.5.
|
|
31864
|
+
var version$1 = "2.5.6";
|
|
31854
31865
|
logger.info("Core version: " + version$1 + ".");
|
|
31855
31866
|
|
|
31856
31867
|
var _obj;
|
|
@@ -33452,7 +33463,7 @@ setMaxSpriteMeshItemCount(8);
|
|
|
33452
33463
|
*/ Mesh.create = function(engine, props) {
|
|
33453
33464
|
return new ThreeMesh(engine, props);
|
|
33454
33465
|
};
|
|
33455
|
-
var version = "2.5.
|
|
33466
|
+
var version = "2.5.6";
|
|
33456
33467
|
logger.info("THREEJS plugin version: " + version + ".");
|
|
33457
33468
|
|
|
33458
33469
|
exports.AbstractPlugin = AbstractPlugin;
|
|
@@ -33589,6 +33600,7 @@ exports.base64ToFile = base64ToFile;
|
|
|
33589
33600
|
exports.blend = blend;
|
|
33590
33601
|
exports.buildLine = buildLine;
|
|
33591
33602
|
exports.calculateTranslation = calculateTranslation;
|
|
33603
|
+
exports.canUseBOM = canUseBOM;
|
|
33592
33604
|
exports.canvasPool = canvasPool;
|
|
33593
33605
|
exports.closePointEps = closePointEps;
|
|
33594
33606
|
exports.colorGradingFrag = colorGradingFrag;
|