@galacean/effects-core 2.0.0-alpha.3 → 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/asset-loader.d.ts +30 -22
- package/dist/index.js +720 -250
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +755 -286
- package/dist/index.mjs.map +1 -1
- package/dist/material/material.d.ts +3 -3
- package/dist/plugins/interact/interact-mesh.d.ts +1 -1
- package/dist/plugins/particle/particle-mesh.d.ts +3 -3
- package/dist/plugins/particle/trail-mesh.d.ts +6 -6
- package/dist/render/shader.d.ts +9 -2
- package/package.json +2 -2
package/dist/index.mjs
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.0.0-alpha.
|
|
6
|
+
* Version: v2.0.0-alpha.5
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
/******************************************************************************
|
|
@@ -122,7 +122,7 @@ function __read$3(o, n) {
|
|
|
122
122
|
return ar;
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
function __spreadArray$
|
|
125
|
+
function __spreadArray$3(to, from, pack) {
|
|
126
126
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
127
127
|
if (ar || !(i in from)) {
|
|
128
128
|
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
@@ -140,20 +140,20 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
140
140
|
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
|
141
141
|
// require the crypto API and do not support built-in fallback to lower quality random number
|
|
142
142
|
// generators (like Math.random()).
|
|
143
|
-
let getRandomValues;
|
|
144
|
-
const rnds8 = new Uint8Array(16);
|
|
145
|
-
function rng() {
|
|
143
|
+
let getRandomValues$1;
|
|
144
|
+
const rnds8$1 = new Uint8Array(16);
|
|
145
|
+
function rng$1() {
|
|
146
146
|
// lazy load so that environments that need to polyfill have a chance to do so
|
|
147
|
-
if (!getRandomValues) {
|
|
147
|
+
if (!getRandomValues$1) {
|
|
148
148
|
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
|
|
149
|
-
getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
|
|
149
|
+
getRandomValues$1 = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
|
|
150
150
|
|
|
151
|
-
if (!getRandomValues) {
|
|
151
|
+
if (!getRandomValues$1) {
|
|
152
152
|
throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
-
return getRandomValues(rnds8);
|
|
156
|
+
return getRandomValues$1(rnds8$1);
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
/**
|
|
@@ -161,30 +161,30 @@ function rng() {
|
|
|
161
161
|
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
|
162
162
|
*/
|
|
163
163
|
|
|
164
|
-
const byteToHex = [];
|
|
164
|
+
const byteToHex$2 = [];
|
|
165
165
|
|
|
166
166
|
for (let i = 0; i < 256; ++i) {
|
|
167
|
-
byteToHex.push((i + 0x100).toString(16).slice(1));
|
|
167
|
+
byteToHex$2.push((i + 0x100).toString(16).slice(1));
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
-
function unsafeStringify(arr, offset = 0) {
|
|
170
|
+
function unsafeStringify$1(arr, offset = 0) {
|
|
171
171
|
// Note: Be careful editing this code! It's been tuned for performance
|
|
172
172
|
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
|
|
173
|
-
return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
|
|
173
|
+
return byteToHex$2[arr[offset + 0]] + byteToHex$2[arr[offset + 1]] + byteToHex$2[arr[offset + 2]] + byteToHex$2[arr[offset + 3]] + '-' + byteToHex$2[arr[offset + 4]] + byteToHex$2[arr[offset + 5]] + '-' + byteToHex$2[arr[offset + 6]] + byteToHex$2[arr[offset + 7]] + '-' + byteToHex$2[arr[offset + 8]] + byteToHex$2[arr[offset + 9]] + '-' + byteToHex$2[arr[offset + 10]] + byteToHex$2[arr[offset + 11]] + byteToHex$2[arr[offset + 12]] + byteToHex$2[arr[offset + 13]] + byteToHex$2[arr[offset + 14]] + byteToHex$2[arr[offset + 15]];
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
-
const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
177
|
-
var native = {
|
|
178
|
-
randomUUID
|
|
176
|
+
const randomUUID$1 = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
177
|
+
var native$1 = {
|
|
178
|
+
randomUUID: randomUUID$1
|
|
179
179
|
};
|
|
180
180
|
|
|
181
|
-
function v4(options, buf, offset) {
|
|
182
|
-
if (native.randomUUID && !buf && !options) {
|
|
183
|
-
return native.randomUUID();
|
|
181
|
+
function v4$1(options, buf, offset) {
|
|
182
|
+
if (native$1.randomUUID && !buf && !options) {
|
|
183
|
+
return native$1.randomUUID();
|
|
184
184
|
}
|
|
185
185
|
|
|
186
186
|
options = options || {};
|
|
187
|
-
const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
|
187
|
+
const rnds = options.random || (options.rng || rng$1)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
|
188
188
|
|
|
189
189
|
rnds[6] = rnds[6] & 0x0f | 0x40;
|
|
190
190
|
rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
|
|
@@ -199,7 +199,7 @@ function v4(options, buf, offset) {
|
|
|
199
199
|
return buf;
|
|
200
200
|
}
|
|
201
201
|
|
|
202
|
-
return unsafeStringify(rnds);
|
|
202
|
+
return unsafeStringify$1(rnds);
|
|
203
203
|
}
|
|
204
204
|
|
|
205
205
|
function addItem(arr, value) {
|
|
@@ -2186,7 +2186,7 @@ var __read$2 = (undefined && undefined.__read) || function (o, n) {
|
|
|
2186
2186
|
}
|
|
2187
2187
|
return ar;
|
|
2188
2188
|
};
|
|
2189
|
-
var __spreadArray$
|
|
2189
|
+
var __spreadArray$2 = (undefined && undefined.__spreadArray) || function (to, from, pack) {
|
|
2190
2190
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
2191
2191
|
if (ar || !(i in from)) {
|
|
2192
2192
|
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
@@ -2503,7 +2503,7 @@ var Matrix4 = /** @class */ (function () {
|
|
|
2503
2503
|
* @returns 复制结果
|
|
2504
2504
|
*/
|
|
2505
2505
|
Matrix4.prototype.copyFrom = function (m) {
|
|
2506
|
-
this.elements = __spreadArray$
|
|
2506
|
+
this.elements = __spreadArray$2([], __read$2(m.elements), false);
|
|
2507
2507
|
return this;
|
|
2508
2508
|
};
|
|
2509
2509
|
/**
|
|
@@ -3032,7 +3032,7 @@ var Matrix4 = /** @class */ (function () {
|
|
|
3032
3032
|
* @returns
|
|
3033
3033
|
*/
|
|
3034
3034
|
Matrix4.prototype.toArray = function () {
|
|
3035
|
-
return __spreadArray$
|
|
3035
|
+
return __spreadArray$2([], __read$2(this.elements), false);
|
|
3036
3036
|
};
|
|
3037
3037
|
Matrix4.prototype.fill = function (array, offset) {
|
|
3038
3038
|
if (offset === void 0) { offset = 0; }
|
|
@@ -4285,7 +4285,7 @@ var __read$1 = (undefined && undefined.__read) || function (o, n) {
|
|
|
4285
4285
|
}
|
|
4286
4286
|
return ar;
|
|
4287
4287
|
};
|
|
4288
|
-
var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) {
|
|
4288
|
+
var __spreadArray$1 = (undefined && undefined.__spreadArray) || function (to, from, pack) {
|
|
4289
4289
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4290
4290
|
if (ar || !(i in from)) {
|
|
4291
4291
|
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
@@ -4472,7 +4472,7 @@ var Matrix3 = /** @class */ (function () {
|
|
|
4472
4472
|
* @returns 复制结果
|
|
4473
4473
|
*/
|
|
4474
4474
|
Matrix3.prototype.copyFrom = function (m) {
|
|
4475
|
-
this.elements = __spreadArray([], __read$1(m.elements), false);
|
|
4475
|
+
this.elements = __spreadArray$1([], __read$1(m.elements), false);
|
|
4476
4476
|
return this;
|
|
4477
4477
|
};
|
|
4478
4478
|
/**
|
|
@@ -4688,7 +4688,7 @@ var Matrix3 = /** @class */ (function () {
|
|
|
4688
4688
|
* @returns
|
|
4689
4689
|
*/
|
|
4690
4690
|
Matrix3.prototype.toArray = function () {
|
|
4691
|
-
return __spreadArray([], __read$1(this.elements), false);
|
|
4691
|
+
return __spreadArray$1([], __read$1(this.elements), false);
|
|
4692
4692
|
};
|
|
4693
4693
|
Matrix3.prototype.fill = function (array, offset) {
|
|
4694
4694
|
if (offset === void 0) { offset = 0; }
|
|
@@ -6446,7 +6446,7 @@ function error(message) {
|
|
|
6446
6446
|
for (var _i = 1; _i < arguments.length; _i++) {
|
|
6447
6447
|
args[_i - 1] = arguments[_i];
|
|
6448
6448
|
}
|
|
6449
|
-
console.error.apply(console, __spreadArray$
|
|
6449
|
+
console.error.apply(console, __spreadArray$3(__spreadArray$3([], __read$3(format(message)), false), [args], false));
|
|
6450
6450
|
localLogger === null || localLogger === void 0 ? void 0 : localLogger('error', message, args);
|
|
6451
6451
|
}
|
|
6452
6452
|
/**
|
|
@@ -6459,7 +6459,7 @@ function info(message) {
|
|
|
6459
6459
|
for (var _i = 1; _i < arguments.length; _i++) {
|
|
6460
6460
|
args[_i - 1] = arguments[_i];
|
|
6461
6461
|
}
|
|
6462
|
-
console.debug.apply(console, __spreadArray$
|
|
6462
|
+
console.debug.apply(console, __spreadArray$3([], __read$3(format(message)), false));
|
|
6463
6463
|
localLogger === null || localLogger === void 0 ? void 0 : localLogger('info', message, args);
|
|
6464
6464
|
}
|
|
6465
6465
|
function warn(message) {
|
|
@@ -6467,7 +6467,7 @@ function warn(message) {
|
|
|
6467
6467
|
for (var _i = 1; _i < arguments.length; _i++) {
|
|
6468
6468
|
args[_i - 1] = arguments[_i];
|
|
6469
6469
|
}
|
|
6470
|
-
console.warn.apply(console, __spreadArray$
|
|
6470
|
+
console.warn.apply(console, __spreadArray$3([], __read$3(format(message)), false));
|
|
6471
6471
|
localLogger === null || localLogger === void 0 ? void 0 : localLogger('warn', message, args);
|
|
6472
6472
|
}
|
|
6473
6473
|
/**
|
|
@@ -6564,17 +6564,30 @@ function random(min, max) {
|
|
|
6564
6564
|
function throwDestroyedError() {
|
|
6565
6565
|
throw Error('destroyed item cannot be used again');
|
|
6566
6566
|
}
|
|
6567
|
-
function generateGUID() {
|
|
6568
|
-
return v4().replace(/-/g, '');
|
|
6567
|
+
function generateGUID$1() {
|
|
6568
|
+
return v4$1().replace(/-/g, '');
|
|
6569
6569
|
}
|
|
6570
6570
|
|
|
6571
6571
|
/*!
|
|
6572
6572
|
* Name: @galacean/effects-specification
|
|
6573
6573
|
* Description: Galacean Effects JSON Specification
|
|
6574
6574
|
* Author: Ant Group CO., Ltd.
|
|
6575
|
-
* Version:
|
|
6575
|
+
* Version: v2.0.0-alpha.3
|
|
6576
|
+
*/
|
|
6577
|
+
|
|
6578
|
+
typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
6579
|
+
|
|
6580
|
+
/**
|
|
6581
|
+
* Convert array of 16 byte values to UUID string format of the form:
|
|
6582
|
+
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
|
6576
6583
|
*/
|
|
6577
6584
|
|
|
6585
|
+
const byteToHex$1 = [];
|
|
6586
|
+
|
|
6587
|
+
for (let i = 0; i < 256; ++i) {
|
|
6588
|
+
byteToHex$1.push((i + 0x100).toString(16).slice(1));
|
|
6589
|
+
}
|
|
6590
|
+
|
|
6578
6591
|
/*********************************************/
|
|
6579
6592
|
/* 元素属性参数类型 */
|
|
6580
6593
|
/*********************************************/
|
|
@@ -6837,6 +6850,10 @@ var ItemType$1;
|
|
|
6837
6850
|
* 天空盒元素
|
|
6838
6851
|
*/
|
|
6839
6852
|
ItemType["skybox"] = "skybox";
|
|
6853
|
+
/**
|
|
6854
|
+
* 特效元素
|
|
6855
|
+
*/
|
|
6856
|
+
ItemType["effect"] = "effect";
|
|
6840
6857
|
})(ItemType$1 || (ItemType$1 = {}));
|
|
6841
6858
|
/**
|
|
6842
6859
|
* 渲染模式
|
|
@@ -6951,6 +6968,10 @@ var CompositionEndBehavior$1;
|
|
|
6951
6968
|
* 销毁并保留最后一帧
|
|
6952
6969
|
*/
|
|
6953
6970
|
CompositionEndBehavior[CompositionEndBehavior["pause_destroy"] = END_BEHAVIOR_PAUSE_AND_DESTROY$1] = "pause_destroy";
|
|
6971
|
+
/**
|
|
6972
|
+
* 冻结
|
|
6973
|
+
*/
|
|
6974
|
+
CompositionEndBehavior[CompositionEndBehavior["freeze"] = END_BEHAVIOR_FREEZE$1] = "freeze";
|
|
6954
6975
|
})(CompositionEndBehavior$1 || (CompositionEndBehavior$1 = {}));
|
|
6955
6976
|
|
|
6956
6977
|
/*********************************************/
|
|
@@ -7089,12 +7110,38 @@ var ShapeArcMode$1;
|
|
|
7089
7110
|
|
|
7090
7111
|
var BloomFilterThresholdAvgColor = 0;
|
|
7091
7112
|
|
|
7113
|
+
var LightType$1;
|
|
7114
|
+
(function (LightType) {
|
|
7115
|
+
/**
|
|
7116
|
+
* 点光源
|
|
7117
|
+
*/
|
|
7118
|
+
LightType["point"] = "point";
|
|
7119
|
+
/**
|
|
7120
|
+
* 聚光灯
|
|
7121
|
+
*/
|
|
7122
|
+
LightType["spot"] = "spot";
|
|
7123
|
+
/**
|
|
7124
|
+
* 方向光
|
|
7125
|
+
*/
|
|
7126
|
+
LightType["directional"] = "directional";
|
|
7127
|
+
/**
|
|
7128
|
+
* 环境光
|
|
7129
|
+
*/
|
|
7130
|
+
LightType["ambient"] = "ambient";
|
|
7131
|
+
})(LightType$1 || (LightType$1 = {}));
|
|
7132
|
+
|
|
7092
7133
|
var ModelBoundingType$1;
|
|
7093
7134
|
(function (ModelBoundingType) {
|
|
7094
7135
|
ModelBoundingType[ModelBoundingType["box"] = 2] = "box";
|
|
7095
7136
|
ModelBoundingType[ModelBoundingType["sphere"] = 3] = "sphere";
|
|
7096
7137
|
})(ModelBoundingType$1 || (ModelBoundingType$1 = {}));
|
|
7097
7138
|
|
|
7139
|
+
var CameraType$1;
|
|
7140
|
+
(function (CameraType) {
|
|
7141
|
+
CameraType["orthographic"] = "orthographic";
|
|
7142
|
+
CameraType["perspective"] = "perspective";
|
|
7143
|
+
})(CameraType$1 || (CameraType$1 = {}));
|
|
7144
|
+
|
|
7098
7145
|
// 材质类型
|
|
7099
7146
|
var MaterialType$1;
|
|
7100
7147
|
(function (MaterialType) {
|
|
@@ -7240,6 +7287,28 @@ var FontStyle$1;
|
|
|
7240
7287
|
FontStyle["oblique"] = "oblique";
|
|
7241
7288
|
})(FontStyle$1 || (FontStyle$1 = {}));
|
|
7242
7289
|
|
|
7290
|
+
var DataType$2;
|
|
7291
|
+
(function (DataType) {
|
|
7292
|
+
DataType["VFXItemData"] = "VFXItemData";
|
|
7293
|
+
DataType["EffectComponent"] = "EffectComponent";
|
|
7294
|
+
DataType["Material"] = "Material";
|
|
7295
|
+
DataType["Shader"] = "Shader";
|
|
7296
|
+
DataType["SpriteComponent"] = "SpriteComponent";
|
|
7297
|
+
DataType["ParticleSystem"] = "ParticleSystem";
|
|
7298
|
+
DataType["InteractComponent"] = "InteractComponent";
|
|
7299
|
+
DataType["CameraController"] = "CameraController";
|
|
7300
|
+
DataType["Geometry"] = "Geometry";
|
|
7301
|
+
DataType["Texture"] = "Texture";
|
|
7302
|
+
DataType["TextComponent"] = "TextComponent";
|
|
7303
|
+
// FIXME: 先完成ECS的场景转换,后面移到spec中
|
|
7304
|
+
DataType["MeshComponent"] = "MeshComponent";
|
|
7305
|
+
DataType["SkyboxComponent"] = "SkyboxComponent";
|
|
7306
|
+
DataType["LightComponent"] = "LightComponent";
|
|
7307
|
+
DataType["CameraComponent"] = "CameraComponent";
|
|
7308
|
+
DataType["ModelPluginComponent"] = "ModelPluginComponent";
|
|
7309
|
+
DataType["TreeComponent"] = "TreeComponent";
|
|
7310
|
+
})(DataType$2 || (DataType$2 = {}));
|
|
7311
|
+
|
|
7243
7312
|
var index = /*#__PURE__*/Object.freeze({
|
|
7244
7313
|
__proto__: null,
|
|
7245
7314
|
get BezierKeyframeType () { return BezierKeyframeType$1; },
|
|
@@ -7248,7 +7317,9 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
7248
7317
|
CAMERA_CLIP_MODE_NORMAL: CAMERA_CLIP_MODE_NORMAL$1,
|
|
7249
7318
|
CAMERA_CLIP_MODE_VERTICAL: CAMERA_CLIP_MODE_VERTICAL$1,
|
|
7250
7319
|
get CameraClipMode () { return CameraClipMode$1; },
|
|
7320
|
+
get CameraType () { return CameraType$1; },
|
|
7251
7321
|
get CompositionEndBehavior () { return CompositionEndBehavior$1; },
|
|
7322
|
+
get DataType () { return DataType$2; },
|
|
7252
7323
|
END_BEHAVIOR_DESTROY: END_BEHAVIOR_DESTROY$1,
|
|
7253
7324
|
END_BEHAVIOR_DESTROY_CHILDREN: END_BEHAVIOR_DESTROY_CHILDREN$1,
|
|
7254
7325
|
END_BEHAVIOR_FORWARD: END_BEHAVIOR_FORWARD$1,
|
|
@@ -7261,6 +7332,7 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
7261
7332
|
get InteractType () { return InteractType$1; },
|
|
7262
7333
|
get ItemEndBehavior () { return ItemEndBehavior$1; },
|
|
7263
7334
|
get ItemType () { return ItemType$1; },
|
|
7335
|
+
get LightType () { return LightType$1; },
|
|
7264
7336
|
MESSAGE_ITEM_PHRASE_BEGIN: MESSAGE_ITEM_PHRASE_BEGIN,
|
|
7265
7337
|
MESSAGE_ITEM_PHRASE_END: MESSAGE_ITEM_PHRASE_END,
|
|
7266
7338
|
get MaskMode () { return MaskMode$1; },
|
|
@@ -7452,7 +7524,7 @@ function copy$1(target) {
|
|
|
7452
7524
|
}
|
|
7453
7525
|
}
|
|
7454
7526
|
|
|
7455
|
-
var _a$
|
|
7527
|
+
var _a$6;
|
|
7456
7528
|
function valIfUndefined(val, def) {
|
|
7457
7529
|
if (val === undefined || val === null) {
|
|
7458
7530
|
return def;
|
|
@@ -7482,15 +7554,15 @@ function getPreMultiAlpha(blending) {
|
|
|
7482
7554
|
return 1;
|
|
7483
7555
|
}
|
|
7484
7556
|
}
|
|
7485
|
-
var downgradeKeywords = (_a$
|
|
7486
|
-
_a$
|
|
7557
|
+
var downgradeKeywords = (_a$6 = {},
|
|
7558
|
+
_a$6[ShaderType.vertex] = {
|
|
7487
7559
|
in: 'attribute',
|
|
7488
7560
|
out: 'varying',
|
|
7489
7561
|
},
|
|
7490
|
-
_a$
|
|
7562
|
+
_a$6[ShaderType.fragment] = {
|
|
7491
7563
|
in: 'varying',
|
|
7492
7564
|
},
|
|
7493
|
-
_a$
|
|
7565
|
+
_a$6);
|
|
7494
7566
|
/**
|
|
7495
7567
|
* 生成 shader,检测到 WebGL1 上下文会降级
|
|
7496
7568
|
* @param marcos - 宏定义数组
|
|
@@ -7931,7 +8003,7 @@ function loadMipmapImage(pointer, bins) {
|
|
|
7931
8003
|
var EffectsObject = /** @class */ (function () {
|
|
7932
8004
|
function EffectsObject(engine) {
|
|
7933
8005
|
this.engine = engine;
|
|
7934
|
-
this.guid = generateGUID();
|
|
8006
|
+
this.guid = generateGUID$1();
|
|
7935
8007
|
this.taggedProperties = {};
|
|
7936
8008
|
this.engine.addInstance(this);
|
|
7937
8009
|
}
|
|
@@ -8628,13 +8700,49 @@ var GLSLVersion;
|
|
|
8628
8700
|
GLSLVersion["GLSL1"] = "100";
|
|
8629
8701
|
GLSLVersion["GLSL3"] = "300 es";
|
|
8630
8702
|
})(GLSLVersion || (GLSLVersion = {}));
|
|
8631
|
-
var
|
|
8632
|
-
__extends(
|
|
8633
|
-
function
|
|
8703
|
+
var ShaderVariant = /** @class */ (function (_super) {
|
|
8704
|
+
__extends(ShaderVariant, _super);
|
|
8705
|
+
function ShaderVariant(engine, source) {
|
|
8634
8706
|
var _this = _super.call(this, engine) || this;
|
|
8635
8707
|
_this.source = source;
|
|
8636
8708
|
return _this;
|
|
8637
8709
|
}
|
|
8710
|
+
return ShaderVariant;
|
|
8711
|
+
}(EffectsObject));
|
|
8712
|
+
var Shader = /** @class */ (function (_super) {
|
|
8713
|
+
__extends(Shader, _super);
|
|
8714
|
+
function Shader() {
|
|
8715
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
8716
|
+
}
|
|
8717
|
+
Shader.prototype.createVariant = function (macros) {
|
|
8718
|
+
var e_1, _a;
|
|
8719
|
+
var shaderMacros = [];
|
|
8720
|
+
if (macros) {
|
|
8721
|
+
try {
|
|
8722
|
+
for (var _b = __values$1(Object.keys(macros)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
8723
|
+
var key = _c.value;
|
|
8724
|
+
shaderMacros.push([key, macros[key]]);
|
|
8725
|
+
}
|
|
8726
|
+
}
|
|
8727
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
8728
|
+
finally {
|
|
8729
|
+
try {
|
|
8730
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
8731
|
+
}
|
|
8732
|
+
finally { if (e_1) throw e_1.error; }
|
|
8733
|
+
}
|
|
8734
|
+
}
|
|
8735
|
+
var shaderVariant = this.engine.getShaderLibrary().createShader(this.shaderData, shaderMacros);
|
|
8736
|
+
shaderVariant.shader = this;
|
|
8737
|
+
return shaderVariant;
|
|
8738
|
+
};
|
|
8739
|
+
Shader.prototype.fromData = function (data) {
|
|
8740
|
+
_super.prototype.fromData.call(this, data);
|
|
8741
|
+
this.shaderData = data;
|
|
8742
|
+
};
|
|
8743
|
+
Shader = __decorate([
|
|
8744
|
+
effectsClass('Shader')
|
|
8745
|
+
], Shader);
|
|
8638
8746
|
return Shader;
|
|
8639
8747
|
}(EffectsObject));
|
|
8640
8748
|
|
|
@@ -8647,8 +8755,8 @@ function createCopyShader(level, writeDepth) {
|
|
|
8647
8755
|
var version = webgl2 ? '#version 300 es' : '';
|
|
8648
8756
|
return {
|
|
8649
8757
|
name: EFFECTS_COPY_MESH_NAME,
|
|
8650
|
-
vertex:
|
|
8651
|
-
fragment:
|
|
8758
|
+
vertex: version + '\n' + COPY_VERTEX_SHADER,
|
|
8759
|
+
fragment: version + '\n' + COPY_FRAGMENT_SHADER,
|
|
8652
8760
|
glslVersion: webgl2 ? GLSLVersion.GLSL3 : GLSLVersion.GLSL1,
|
|
8653
8761
|
marcos: [
|
|
8654
8762
|
['WEBGL2', !!webgl2],
|
|
@@ -8780,13 +8888,13 @@ var SemanticMap = /** @class */ (function () {
|
|
|
8780
8888
|
return SemanticMap;
|
|
8781
8889
|
}());
|
|
8782
8890
|
|
|
8783
|
-
var _a$
|
|
8784
|
-
var BYTES_TYPE_MAP = (_a$
|
|
8785
|
-
_a$
|
|
8786
|
-
_a$
|
|
8787
|
-
_a$
|
|
8788
|
-
_a$
|
|
8789
|
-
_a$
|
|
8891
|
+
var _a$5;
|
|
8892
|
+
var BYTES_TYPE_MAP = (_a$5 = {},
|
|
8893
|
+
_a$5[glContext.FLOAT] = Float32Array.BYTES_PER_ELEMENT,
|
|
8894
|
+
_a$5[glContext.INT] = Int32Array.BYTES_PER_ELEMENT,
|
|
8895
|
+
_a$5[glContext.SHORT] = Int16Array.BYTES_PER_ELEMENT,
|
|
8896
|
+
_a$5[glContext.BYTE] = Int8Array.BYTES_PER_ELEMENT,
|
|
8897
|
+
_a$5);
|
|
8790
8898
|
/**
|
|
8791
8899
|
* Geometry 抽象类
|
|
8792
8900
|
*/
|
|
@@ -9355,7 +9463,7 @@ var RenderPass = /** @class */ (function () {
|
|
|
9355
9463
|
RenderPass.prototype.setMeshes = function (meshes) {
|
|
9356
9464
|
var _a;
|
|
9357
9465
|
this.meshes.length = 0;
|
|
9358
|
-
(_a = this.meshes).splice.apply(_a, __spreadArray$
|
|
9466
|
+
(_a = this.meshes).splice.apply(_a, __spreadArray$3([0, 0], __read$3(meshes), false));
|
|
9359
9467
|
sortByOrder(this.meshes, this.meshOrder);
|
|
9360
9468
|
return this.meshes;
|
|
9361
9469
|
};
|
|
@@ -11540,18 +11648,15 @@ var AssetLoader = /** @class */ (function () {
|
|
|
11540
11648
|
return undefined;
|
|
11541
11649
|
}
|
|
11542
11650
|
switch (effectsObjectData.dataType) {
|
|
11543
|
-
case DataType.Material:
|
|
11651
|
+
case DataType$1.Material:
|
|
11544
11652
|
effectsObject = Material.create(this.engine);
|
|
11545
11653
|
break;
|
|
11546
|
-
case DataType.Geometry:
|
|
11654
|
+
case DataType$1.Geometry:
|
|
11547
11655
|
effectsObject = Geometry.create(this.engine);
|
|
11548
11656
|
break;
|
|
11549
|
-
case DataType.Texture:
|
|
11657
|
+
case DataType$1.Texture:
|
|
11550
11658
|
effectsObject = Texture.create(this.engine, effectsObjectData);
|
|
11551
11659
|
return effectsObject;
|
|
11552
|
-
case DataType.Shader:
|
|
11553
|
-
effectsObject = this.engine.getShaderLibrary().createShader(effectsObjectData);
|
|
11554
|
-
break;
|
|
11555
11660
|
default: {
|
|
11556
11661
|
var classConstructor = AssetLoader.getClass(effectsObjectData.dataType);
|
|
11557
11662
|
if (classConstructor) {
|
|
@@ -11595,18 +11700,15 @@ var AssetLoader = /** @class */ (function () {
|
|
|
11595
11700
|
return [2 /*return*/, effectsObject];
|
|
11596
11701
|
case 2:
|
|
11597
11702
|
switch (effectsObjectData.dataType) {
|
|
11598
|
-
case DataType.Material:
|
|
11703
|
+
case DataType$1.Material:
|
|
11599
11704
|
effectsObject = Material.create(this.engine);
|
|
11600
11705
|
break;
|
|
11601
|
-
case DataType.Geometry:
|
|
11706
|
+
case DataType$1.Geometry:
|
|
11602
11707
|
effectsObject = Geometry.create(this.engine);
|
|
11603
11708
|
break;
|
|
11604
|
-
case DataType.Texture:
|
|
11709
|
+
case DataType$1.Texture:
|
|
11605
11710
|
effectsObject = Texture.create(this.engine, effectsObjectData);
|
|
11606
11711
|
return [2 /*return*/, effectsObject];
|
|
11607
|
-
case DataType.Shader:
|
|
11608
|
-
effectsObject = this.engine.getShaderLibrary().createShader(effectsObjectData);
|
|
11609
|
-
break;
|
|
11610
11712
|
default: {
|
|
11611
11713
|
classConstructor = AssetLoader.getClass(effectsObjectData.dataType);
|
|
11612
11714
|
if (classConstructor) {
|
|
@@ -11648,7 +11750,7 @@ var Database = /** @class */ (function () {
|
|
|
11648
11750
|
};
|
|
11649
11751
|
return Database;
|
|
11650
11752
|
}());
|
|
11651
|
-
var DataType;
|
|
11753
|
+
var DataType$1;
|
|
11652
11754
|
(function (DataType) {
|
|
11653
11755
|
DataType["VFXItemData"] = "VFXItemData";
|
|
11654
11756
|
DataType["EffectComponent"] = "EffectComponent";
|
|
@@ -11668,7 +11770,7 @@ var DataType;
|
|
|
11668
11770
|
DataType["CameraComponent"] = "CameraComponent";
|
|
11669
11771
|
DataType["ModelPluginComponent"] = "ModelPluginComponent";
|
|
11670
11772
|
DataType["TreeComponent"] = "TreeComponent";
|
|
11671
|
-
})(DataType || (DataType = {}));
|
|
11773
|
+
})(DataType$1 || (DataType$1 = {}));
|
|
11672
11774
|
|
|
11673
11775
|
/**
|
|
11674
11776
|
* 抽象插件类
|
|
@@ -11819,7 +11921,7 @@ function calculateTranslation(out, target, acc, time, duration, posData, velData
|
|
|
11819
11921
|
return ret;
|
|
11820
11922
|
}
|
|
11821
11923
|
|
|
11822
|
-
var _a$
|
|
11924
|
+
var _a$4;
|
|
11823
11925
|
function ensureVec3(num) {
|
|
11824
11926
|
return Array.isArray(num) ? [num[0], num[1], num[2]] : [0, 0, 0];
|
|
11825
11927
|
}
|
|
@@ -11842,7 +11944,7 @@ function vecNormalize(out, a) {
|
|
|
11842
11944
|
out = [];
|
|
11843
11945
|
}
|
|
11844
11946
|
var ap = a;
|
|
11845
|
-
var sum = Math.hypot.apply(Math, __spreadArray$
|
|
11947
|
+
var sum = Math.hypot.apply(Math, __spreadArray$3([], __read$3(ap), false));
|
|
11846
11948
|
if (sum === 0) {
|
|
11847
11949
|
return vecAssign(out, ap, ap.length);
|
|
11848
11950
|
}
|
|
@@ -11873,17 +11975,17 @@ function vecMulCombine(out, a, b) {
|
|
|
11873
11975
|
}
|
|
11874
11976
|
return out;
|
|
11875
11977
|
}
|
|
11876
|
-
var particleOriginTranslateMap = (_a$
|
|
11877
|
-
_a$
|
|
11878
|
-
_a$
|
|
11879
|
-
_a$
|
|
11880
|
-
_a$
|
|
11881
|
-
_a$
|
|
11882
|
-
_a$
|
|
11883
|
-
_a$
|
|
11884
|
-
_a$
|
|
11885
|
-
_a$
|
|
11886
|
-
_a$
|
|
11978
|
+
var particleOriginTranslateMap$1 = (_a$4 = {},
|
|
11979
|
+
_a$4[ParticleOrigin$1.PARTICLE_ORIGIN_CENTER] = [0, 0],
|
|
11980
|
+
_a$4[ParticleOrigin$1.PARTICLE_ORIGIN_CENTER_BOTTOM] = [0, -0.5],
|
|
11981
|
+
_a$4[ParticleOrigin$1.PARTICLE_ORIGIN_CENTER_TOP] = [0, 0.5],
|
|
11982
|
+
_a$4[ParticleOrigin$1.PARTICLE_ORIGIN_LEFT_TOP] = [-0.5, 0.5],
|
|
11983
|
+
_a$4[ParticleOrigin$1.PARTICLE_ORIGIN_LEFT_CENTER] = [-0.5, 0],
|
|
11984
|
+
_a$4[ParticleOrigin$1.PARTICLE_ORIGIN_LEFT_BOTTOM] = [-0.5, -0.5],
|
|
11985
|
+
_a$4[ParticleOrigin$1.PARTICLE_ORIGIN_RIGHT_CENTER] = [0.5, 0],
|
|
11986
|
+
_a$4[ParticleOrigin$1.PARTICLE_ORIGIN_RIGHT_BOTTOM] = [0.5, -0.5],
|
|
11987
|
+
_a$4[ParticleOrigin$1.PARTICLE_ORIGIN_RIGHT_TOP] = [0.5, 0.5],
|
|
11988
|
+
_a$4);
|
|
11887
11989
|
function nearestPowerOfTwo(value) {
|
|
11888
11990
|
return Math.pow(2, Math.round(Math.log(value) / Math.LN2));
|
|
11889
11991
|
}
|
|
@@ -11908,7 +12010,7 @@ function trianglesFromRect(position, halfWidth, halfHeight) {
|
|
|
11908
12010
|
];
|
|
11909
12011
|
}
|
|
11910
12012
|
|
|
11911
|
-
var _a$
|
|
12013
|
+
var _a$3;
|
|
11912
12014
|
var NOT_IMPLEMENT = 'not_implement';
|
|
11913
12015
|
var ValueGetter = /** @class */ (function () {
|
|
11914
12016
|
function ValueGetter(arg) {
|
|
@@ -12416,50 +12518,50 @@ var BezierSegments = /** @class */ (function (_super) {
|
|
|
12416
12518
|
};
|
|
12417
12519
|
return BezierSegments;
|
|
12418
12520
|
}(PathSegments));
|
|
12419
|
-
var map$1 = (_a$
|
|
12420
|
-
_a$
|
|
12521
|
+
var map$1 = (_a$3 = {},
|
|
12522
|
+
_a$3[ValueType$1.RANDOM] = function (props) {
|
|
12421
12523
|
if (props[0] instanceof Array) {
|
|
12422
12524
|
return new RandomVectorValue(props);
|
|
12423
12525
|
}
|
|
12424
12526
|
return new RandomValue(props);
|
|
12425
12527
|
},
|
|
12426
|
-
_a$
|
|
12528
|
+
_a$3[ValueType$1.CONSTANT] = function (props) {
|
|
12427
12529
|
return new StaticValue(props);
|
|
12428
12530
|
},
|
|
12429
|
-
_a$
|
|
12531
|
+
_a$3[ValueType$1.CONSTANT_VEC2] = function (props) {
|
|
12430
12532
|
return new StaticValue(props);
|
|
12431
12533
|
},
|
|
12432
|
-
_a$
|
|
12534
|
+
_a$3[ValueType$1.CONSTANT_VEC3] = function (props) {
|
|
12433
12535
|
return new StaticValue(props);
|
|
12434
12536
|
},
|
|
12435
|
-
_a$
|
|
12537
|
+
_a$3[ValueType$1.CONSTANT_VEC4] = function (props) {
|
|
12436
12538
|
return new StaticValue(props);
|
|
12437
12539
|
},
|
|
12438
|
-
_a$
|
|
12540
|
+
_a$3[ValueType$1.CURVE] = function (props) {
|
|
12439
12541
|
return new CurveValue(props);
|
|
12440
12542
|
},
|
|
12441
|
-
_a$
|
|
12543
|
+
_a$3[ValueType$1.RGBA_COLOR] = function (props) {
|
|
12442
12544
|
return new StaticValue(props);
|
|
12443
12545
|
},
|
|
12444
|
-
_a$
|
|
12546
|
+
_a$3[ValueType$1.COLORS] = function (props) {
|
|
12445
12547
|
return new RandomSetValue(props.map(function (c) { return colorToArr$1(c, false); }));
|
|
12446
12548
|
},
|
|
12447
|
-
_a$
|
|
12549
|
+
_a$3[ValueType$1.LINE] = function (props) {
|
|
12448
12550
|
if (props.length === 2 && props[0][0] === 0 && props[1][0] === 1) {
|
|
12449
12551
|
return new LinearValue([props[0][1], props[1][1]]);
|
|
12450
12552
|
}
|
|
12451
12553
|
return new LineSegments(props);
|
|
12452
12554
|
},
|
|
12453
|
-
_a$
|
|
12555
|
+
_a$3[ValueType$1.GRADIENT_COLOR] = function (props) {
|
|
12454
12556
|
return new GradientValue(props);
|
|
12455
12557
|
},
|
|
12456
|
-
_a$
|
|
12558
|
+
_a$3[ValueType$1.LINEAR_PATH] = function (pros) {
|
|
12457
12559
|
return new PathSegments(pros);
|
|
12458
12560
|
},
|
|
12459
|
-
_a$
|
|
12561
|
+
_a$3[ValueType$1.BEZIER_PATH] = function (pros) {
|
|
12460
12562
|
return new BezierSegments(pros);
|
|
12461
12563
|
},
|
|
12462
|
-
_a$
|
|
12564
|
+
_a$3);
|
|
12463
12565
|
function createValueGetter(args) {
|
|
12464
12566
|
if (!args || !isNaN(+args)) {
|
|
12465
12567
|
return new StaticValue(args || 0);
|
|
@@ -13189,7 +13291,7 @@ var CameraController = /** @class */ (function (_super) {
|
|
|
13189
13291
|
}
|
|
13190
13292
|
};
|
|
13191
13293
|
CameraController = __decorate([
|
|
13192
|
-
effectsClass(DataType.CameraController)
|
|
13294
|
+
effectsClass(DataType$1.CameraController)
|
|
13193
13295
|
], CameraController);
|
|
13194
13296
|
return CameraController;
|
|
13195
13297
|
}(ItemBehaviour));
|
|
@@ -13410,13 +13512,13 @@ var InteractMesh = /** @class */ (function () {
|
|
|
13410
13512
|
['ENV_EDITOR', ((_a = this.engine.renderer) === null || _a === void 0 ? void 0 : _a.env) === PLAYER_OPTIONS_ENV_EDITOR],
|
|
13411
13513
|
];
|
|
13412
13514
|
var color = createValueGetter(this.color).getValue(0);
|
|
13413
|
-
var level = this.engine.gpuCapability.level;
|
|
13414
13515
|
var materialProps = {
|
|
13415
13516
|
shader: {
|
|
13416
|
-
vertex:
|
|
13417
|
-
fragment:
|
|
13517
|
+
vertex: vertex,
|
|
13518
|
+
fragment: fragment,
|
|
13418
13519
|
glslVersion: GLSLVersion.GLSL1,
|
|
13419
13520
|
cacheId: "".concat(rendererOptions.cachePrefix, "_effects_interact"),
|
|
13521
|
+
marcos: marcos,
|
|
13420
13522
|
},
|
|
13421
13523
|
uniformSemantics: {
|
|
13422
13524
|
effects_MatrixVP: 'VIEWPROJECTION',
|
|
@@ -13490,11 +13592,11 @@ var InteractComponent = /** @class */ (function (_super) {
|
|
|
13490
13592
|
}
|
|
13491
13593
|
InteractComponent_1 = InteractComponent;
|
|
13492
13594
|
InteractComponent.prototype.start = function () {
|
|
13493
|
-
var
|
|
13595
|
+
var _this = this;
|
|
13494
13596
|
var options = this.item.props.content.options;
|
|
13495
|
-
var env =
|
|
13597
|
+
var env = this.item.engine.renderer.env;
|
|
13496
13598
|
var composition = this.item.composition;
|
|
13497
|
-
var
|
|
13599
|
+
var _a = this.interactData.options, type = _a.type, showPreview = _a.showPreview;
|
|
13498
13600
|
if (type === InteractType$1.CLICK) {
|
|
13499
13601
|
this.clickable = true;
|
|
13500
13602
|
if (showPreview && env === PLAYER_OPTIONS_ENV_EDITOR) {
|
|
@@ -13502,7 +13604,8 @@ var InteractComponent = /** @class */ (function (_super) {
|
|
|
13502
13604
|
this.previewContent = new InteractMesh(this.item.props.content, rendererOptions, this.transform, this.engine);
|
|
13503
13605
|
}
|
|
13504
13606
|
}
|
|
13505
|
-
|
|
13607
|
+
composition.addInteractiveItem(this.item, options.type);
|
|
13608
|
+
this.item.onEnd = function () { return composition.removeInteractiveItem(_this.item, options.type); };
|
|
13506
13609
|
if (options.type === InteractType$1.DRAG) {
|
|
13507
13610
|
if (env !== PLAYER_OPTIONS_ENV_EDITOR || options.enableInEditor) {
|
|
13508
13611
|
composition.event && this.beginDragTarget(options, composition.event);
|
|
@@ -13646,7 +13749,7 @@ var InteractComponent = /** @class */ (function (_super) {
|
|
|
13646
13749
|
};
|
|
13647
13750
|
var InteractComponent_1;
|
|
13648
13751
|
InteractComponent = InteractComponent_1 = __decorate([
|
|
13649
|
-
effectsClass(DataType.InteractComponent)
|
|
13752
|
+
effectsClass(DataType$1.InteractComponent)
|
|
13650
13753
|
], InteractComponent);
|
|
13651
13754
|
return InteractComponent;
|
|
13652
13755
|
}(RendererComponent));
|
|
@@ -13695,8 +13798,8 @@ function spriteMeshShaderFromFilter(level, options) {
|
|
|
13695
13798
|
var fragment = wireframe ? itemFrameFrag : itemFrag.replace(/#pragma\s+FILTER_FRAG/, '');
|
|
13696
13799
|
var vertex = itemVert.replace(/#pragma\s+FILTER_VERT/, 'vec4 filterMain(float t,vec4 pos){return effects_MatrixVP * pos;}');
|
|
13697
13800
|
return {
|
|
13698
|
-
fragment:
|
|
13699
|
-
vertex:
|
|
13801
|
+
fragment: fragment,
|
|
13802
|
+
vertex: vertex,
|
|
13700
13803
|
glslVersion: level === 1 ? GLSLVersion.GLSL1 : GLSLVersion.GLSL3,
|
|
13701
13804
|
marcos: marcos,
|
|
13702
13805
|
shared: true,
|
|
@@ -15015,7 +15118,7 @@ var SpriteComponent = /** @class */ (function (_super) {
|
|
|
15015
15118
|
_super.prototype.toData.call(this);
|
|
15016
15119
|
};
|
|
15017
15120
|
SpriteComponent = __decorate([
|
|
15018
|
-
effectsClass(DataType.SpriteComponent)
|
|
15121
|
+
effectsClass(DataType$1.SpriteComponent)
|
|
15019
15122
|
], SpriteComponent);
|
|
15020
15123
|
return SpriteComponent;
|
|
15021
15124
|
}(RendererComponent));
|
|
@@ -15176,8 +15279,8 @@ var ParticleMesh = /** @class */ (function () {
|
|
|
15176
15279
|
var originalVertex = "#define LOOKUP_TEXTURE_CURVE ".concat(vertex_lookup_texture, "\n").concat(particleVert);
|
|
15177
15280
|
var vertex = originalVertex;
|
|
15178
15281
|
var shader = {
|
|
15179
|
-
fragment:
|
|
15180
|
-
vertex:
|
|
15282
|
+
fragment: fragment,
|
|
15283
|
+
vertex: vertex,
|
|
15181
15284
|
glslVersion: level === 1 ? GLSLVersion.GLSL1 : GLSLVersion.GLSL3,
|
|
15182
15285
|
shared: true,
|
|
15183
15286
|
cacheId: shaderCache,
|
|
@@ -15732,8 +15835,8 @@ var TrailMesh = /** @class */ (function () {
|
|
|
15732
15835
|
else {
|
|
15733
15836
|
uniformValues.uVCurveValues = CurveValue.getAllData(keyFrameMeta);
|
|
15734
15837
|
}
|
|
15735
|
-
var vertex =
|
|
15736
|
-
var fragment =
|
|
15838
|
+
var vertex = trailVert;
|
|
15839
|
+
var fragment = particleFrag;
|
|
15737
15840
|
var mtl = ({
|
|
15738
15841
|
shader: {
|
|
15739
15842
|
vertex: vertex,
|
|
@@ -16420,7 +16523,7 @@ var TextureShape = /** @class */ (function () {
|
|
|
16420
16523
|
return TextureShape;
|
|
16421
16524
|
}());
|
|
16422
16525
|
|
|
16423
|
-
var _a$
|
|
16526
|
+
var _a$2;
|
|
16424
16527
|
var ShapeNone = /** @class */ (function () {
|
|
16425
16528
|
function ShapeNone() {
|
|
16426
16529
|
}
|
|
@@ -16432,18 +16535,18 @@ var ShapeNone = /** @class */ (function () {
|
|
|
16432
16535
|
};
|
|
16433
16536
|
return ShapeNone;
|
|
16434
16537
|
}());
|
|
16435
|
-
var map = (_a$
|
|
16436
|
-
_a$
|
|
16437
|
-
_a$
|
|
16438
|
-
_a$
|
|
16439
|
-
_a$
|
|
16440
|
-
_a$
|
|
16441
|
-
_a$
|
|
16442
|
-
_a$
|
|
16443
|
-
_a$
|
|
16444
|
-
_a$
|
|
16445
|
-
_a$
|
|
16446
|
-
_a$
|
|
16538
|
+
var map = (_a$2 = {},
|
|
16539
|
+
_a$2[ShapeType$1.NONE] = ShapeNone,
|
|
16540
|
+
_a$2[ShapeType$1.CONE] = Cone,
|
|
16541
|
+
_a$2[ShapeType$1.SPHERE] = Sphere,
|
|
16542
|
+
_a$2[ShapeType$1.HEMISPHERE] = Hemisphere,
|
|
16543
|
+
_a$2[ShapeType$1.CIRCLE] = Circle,
|
|
16544
|
+
_a$2[ShapeType$1.DONUT] = Donut,
|
|
16545
|
+
_a$2[ShapeType$1.RECTANGLE] = Rectangle,
|
|
16546
|
+
_a$2[ShapeType$1.EDGE] = Edge,
|
|
16547
|
+
_a$2[ShapeType$1.RECTANGLE_EDGE] = RectangleEdge,
|
|
16548
|
+
_a$2[ShapeType$1.TEXTURE] = TextureShape,
|
|
16549
|
+
_a$2);
|
|
16447
16550
|
function createShape(shapeOptions) {
|
|
16448
16551
|
if (!shapeOptions) {
|
|
16449
16552
|
return new ShapeNone();
|
|
@@ -17772,7 +17875,7 @@ var ParticleSystem = /** @class */ (function (_super) {
|
|
|
17772
17875
|
}));
|
|
17773
17876
|
p.delay += meshTime;
|
|
17774
17877
|
cursor++;
|
|
17775
|
-
(_a = p.transform).translate.apply(_a, __spreadArray$
|
|
17878
|
+
(_a = p.transform).translate.apply(_a, __spreadArray$3([], __read$3(burstOffset), false));
|
|
17776
17879
|
this.addParticle(p, maxCount_1);
|
|
17777
17880
|
}
|
|
17778
17881
|
}
|
|
@@ -18361,7 +18464,7 @@ var ParticleSystem = /** @class */ (function (_super) {
|
|
|
18361
18464
|
timeline.createTrack(Track).createClip(ParticleBehaviourPlayable);
|
|
18362
18465
|
};
|
|
18363
18466
|
ParticleSystem = __decorate([
|
|
18364
|
-
effectsClass(DataType.ParticleSystem)
|
|
18467
|
+
effectsClass(DataType$1.ParticleSystem)
|
|
18365
18468
|
], ParticleSystem);
|
|
18366
18469
|
return ParticleSystem;
|
|
18367
18470
|
}(Component));
|
|
@@ -18544,7 +18647,9 @@ var TextStyle = /** @class */ (function () {
|
|
|
18544
18647
|
this.fontOffset = 0;
|
|
18545
18648
|
var _g = options.textColor, textColor = _g === void 0 ? [1, 1, 1, 1] : _g, _h = options.fontSize, fontSize = _h === void 0 ? 40 : _h, outline = options.outline, shadow = options.shadow, _j = options.fontWeight, fontWeight = _j === void 0 ? 'normal' : _j, _k = options.fontStyle, fontStyle = _k === void 0 ? 'normal' : _k, _l = options.fontFamily, fontFamily = _l === void 0 ? 'sans-serif' : _l;
|
|
18546
18649
|
this.textColor = textColor;
|
|
18650
|
+
//@ts-expect-error
|
|
18547
18651
|
this.textWeight = fontWeight;
|
|
18652
|
+
//@ts-expect-error
|
|
18548
18653
|
this.fontStyle = fontStyle;
|
|
18549
18654
|
this.fontFamily = fontFamily;
|
|
18550
18655
|
this.fontSize = fontSize; // 暂时取消字号限制 Math.min(fontSize, this.maxFontSize);
|
|
@@ -20054,7 +20159,7 @@ var TextComponent = /** @class */ (function (_super) {
|
|
|
20054
20159
|
context.shadowOffsetY = -style.shadowOffsetY;
|
|
20055
20160
|
};
|
|
20056
20161
|
TextComponent = __decorate([
|
|
20057
|
-
effectsClass(DataType.TextComponent)
|
|
20162
|
+
effectsClass(DataType$1.TextComponent)
|
|
20058
20163
|
], TextComponent);
|
|
20059
20164
|
return TextComponent;
|
|
20060
20165
|
}(SpriteComponent));
|
|
@@ -20210,7 +20315,7 @@ var EffectComponent = /** @class */ (function (_super) {
|
|
|
20210
20315
|
serialize()
|
|
20211
20316
|
], EffectComponent.prototype, "geometry", void 0);
|
|
20212
20317
|
EffectComponent = __decorate([
|
|
20213
|
-
effectsClass(DataType.EffectComponent)
|
|
20318
|
+
effectsClass(DataType$1.EffectComponent)
|
|
20214
20319
|
], EffectComponent);
|
|
20215
20320
|
return EffectComponent;
|
|
20216
20321
|
}(RendererComponent));
|
|
@@ -20612,7 +20717,10 @@ var VFXItem = /** @class */ (function (_super) {
|
|
|
20612
20717
|
try {
|
|
20613
20718
|
for (var _e = __values$1(this.children), _f = _e.next(); !_f.done; _f = _e.next()) {
|
|
20614
20719
|
var child = _f.value;
|
|
20615
|
-
|
|
20720
|
+
var res = child.find(name);
|
|
20721
|
+
if (res) {
|
|
20722
|
+
return res;
|
|
20723
|
+
}
|
|
20616
20724
|
}
|
|
20617
20725
|
}
|
|
20618
20726
|
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
@@ -20629,6 +20737,7 @@ var VFXItem = /** @class */ (function (_super) {
|
|
|
20629
20737
|
_super.prototype.fromData.call(this, data);
|
|
20630
20738
|
var id = data.id, name = data.name, delay = data.delay, parentId = data.parentId, endBehavior = data.endBehavior, transform = data.transform, _b = data.listIndex, listIndex = _b === void 0 ? 0 : _b, _c = data.duration, duration = _c === void 0 ? 0 : _c;
|
|
20631
20739
|
this.props = data;
|
|
20740
|
+
//@ts-expect-error
|
|
20632
20741
|
this.type = data.type;
|
|
20633
20742
|
this.id = id.toString(); // TODO 老数据 id 是 number,需要转换
|
|
20634
20743
|
this.name = name;
|
|
@@ -20697,7 +20806,7 @@ var VFXItem = /** @class */ (function (_super) {
|
|
|
20697
20806
|
var _b, _c;
|
|
20698
20807
|
this.taggedProperties.id = this.guid;
|
|
20699
20808
|
this.taggedProperties.transform = this.transform.toData();
|
|
20700
|
-
this.taggedProperties.dataType = DataType.VFXItemData;
|
|
20809
|
+
this.taggedProperties.dataType = DataType$1.VFXItemData;
|
|
20701
20810
|
if (((_b = this.parent) === null || _b === void 0 ? void 0 : _b.name) !== 'rootItem') {
|
|
20702
20811
|
this.taggedProperties.parentId = (_c = this.parent) === null || _c === void 0 ? void 0 : _c.guid;
|
|
20703
20812
|
}
|
|
@@ -20724,10 +20833,10 @@ var VFXItem = /** @class */ (function (_super) {
|
|
|
20724
20833
|
};
|
|
20725
20834
|
VFXItem.prototype.translateByPixel = function (x, y) {
|
|
20726
20835
|
if (this.composition) {
|
|
20836
|
+
// @ts-expect-error
|
|
20837
|
+
var _a = this.composition.renderer.canvas.getBoundingClientRect(), width = _a.width, height = _a.height;
|
|
20727
20838
|
var z = this.transform.getWorldPosition().z;
|
|
20728
|
-
var
|
|
20729
|
-
var width = this.composition.renderer.getWidth() / 2;
|
|
20730
|
-
var height = this.composition.renderer.getHeight() / 2;
|
|
20839
|
+
var _b = this.composition.camera.getInverseVPRatio(z), rx = _b.x, ry = _b.y;
|
|
20731
20840
|
this.transform.translate(2 * x * rx / width, -2 * y * ry / height, 0);
|
|
20732
20841
|
}
|
|
20733
20842
|
};
|
|
@@ -20794,7 +20903,7 @@ var VFXItem = /** @class */ (function (_super) {
|
|
|
20794
20903
|
};
|
|
20795
20904
|
var VFXItem_1;
|
|
20796
20905
|
VFXItem = VFXItem_1 = __decorate([
|
|
20797
|
-
effectsClass(DataType.VFXItemData)
|
|
20906
|
+
effectsClass(DataType$1.VFXItemData)
|
|
20798
20907
|
], VFXItem);
|
|
20799
20908
|
return VFXItem;
|
|
20800
20909
|
}(EffectsObject));
|
|
@@ -20832,7 +20941,6 @@ function createVFXItem(props, composition) {
|
|
|
20832
20941
|
if (!pluginName) {
|
|
20833
20942
|
switch (type) {
|
|
20834
20943
|
case ItemType$1.null:
|
|
20835
|
-
case ItemType$1.base:
|
|
20836
20944
|
pluginName = 'cal';
|
|
20837
20945
|
break;
|
|
20838
20946
|
case ItemType$1.sprite:
|
|
@@ -20953,7 +21061,7 @@ var PluginSystem = /** @class */ (function () {
|
|
|
20953
21061
|
plugin = plugins[i];
|
|
20954
21062
|
ctrl = pluginLoaderMap[plugin.name];
|
|
20955
21063
|
if (name in ctrl) {
|
|
20956
|
-
pendings.push(Promise.resolve(ctrl[name].apply(ctrl, __spreadArray$
|
|
21064
|
+
pendings.push(Promise.resolve(ctrl[name].apply(ctrl, __spreadArray$3([], __read$3(args), false))));
|
|
20957
21065
|
}
|
|
20958
21066
|
}
|
|
20959
21067
|
return [2 /*return*/, Promise.all(pendings)];
|
|
@@ -20998,9 +21106,74 @@ function getPluginUsageInfo(name) {
|
|
|
20998
21106
|
* Name: @galacean/effects-specification
|
|
20999
21107
|
* Description: Galacean Effects JSON Specification
|
|
21000
21108
|
* Author: Ant Group CO., Ltd.
|
|
21001
|
-
* Version:
|
|
21109
|
+
* Version: v2.0.0-alpha.3
|
|
21110
|
+
*/
|
|
21111
|
+
|
|
21112
|
+
const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
21113
|
+
var native = {
|
|
21114
|
+
randomUUID
|
|
21115
|
+
};
|
|
21116
|
+
|
|
21117
|
+
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
|
21118
|
+
// require the crypto API and do not support built-in fallback to lower quality random number
|
|
21119
|
+
// generators (like Math.random()).
|
|
21120
|
+
let getRandomValues;
|
|
21121
|
+
const rnds8 = new Uint8Array(16);
|
|
21122
|
+
function rng() {
|
|
21123
|
+
// lazy load so that environments that need to polyfill have a chance to do so
|
|
21124
|
+
if (!getRandomValues) {
|
|
21125
|
+
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
|
|
21126
|
+
getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
|
|
21127
|
+
|
|
21128
|
+
if (!getRandomValues) {
|
|
21129
|
+
throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
|
|
21130
|
+
}
|
|
21131
|
+
}
|
|
21132
|
+
|
|
21133
|
+
return getRandomValues(rnds8);
|
|
21134
|
+
}
|
|
21135
|
+
|
|
21136
|
+
/**
|
|
21137
|
+
* Convert array of 16 byte values to UUID string format of the form:
|
|
21138
|
+
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
|
21002
21139
|
*/
|
|
21003
21140
|
|
|
21141
|
+
const byteToHex = [];
|
|
21142
|
+
|
|
21143
|
+
for (let i = 0; i < 256; ++i) {
|
|
21144
|
+
byteToHex.push((i + 0x100).toString(16).slice(1));
|
|
21145
|
+
}
|
|
21146
|
+
|
|
21147
|
+
function unsafeStringify(arr, offset = 0) {
|
|
21148
|
+
// Note: Be careful editing this code! It's been tuned for performance
|
|
21149
|
+
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
|
|
21150
|
+
return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
|
|
21151
|
+
}
|
|
21152
|
+
|
|
21153
|
+
function v4(options, buf, offset) {
|
|
21154
|
+
if (native.randomUUID && !buf && !options) {
|
|
21155
|
+
return native.randomUUID();
|
|
21156
|
+
}
|
|
21157
|
+
|
|
21158
|
+
options = options || {};
|
|
21159
|
+
const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
|
21160
|
+
|
|
21161
|
+
rnds[6] = rnds[6] & 0x0f | 0x40;
|
|
21162
|
+
rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
|
|
21163
|
+
|
|
21164
|
+
if (buf) {
|
|
21165
|
+
offset = offset || 0;
|
|
21166
|
+
|
|
21167
|
+
for (let i = 0; i < 16; ++i) {
|
|
21168
|
+
buf[offset + i] = rnds[i];
|
|
21169
|
+
}
|
|
21170
|
+
|
|
21171
|
+
return buf;
|
|
21172
|
+
}
|
|
21173
|
+
|
|
21174
|
+
return unsafeStringify(rnds);
|
|
21175
|
+
}
|
|
21176
|
+
|
|
21004
21177
|
/*********************************************/
|
|
21005
21178
|
/* 元素属性参数类型 */
|
|
21006
21179
|
/*********************************************/
|
|
@@ -21263,6 +21436,10 @@ var ItemType;
|
|
|
21263
21436
|
* 天空盒元素
|
|
21264
21437
|
*/
|
|
21265
21438
|
ItemType["skybox"] = "skybox";
|
|
21439
|
+
/**
|
|
21440
|
+
* 特效元素
|
|
21441
|
+
*/
|
|
21442
|
+
ItemType["effect"] = "effect";
|
|
21266
21443
|
})(ItemType || (ItemType = {}));
|
|
21267
21444
|
/**
|
|
21268
21445
|
* 渲染模式
|
|
@@ -21375,6 +21552,10 @@ var CompositionEndBehavior;
|
|
|
21375
21552
|
* 销毁并保留最后一帧
|
|
21376
21553
|
*/
|
|
21377
21554
|
CompositionEndBehavior[CompositionEndBehavior["pause_destroy"] = END_BEHAVIOR_PAUSE_AND_DESTROY] = "pause_destroy";
|
|
21555
|
+
/**
|
|
21556
|
+
* 冻结
|
|
21557
|
+
*/
|
|
21558
|
+
CompositionEndBehavior[CompositionEndBehavior["freeze"] = END_BEHAVIOR_FREEZE] = "freeze";
|
|
21378
21559
|
})(CompositionEndBehavior || (CompositionEndBehavior = {}));
|
|
21379
21560
|
|
|
21380
21561
|
/*********************************************/
|
|
@@ -21511,12 +21692,38 @@ var ShapeArcMode;
|
|
|
21511
21692
|
ShapeArcMode[ShapeArcMode["UNIFORM_BURST"] = 3] = "UNIFORM_BURST";
|
|
21512
21693
|
})(ShapeArcMode || (ShapeArcMode = {}));
|
|
21513
21694
|
|
|
21695
|
+
var LightType;
|
|
21696
|
+
(function (LightType) {
|
|
21697
|
+
/**
|
|
21698
|
+
* 点光源
|
|
21699
|
+
*/
|
|
21700
|
+
LightType["point"] = "point";
|
|
21701
|
+
/**
|
|
21702
|
+
* 聚光灯
|
|
21703
|
+
*/
|
|
21704
|
+
LightType["spot"] = "spot";
|
|
21705
|
+
/**
|
|
21706
|
+
* 方向光
|
|
21707
|
+
*/
|
|
21708
|
+
LightType["directional"] = "directional";
|
|
21709
|
+
/**
|
|
21710
|
+
* 环境光
|
|
21711
|
+
*/
|
|
21712
|
+
LightType["ambient"] = "ambient";
|
|
21713
|
+
})(LightType || (LightType = {}));
|
|
21714
|
+
|
|
21514
21715
|
var ModelBoundingType;
|
|
21515
21716
|
(function (ModelBoundingType) {
|
|
21516
21717
|
ModelBoundingType[ModelBoundingType["box"] = 2] = "box";
|
|
21517
21718
|
ModelBoundingType[ModelBoundingType["sphere"] = 3] = "sphere";
|
|
21518
21719
|
})(ModelBoundingType || (ModelBoundingType = {}));
|
|
21519
21720
|
|
|
21721
|
+
var CameraType;
|
|
21722
|
+
(function (CameraType) {
|
|
21723
|
+
CameraType["orthographic"] = "orthographic";
|
|
21724
|
+
CameraType["perspective"] = "perspective";
|
|
21725
|
+
})(CameraType || (CameraType = {}));
|
|
21726
|
+
|
|
21520
21727
|
// 材质类型
|
|
21521
21728
|
var MaterialType;
|
|
21522
21729
|
(function (MaterialType) {
|
|
@@ -21662,6 +21869,28 @@ var FontStyle;
|
|
|
21662
21869
|
FontStyle["oblique"] = "oblique";
|
|
21663
21870
|
})(FontStyle || (FontStyle = {}));
|
|
21664
21871
|
|
|
21872
|
+
var DataType;
|
|
21873
|
+
(function (DataType) {
|
|
21874
|
+
DataType["VFXItemData"] = "VFXItemData";
|
|
21875
|
+
DataType["EffectComponent"] = "EffectComponent";
|
|
21876
|
+
DataType["Material"] = "Material";
|
|
21877
|
+
DataType["Shader"] = "Shader";
|
|
21878
|
+
DataType["SpriteComponent"] = "SpriteComponent";
|
|
21879
|
+
DataType["ParticleSystem"] = "ParticleSystem";
|
|
21880
|
+
DataType["InteractComponent"] = "InteractComponent";
|
|
21881
|
+
DataType["CameraController"] = "CameraController";
|
|
21882
|
+
DataType["Geometry"] = "Geometry";
|
|
21883
|
+
DataType["Texture"] = "Texture";
|
|
21884
|
+
DataType["TextComponent"] = "TextComponent";
|
|
21885
|
+
// FIXME: 先完成ECS的场景转换,后面移到spec中
|
|
21886
|
+
DataType["MeshComponent"] = "MeshComponent";
|
|
21887
|
+
DataType["SkyboxComponent"] = "SkyboxComponent";
|
|
21888
|
+
DataType["LightComponent"] = "LightComponent";
|
|
21889
|
+
DataType["CameraComponent"] = "CameraComponent";
|
|
21890
|
+
DataType["ModelPluginComponent"] = "ModelPluginComponent";
|
|
21891
|
+
DataType["TreeComponent"] = "TreeComponent";
|
|
21892
|
+
})(DataType || (DataType = {}));
|
|
21893
|
+
|
|
21665
21894
|
/******************************************************************************
|
|
21666
21895
|
Copyright (c) Microsoft Corporation.
|
|
21667
21896
|
|
|
@@ -21717,11 +21946,22 @@ function __read(o, n) {
|
|
|
21717
21946
|
return ar;
|
|
21718
21947
|
}
|
|
21719
21948
|
|
|
21949
|
+
function __spreadArray(to, from, pack) {
|
|
21950
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
21951
|
+
if (ar || !(i in from)) {
|
|
21952
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
21953
|
+
ar[i] = from[i];
|
|
21954
|
+
}
|
|
21955
|
+
}
|
|
21956
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
21957
|
+
}
|
|
21958
|
+
|
|
21720
21959
|
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
21721
21960
|
var e = new Error(message);
|
|
21722
21961
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
21723
21962
|
};
|
|
21724
21963
|
|
|
21964
|
+
var _a$1;
|
|
21725
21965
|
function arrAdd(arr, item) {
|
|
21726
21966
|
if (!arr.includes(item)) {
|
|
21727
21967
|
arr.push(item);
|
|
@@ -21957,6 +22197,34 @@ function rotationZYXFromQuat(out, quat) {
|
|
|
21957
22197
|
}
|
|
21958
22198
|
return out;
|
|
21959
22199
|
}
|
|
22200
|
+
function generateGUID() {
|
|
22201
|
+
return v4().replace(/-/g, '');
|
|
22202
|
+
}
|
|
22203
|
+
/**
|
|
22204
|
+
* 提取并转换 JSON 数据中的 anchor 值
|
|
22205
|
+
*/
|
|
22206
|
+
function convertAnchor$1(anchor, particleOrigin) {
|
|
22207
|
+
if (anchor) {
|
|
22208
|
+
return [anchor[0] - 0.5, 0.5 - anchor[1]];
|
|
22209
|
+
}
|
|
22210
|
+
else if (particleOrigin) {
|
|
22211
|
+
return particleOriginTranslateMap[particleOrigin];
|
|
22212
|
+
}
|
|
22213
|
+
else {
|
|
22214
|
+
return [0, 0];
|
|
22215
|
+
}
|
|
22216
|
+
}
|
|
22217
|
+
var particleOriginTranslateMap = (_a$1 = {},
|
|
22218
|
+
_a$1[ParticleOrigin.PARTICLE_ORIGIN_CENTER] = [0, 0],
|
|
22219
|
+
_a$1[ParticleOrigin.PARTICLE_ORIGIN_CENTER_BOTTOM] = [0, -0.5],
|
|
22220
|
+
_a$1[ParticleOrigin.PARTICLE_ORIGIN_CENTER_TOP] = [0, 0.5],
|
|
22221
|
+
_a$1[ParticleOrigin.PARTICLE_ORIGIN_LEFT_TOP] = [-0.5, 0.5],
|
|
22222
|
+
_a$1[ParticleOrigin.PARTICLE_ORIGIN_LEFT_CENTER] = [-0.5, 0],
|
|
22223
|
+
_a$1[ParticleOrigin.PARTICLE_ORIGIN_LEFT_BOTTOM] = [-0.5, -0.5],
|
|
22224
|
+
_a$1[ParticleOrigin.PARTICLE_ORIGIN_RIGHT_CENTER] = [0.5, 0],
|
|
22225
|
+
_a$1[ParticleOrigin.PARTICLE_ORIGIN_RIGHT_BOTTOM] = [0.5, -0.5],
|
|
22226
|
+
_a$1[ParticleOrigin.PARTICLE_ORIGIN_RIGHT_TOP] = [0.5, 0.5],
|
|
22227
|
+
_a$1);
|
|
21960
22228
|
|
|
21961
22229
|
function getStandardParticleContent(particle) {
|
|
21962
22230
|
var _a;
|
|
@@ -22368,6 +22636,306 @@ function version22Migration(json) {
|
|
|
22368
22636
|
});
|
|
22369
22637
|
return json;
|
|
22370
22638
|
}
|
|
22639
|
+
/**
|
|
22640
|
+
* 3.0 以下版本数据适配(runtime 2.0及以上版本支持)
|
|
22641
|
+
*/
|
|
22642
|
+
function version30Migration(json) {
|
|
22643
|
+
var e_1, _a;
|
|
22644
|
+
var _b, _c, _d, _e, _f, _g, _h, _j;
|
|
22645
|
+
var result = Object.assign({}, json, {
|
|
22646
|
+
items: [],
|
|
22647
|
+
components: [],
|
|
22648
|
+
materials: [],
|
|
22649
|
+
shaders: [],
|
|
22650
|
+
geometries: [],
|
|
22651
|
+
});
|
|
22652
|
+
// 兼容老版本数据中不存在textures的情况
|
|
22653
|
+
(_b = result.textures) !== null && _b !== void 0 ? _b : (result.textures = []);
|
|
22654
|
+
result.textures.forEach(function (textureOptions) {
|
|
22655
|
+
Object.assign(textureOptions, {
|
|
22656
|
+
id: generateGUID(),
|
|
22657
|
+
dataType: DataType.Texture,
|
|
22658
|
+
});
|
|
22659
|
+
});
|
|
22660
|
+
if (result.textures.length < result.images.length) {
|
|
22661
|
+
for (var i = result.textures.length; i < result.images.length; i++) {
|
|
22662
|
+
result.textures.push({
|
|
22663
|
+
//@ts-expect-error
|
|
22664
|
+
id: generateGUID(),
|
|
22665
|
+
dataType: DataType.Texture,
|
|
22666
|
+
source: i,
|
|
22667
|
+
flipY: true,
|
|
22668
|
+
});
|
|
22669
|
+
}
|
|
22670
|
+
}
|
|
22671
|
+
var _loop_1 = function (composition) {
|
|
22672
|
+
var e_2, _m, e_3, _o;
|
|
22673
|
+
// composition 的 endbehaviour 兼容
|
|
22674
|
+
if (composition.endBehavior === END_BEHAVIOR_PAUSE_AND_DESTROY || composition.endBehavior === END_BEHAVIOR_PAUSE) {
|
|
22675
|
+
composition.endBehavior = END_BEHAVIOR_FREEZE;
|
|
22676
|
+
}
|
|
22677
|
+
var itemGuidMap = {};
|
|
22678
|
+
try {
|
|
22679
|
+
for (var _p = (e_2 = void 0, __values(composition.items)), _q = _p.next(); !_q.done; _q = _p.next()) {
|
|
22680
|
+
var item = _q.value;
|
|
22681
|
+
itemGuidMap[item.id] = generateGUID();
|
|
22682
|
+
// TODO: 编辑器测试用,上线后删除
|
|
22683
|
+
//@ts-expect-error
|
|
22684
|
+
item.oldId = item.id;
|
|
22685
|
+
item.id = itemGuidMap[item.id];
|
|
22686
|
+
}
|
|
22687
|
+
}
|
|
22688
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
22689
|
+
finally {
|
|
22690
|
+
try {
|
|
22691
|
+
if (_q && !_q.done && (_m = _p.return)) _m.call(_p);
|
|
22692
|
+
}
|
|
22693
|
+
finally { if (e_2) throw e_2.error; }
|
|
22694
|
+
}
|
|
22695
|
+
composition.items.forEach(function (item, index) {
|
|
22696
|
+
if (item.parentId) {
|
|
22697
|
+
if (item.parentId.includes('^')) {
|
|
22698
|
+
var parentId = (item.parentId).split('^')[0];
|
|
22699
|
+
var nodeId = (item.parentId).split('^')[1];
|
|
22700
|
+
item.parentId = itemGuidMap[parentId] + '^' + nodeId;
|
|
22701
|
+
}
|
|
22702
|
+
else {
|
|
22703
|
+
item.parentId = itemGuidMap[item.parentId];
|
|
22704
|
+
}
|
|
22705
|
+
}
|
|
22706
|
+
// @ts-expect-error fix item type
|
|
22707
|
+
result.items.push(item);
|
|
22708
|
+
// @ts-expect-error fix item type
|
|
22709
|
+
composition.items[index] = { id: item.id };
|
|
22710
|
+
});
|
|
22711
|
+
try {
|
|
22712
|
+
for (var _r = (e_3 = void 0, __values(result.items)), _s = _r.next(); !_s.done; _s = _r.next()) {
|
|
22713
|
+
var item = _s.value;
|
|
22714
|
+
// 原 texture 索引转为统一 guid 索引
|
|
22715
|
+
if (item.content) {
|
|
22716
|
+
if (item.content.renderer) {
|
|
22717
|
+
if (item.content.renderer.texture !== undefined) {
|
|
22718
|
+
var oldTextureId = item.content.renderer.texture;
|
|
22719
|
+
//@ts-expect-error
|
|
22720
|
+
item.content.renderer.texture = { id: result.textures[oldTextureId].id };
|
|
22721
|
+
}
|
|
22722
|
+
}
|
|
22723
|
+
if (item.content.trails) {
|
|
22724
|
+
if (item.content.trails.texture !== undefined) {
|
|
22725
|
+
var oldTextureId = item.content.trails.texture;
|
|
22726
|
+
//@ts-expect-error
|
|
22727
|
+
item.content.trails.texture = { id: result.textures[oldTextureId].id };
|
|
22728
|
+
}
|
|
22729
|
+
}
|
|
22730
|
+
}
|
|
22731
|
+
// item 的 transform 属性由数组转为 {x:n, y:n, z:n}
|
|
22732
|
+
if (item.transform) {
|
|
22733
|
+
//@ts-expect-error
|
|
22734
|
+
var position = __spreadArray([], __read((_c = item.transform.position) !== null && _c !== void 0 ? _c : [0, 0, 0]), false);
|
|
22735
|
+
//@ts-expect-error
|
|
22736
|
+
var rotation = __spreadArray([], __read((_d = item.transform.rotation) !== null && _d !== void 0 ? _d : [0, 0, 0]), false);
|
|
22737
|
+
//@ts-expect-error
|
|
22738
|
+
var scale = __spreadArray([], __read((_e = item.transform.scale) !== null && _e !== void 0 ? _e : [1, 1, 1]), false);
|
|
22739
|
+
Object.assign(item, {
|
|
22740
|
+
transform: {
|
|
22741
|
+
position: { x: position[0], y: position[1], z: position[2] },
|
|
22742
|
+
rotation: { x: rotation[0], y: rotation[1], z: rotation[2] },
|
|
22743
|
+
scale: { x: scale[0], y: scale[1], z: scale[0] },
|
|
22744
|
+
},
|
|
22745
|
+
});
|
|
22746
|
+
// sprite 的 scale 转为 size
|
|
22747
|
+
if (item.type === ItemType.sprite) {
|
|
22748
|
+
item.transform.size = { x: scale[0], y: scale[1] };
|
|
22749
|
+
item.transform.scale = { x: 1, y: 1, z: 1 };
|
|
22750
|
+
}
|
|
22751
|
+
// sprite 的 anchor 修正
|
|
22752
|
+
if (item.type === ItemType.sprite) {
|
|
22753
|
+
var content = item.content;
|
|
22754
|
+
if (!content.renderer) {
|
|
22755
|
+
content.renderer = {};
|
|
22756
|
+
}
|
|
22757
|
+
var renderer = content.renderer;
|
|
22758
|
+
var realAnchor = convertAnchor$1(renderer.anchor, renderer.particleOrigin);
|
|
22759
|
+
var startSize = item.transform.size;
|
|
22760
|
+
// 兼容旧JSON(anchor和particleOrigin可能同时存在)
|
|
22761
|
+
if (!renderer.anchor && renderer.particleOrigin !== undefined) {
|
|
22762
|
+
item.transform.position.x += -realAnchor[0] * ((_f = startSize === null || startSize === void 0 ? void 0 : startSize.x) !== null && _f !== void 0 ? _f : 1);
|
|
22763
|
+
item.transform.position.y += -realAnchor[1] * ((_g = startSize === null || startSize === void 0 ? void 0 : startSize.y) !== null && _g !== void 0 ? _g : 1);
|
|
22764
|
+
}
|
|
22765
|
+
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) };
|
|
22766
|
+
}
|
|
22767
|
+
}
|
|
22768
|
+
if (item.type === ItemType.particle) {
|
|
22769
|
+
var content = item.content;
|
|
22770
|
+
if (!content.renderer) {
|
|
22771
|
+
content.renderer = {};
|
|
22772
|
+
}
|
|
22773
|
+
var renderer = content.renderer;
|
|
22774
|
+
content.renderer.anchor = convertAnchor$1(renderer.anchor, renderer.particleOrigin);
|
|
22775
|
+
}
|
|
22776
|
+
// 动画数据转化 TODO: 动画数据移到 TimelineComponentData
|
|
22777
|
+
item.content.tracks = [];
|
|
22778
|
+
var tracks = item.content.tracks;
|
|
22779
|
+
if (item.type !== ItemType.particle) {
|
|
22780
|
+
tracks.push({
|
|
22781
|
+
clips: [
|
|
22782
|
+
{
|
|
22783
|
+
dataType: 'TransformAnimationPlayableAsset',
|
|
22784
|
+
animationClip: {
|
|
22785
|
+
sizeOverLifetime: item.content.sizeOverLifetime,
|
|
22786
|
+
rotationOverLifetime: item.content.rotationOverLifetime,
|
|
22787
|
+
positionOverLifetime: item.content.positionOverLifetime,
|
|
22788
|
+
},
|
|
22789
|
+
},
|
|
22790
|
+
],
|
|
22791
|
+
});
|
|
22792
|
+
}
|
|
22793
|
+
if (item.type === ItemType.sprite) {
|
|
22794
|
+
tracks.push({
|
|
22795
|
+
clips: [
|
|
22796
|
+
{
|
|
22797
|
+
dataType: 'SpriteColorAnimationPlayableAsset',
|
|
22798
|
+
animationClip: {
|
|
22799
|
+
colorOverLifetime: item.content.colorOverLifetime,
|
|
22800
|
+
startColor: item.content.options.startColor,
|
|
22801
|
+
},
|
|
22802
|
+
},
|
|
22803
|
+
],
|
|
22804
|
+
});
|
|
22805
|
+
}
|
|
22806
|
+
// gizmo 的 target id 转换为新的 item guid
|
|
22807
|
+
if (item.content.options.target) {
|
|
22808
|
+
item.content.options.target = itemGuidMap[item.content.options.target];
|
|
22809
|
+
}
|
|
22810
|
+
// item 的 content 转为 component data 加入 JSONScene.components
|
|
22811
|
+
var uuid = generateGUID();
|
|
22812
|
+
if (item.type === ItemType.sprite) {
|
|
22813
|
+
item.components = [];
|
|
22814
|
+
result.components.push(item.content);
|
|
22815
|
+
item.content.id = uuid;
|
|
22816
|
+
item.content.dataType = DataType.SpriteComponent;
|
|
22817
|
+
item.content.item = { id: item.id };
|
|
22818
|
+
item.dataType = DataType.VFXItemData;
|
|
22819
|
+
//@ts-expect-error
|
|
22820
|
+
item.components.push({ id: item.content.id });
|
|
22821
|
+
}
|
|
22822
|
+
else if (item.type === ItemType.particle) {
|
|
22823
|
+
item.components = [];
|
|
22824
|
+
result.components.push(item.content);
|
|
22825
|
+
item.content.id = uuid;
|
|
22826
|
+
item.content.dataType = DataType.ParticleSystem;
|
|
22827
|
+
item.content.item = { id: item.id };
|
|
22828
|
+
item.dataType = DataType.VFXItemData;
|
|
22829
|
+
//@ts-expect-error
|
|
22830
|
+
item.components.push({ id: item.content.id });
|
|
22831
|
+
}
|
|
22832
|
+
else if (item.type === ItemType.mesh) {
|
|
22833
|
+
item.components = [];
|
|
22834
|
+
result.components.push(item.content);
|
|
22835
|
+
item.content.id = uuid;
|
|
22836
|
+
item.content.dataType = DataType.MeshComponent;
|
|
22837
|
+
item.content.item = { id: item.id };
|
|
22838
|
+
item.dataType = DataType.VFXItemData;
|
|
22839
|
+
//@ts-expect-error
|
|
22840
|
+
item.components.push({ id: item.content.id });
|
|
22841
|
+
}
|
|
22842
|
+
else if (item.type === ItemType.skybox) {
|
|
22843
|
+
item.components = [];
|
|
22844
|
+
result.components.push(item.content);
|
|
22845
|
+
item.content.id = uuid;
|
|
22846
|
+
item.content.dataType = DataType.SkyboxComponent;
|
|
22847
|
+
item.content.item = { id: item.id };
|
|
22848
|
+
item.dataType = DataType.VFXItemData;
|
|
22849
|
+
//@ts-expect-error
|
|
22850
|
+
item.components.push({ id: item.content.id });
|
|
22851
|
+
}
|
|
22852
|
+
else if (item.type === ItemType.light) {
|
|
22853
|
+
item.components = [];
|
|
22854
|
+
result.components.push(item.content);
|
|
22855
|
+
item.content.id = uuid;
|
|
22856
|
+
item.content.dataType = DataType.LightComponent;
|
|
22857
|
+
item.content.item = { id: item.id };
|
|
22858
|
+
item.dataType = DataType.VFXItemData;
|
|
22859
|
+
//@ts-expect-error
|
|
22860
|
+
item.components.push({ id: item.content.id });
|
|
22861
|
+
}
|
|
22862
|
+
else if (item.type === 'camera') {
|
|
22863
|
+
item.components = [];
|
|
22864
|
+
result.components.push(item.content);
|
|
22865
|
+
item.content.id = uuid;
|
|
22866
|
+
item.content.dataType = DataType.CameraComponent;
|
|
22867
|
+
item.content.item = { id: item.id };
|
|
22868
|
+
item.dataType = DataType.VFXItemData;
|
|
22869
|
+
//@ts-expect-error
|
|
22870
|
+
item.components.push({ id: item.content.id });
|
|
22871
|
+
}
|
|
22872
|
+
else if (item.type === ItemType.tree) {
|
|
22873
|
+
item.components = [];
|
|
22874
|
+
result.components.push(item.content);
|
|
22875
|
+
item.content.id = uuid;
|
|
22876
|
+
item.content.dataType = DataType.TreeComponent;
|
|
22877
|
+
item.content.item = { id: item.id };
|
|
22878
|
+
item.dataType = DataType.VFXItemData;
|
|
22879
|
+
//@ts-expect-error
|
|
22880
|
+
item.components.push({ id: item.content.id });
|
|
22881
|
+
}
|
|
22882
|
+
else if (item.type === ItemType.interact) {
|
|
22883
|
+
item.components = [];
|
|
22884
|
+
result.components.push(item.content);
|
|
22885
|
+
item.content.id = uuid;
|
|
22886
|
+
item.content.dataType = DataType.InteractComponent;
|
|
22887
|
+
item.content.item = { id: item.id };
|
|
22888
|
+
item.dataType = DataType.VFXItemData;
|
|
22889
|
+
//@ts-expect-error
|
|
22890
|
+
item.components.push({ id: item.content.id });
|
|
22891
|
+
}
|
|
22892
|
+
else if (item.type === ItemType.camera) {
|
|
22893
|
+
item.components = [];
|
|
22894
|
+
result.components.push(item.content);
|
|
22895
|
+
item.content.id = uuid;
|
|
22896
|
+
item.content.dataType = DataType.CameraController;
|
|
22897
|
+
item.content.item = { id: item.id };
|
|
22898
|
+
item.dataType = DataType.VFXItemData;
|
|
22899
|
+
//@ts-expect-error
|
|
22900
|
+
item.components.push({ id: item.content.id });
|
|
22901
|
+
}
|
|
22902
|
+
else if (item.type === ItemType.text) {
|
|
22903
|
+
item.components = [];
|
|
22904
|
+
result.components.push(item.content);
|
|
22905
|
+
item.content.id = uuid;
|
|
22906
|
+
item.content.dataType = DataType.TextComponent;
|
|
22907
|
+
item.content.item = { id: item.id };
|
|
22908
|
+
item.dataType = DataType.VFXItemData;
|
|
22909
|
+
//@ts-expect-error
|
|
22910
|
+
item.components.push({ id: item.content.id });
|
|
22911
|
+
}
|
|
22912
|
+
}
|
|
22913
|
+
}
|
|
22914
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
22915
|
+
finally {
|
|
22916
|
+
try {
|
|
22917
|
+
if (_s && !_s.done && (_o = _r.return)) _o.call(_r);
|
|
22918
|
+
}
|
|
22919
|
+
finally { if (e_3) throw e_3.error; }
|
|
22920
|
+
}
|
|
22921
|
+
};
|
|
22922
|
+
try {
|
|
22923
|
+
// 更正Composition.endBehavior
|
|
22924
|
+
for (var _k = __values(json.compositions), _l = _k.next(); !_l.done; _l = _k.next()) {
|
|
22925
|
+
var composition = _l.value;
|
|
22926
|
+
_loop_1(composition);
|
|
22927
|
+
}
|
|
22928
|
+
}
|
|
22929
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
22930
|
+
finally {
|
|
22931
|
+
try {
|
|
22932
|
+
if (_l && !_l.done && (_a = _k.return)) _a.call(_k);
|
|
22933
|
+
}
|
|
22934
|
+
finally { if (e_1) throw e_1.error; }
|
|
22935
|
+
}
|
|
22936
|
+
result.version = '3.0';
|
|
22937
|
+
return result;
|
|
22938
|
+
}
|
|
22371
22939
|
|
|
22372
22940
|
var v0 = /^(\d+)\.(\d+)\.(\d+)(-(\w+)\.\d+)?$/;
|
|
22373
22941
|
var standardVersion = /^(\d+)\.(\d+)$/;
|
|
@@ -22377,16 +22945,16 @@ function getStandardJSON(json) {
|
|
|
22377
22945
|
if (!json || typeof json !== 'object') {
|
|
22378
22946
|
throw Error('expect a json object');
|
|
22379
22947
|
}
|
|
22380
|
-
// 修正老版本数据中,meshItem以及lightItem结束行为错误问题
|
|
22948
|
+
// 修正老版本数据中,meshItem 以及 lightItem 结束行为错误问题
|
|
22381
22949
|
version22Migration(json);
|
|
22382
22950
|
if (v0.test(json.version)) {
|
|
22383
22951
|
reverseParticle = ((_a = (/^(\d+)/).exec(json.version)) === null || _a === void 0 ? void 0 : _a[0]) === '0';
|
|
22384
|
-
return version21Migration(getStandardJSONFromV0(json));
|
|
22952
|
+
return version30Migration(version21Migration(getStandardJSONFromV0(json)));
|
|
22385
22953
|
}
|
|
22386
22954
|
var mainVersion = (_b = standardVersion.exec(json.version)) === null || _b === void 0 ? void 0 : _b[1];
|
|
22387
22955
|
if (mainVersion) {
|
|
22388
|
-
if (Number(mainVersion) <
|
|
22389
|
-
return version21Migration(json);
|
|
22956
|
+
if (Number(mainVersion) < 3) {
|
|
22957
|
+
return version30Migration(version21Migration(json));
|
|
22390
22958
|
}
|
|
22391
22959
|
return json;
|
|
22392
22960
|
}
|
|
@@ -22710,7 +23278,7 @@ function version3Migration(scene) {
|
|
|
22710
23278
|
try {
|
|
22711
23279
|
for (var _j = __values$1(ecScene.items), _k = _j.next(); !_k.done; _k = _j.next()) {
|
|
22712
23280
|
var item = _k.value;
|
|
22713
|
-
itemGuidMap[item.id] = generateGUID();
|
|
23281
|
+
itemGuidMap[item.id] = generateGUID$1();
|
|
22714
23282
|
// TODO: 编辑器测试用,上线后删除
|
|
22715
23283
|
//@ts-expect-error
|
|
22716
23284
|
item.oldId = item.id;
|
|
@@ -22766,8 +23334,8 @@ function version3Migration(scene) {
|
|
|
22766
23334
|
// texture 增加 id 和 dataType
|
|
22767
23335
|
for (var _q = __values$1(scene.textureOptions), _r = _q.next(); !_r.done; _r = _q.next()) {
|
|
22768
23336
|
var texture = _r.value;
|
|
22769
|
-
texture.id = generateGUID();
|
|
22770
|
-
texture.dataType = DataType.Texture;
|
|
23337
|
+
texture.id = generateGUID$1();
|
|
23338
|
+
texture.dataType = DataType$1.Texture;
|
|
22771
23339
|
}
|
|
22772
23340
|
}
|
|
22773
23341
|
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
@@ -22786,23 +23354,15 @@ function version3Migration(scene) {
|
|
|
22786
23354
|
var item = _t.value;
|
|
22787
23355
|
// 原 texture 索引转为统一 guid 索引
|
|
22788
23356
|
if (item.content) {
|
|
22789
|
-
//@ts-expect-error
|
|
22790
23357
|
if (item.content.renderer) {
|
|
22791
|
-
//@ts-expect-error
|
|
22792
23358
|
if (item.content.renderer.texture !== undefined) {
|
|
22793
|
-
//@ts-expect-error
|
|
22794
23359
|
var oldTextureId = item.content.renderer.texture;
|
|
22795
|
-
//@ts-expect-error
|
|
22796
23360
|
item.content.renderer.texture = { id: scene.textureOptions[oldTextureId].id };
|
|
22797
23361
|
}
|
|
22798
23362
|
}
|
|
22799
|
-
//@ts-expect-error
|
|
22800
23363
|
if (item.content.trails) {
|
|
22801
|
-
//@ts-expect-error
|
|
22802
23364
|
if (item.content.trails.texture !== undefined) {
|
|
22803
|
-
//@ts-expect-error
|
|
22804
23365
|
var oldTextureId = item.content.trails.texture;
|
|
22805
|
-
//@ts-expect-error
|
|
22806
23366
|
item.content.trails.texture = { id: scene.textureOptions[oldTextureId].id };
|
|
22807
23367
|
}
|
|
22808
23368
|
}
|
|
@@ -22813,12 +23373,14 @@ function version3Migration(scene) {
|
|
|
22813
23373
|
var rotation = item.transform.rotation;
|
|
22814
23374
|
var scale = item.transform.scale;
|
|
22815
23375
|
if (!position) {
|
|
23376
|
+
//@ts-expect-error
|
|
22816
23377
|
position = [0, 0, 0];
|
|
22817
23378
|
}
|
|
22818
23379
|
if (!rotation) {
|
|
22819
23380
|
rotation = [0, 0, 0];
|
|
22820
23381
|
}
|
|
22821
23382
|
if (!scale) {
|
|
23383
|
+
//@ts-expect-error
|
|
22822
23384
|
scale = [1, 1, 1];
|
|
22823
23385
|
}
|
|
22824
23386
|
item.transform = {
|
|
@@ -22839,12 +23401,9 @@ function version3Migration(scene) {
|
|
|
22839
23401
|
// sprite 的 anchor 修正
|
|
22840
23402
|
if (item.type === ItemType$1.sprite) {
|
|
22841
23403
|
var content = item.content;
|
|
22842
|
-
//@ts-expect-error
|
|
22843
23404
|
if (!content.renderer) {
|
|
22844
|
-
//@ts-expect-error
|
|
22845
23405
|
content.renderer = {};
|
|
22846
23406
|
}
|
|
22847
|
-
//@ts-expect-error
|
|
22848
23407
|
var renderer = content.renderer;
|
|
22849
23408
|
var realAnchor = convertAnchor(renderer.anchor, renderer.particleOrigin);
|
|
22850
23409
|
//@ts-expect-error
|
|
@@ -22862,14 +23421,10 @@ function version3Migration(scene) {
|
|
|
22862
23421
|
}
|
|
22863
23422
|
if (item.type === ItemType$1.particle) {
|
|
22864
23423
|
var content = item.content;
|
|
22865
|
-
//@ts-expect-error
|
|
22866
23424
|
if (!content.renderer) {
|
|
22867
|
-
//@ts-expect-error
|
|
22868
23425
|
content.renderer = {};
|
|
22869
23426
|
}
|
|
22870
|
-
//@ts-expect-error
|
|
22871
23427
|
var renderer = content.renderer;
|
|
22872
|
-
//@ts-expect-error
|
|
22873
23428
|
content.renderer.anchor = convertAnchor(renderer.anchor, renderer.particleOrigin);
|
|
22874
23429
|
}
|
|
22875
23430
|
// item 的 endbehaviour 兼容
|
|
@@ -22878,9 +23433,7 @@ function version3Migration(scene) {
|
|
|
22878
23433
|
item.endBehavior = END_BEHAVIOR_FREEZE$1;
|
|
22879
23434
|
}
|
|
22880
23435
|
// 动画数据转化 TODO: 动画数据移到 TimelineComponentData
|
|
22881
|
-
//@ts-expect-error
|
|
22882
23436
|
item.content.tracks = [];
|
|
22883
|
-
//@ts-expect-error
|
|
22884
23437
|
var tracks = item.content.tracks;
|
|
22885
23438
|
if (item.type !== ItemType$1.particle) {
|
|
22886
23439
|
tracks.push({
|
|
@@ -22888,11 +23441,8 @@ function version3Migration(scene) {
|
|
|
22888
23441
|
{
|
|
22889
23442
|
dataType: 'TransformAnimationPlayableAsset',
|
|
22890
23443
|
animationClip: {
|
|
22891
|
-
//@ts-expect-error
|
|
22892
23444
|
sizeOverLifetime: item.content.sizeOverLifetime,
|
|
22893
|
-
//@ts-expect-error
|
|
22894
23445
|
rotationOverLifetime: item.content.rotationOverLifetime,
|
|
22895
|
-
//@ts-expect-error
|
|
22896
23446
|
positionOverLifetime: item.content.positionOverLifetime,
|
|
22897
23447
|
},
|
|
22898
23448
|
},
|
|
@@ -22905,9 +23455,7 @@ function version3Migration(scene) {
|
|
|
22905
23455
|
{
|
|
22906
23456
|
dataType: 'SpriteColorAnimationPlayableAsset',
|
|
22907
23457
|
animationClip: {
|
|
22908
|
-
//@ts-expect-error
|
|
22909
23458
|
colorOverLifetime: item.content.colorOverLifetime,
|
|
22910
|
-
//@ts-expect-error
|
|
22911
23459
|
startColor: item.content.options.startColor,
|
|
22912
23460
|
},
|
|
22913
23461
|
},
|
|
@@ -22915,170 +23463,108 @@ function version3Migration(scene) {
|
|
|
22915
23463
|
});
|
|
22916
23464
|
}
|
|
22917
23465
|
// gizmo 的 target id 转换为新的 item guid
|
|
22918
|
-
|
|
22919
|
-
if (item.content.options.target) {
|
|
22920
|
-
//@ts-expect-error
|
|
23466
|
+
if (item.content && item.content.options && item.content.options.target) {
|
|
22921
23467
|
item.content.options.target = itemGuidMap[item.content.options.target];
|
|
22922
23468
|
}
|
|
22923
23469
|
// item 的 content 转为 component data 加入 JSONScene.components
|
|
22924
|
-
var uuid = v4().replace(/-/g, '');
|
|
23470
|
+
var uuid = v4$1().replace(/-/g, '');
|
|
22925
23471
|
if (item.type === ItemType$1.sprite) {
|
|
22926
|
-
//@ts-expect-error
|
|
22927
23472
|
item.components = [];
|
|
22928
|
-
//@ts-expect-error
|
|
22929
23473
|
components.push(item.content);
|
|
22930
|
-
//@ts-expect-error
|
|
22931
23474
|
item.content.id = uuid;
|
|
22932
|
-
|
|
22933
|
-
item.content.dataType = DataType.SpriteComponent;
|
|
22934
|
-
//@ts-expect-error
|
|
23475
|
+
item.content.dataType = DataType$1.SpriteComponent;
|
|
22935
23476
|
item.content.item = { id: item.id };
|
|
22936
|
-
|
|
22937
|
-
item.dataType = DataType.VFXItemData;
|
|
23477
|
+
item.dataType = DataType$1.VFXItemData;
|
|
22938
23478
|
//@ts-expect-error
|
|
22939
23479
|
item.components.push({ id: item.content.id });
|
|
22940
23480
|
}
|
|
22941
23481
|
else if (item.type === ItemType$1.particle) {
|
|
22942
|
-
//@ts-expect-error
|
|
22943
23482
|
item.components = [];
|
|
22944
|
-
//@ts-expect-error
|
|
22945
23483
|
components.push(item.content);
|
|
22946
|
-
//@ts-expect-error
|
|
22947
23484
|
item.content.id = uuid;
|
|
22948
|
-
|
|
22949
|
-
item.content.dataType = DataType.ParticleSystem;
|
|
22950
|
-
//@ts-expect-error
|
|
23485
|
+
item.content.dataType = DataType$1.ParticleSystem;
|
|
22951
23486
|
item.content.item = { id: item.id };
|
|
22952
|
-
|
|
22953
|
-
item.dataType = DataType.VFXItemData;
|
|
23487
|
+
item.dataType = DataType$1.VFXItemData;
|
|
22954
23488
|
//@ts-expect-error
|
|
22955
23489
|
item.components.push({ id: item.content.id });
|
|
22956
23490
|
}
|
|
22957
23491
|
else if (item.type === ItemType$1.mesh) {
|
|
22958
|
-
//@ts-expect-error
|
|
22959
23492
|
item.components = [];
|
|
22960
|
-
//@ts-expect-error
|
|
22961
23493
|
components.push(item.content);
|
|
22962
|
-
//@ts-expect-error
|
|
22963
23494
|
item.content.id = uuid;
|
|
22964
|
-
|
|
22965
|
-
item.content.dataType = DataType.MeshComponent;
|
|
22966
|
-
//@ts-expect-error
|
|
23495
|
+
item.content.dataType = DataType$1.MeshComponent;
|
|
22967
23496
|
item.content.item = { id: item.id };
|
|
22968
|
-
|
|
22969
|
-
item.dataType = DataType.VFXItemData;
|
|
23497
|
+
item.dataType = DataType$1.VFXItemData;
|
|
22970
23498
|
//@ts-expect-error
|
|
22971
23499
|
item.components.push({ id: item.content.id });
|
|
22972
23500
|
}
|
|
22973
23501
|
else if (item.type === ItemType$1.skybox) {
|
|
22974
|
-
//@ts-expect-error
|
|
22975
23502
|
item.components = [];
|
|
22976
|
-
//@ts-expect-error
|
|
22977
23503
|
components.push(item.content);
|
|
22978
|
-
//@ts-expect-error
|
|
22979
23504
|
item.content.id = uuid;
|
|
22980
|
-
|
|
22981
|
-
item.content.dataType = DataType.SkyboxComponent;
|
|
22982
|
-
//@ts-expect-error
|
|
23505
|
+
item.content.dataType = DataType$1.SkyboxComponent;
|
|
22983
23506
|
item.content.item = { id: item.id };
|
|
22984
|
-
|
|
22985
|
-
item.dataType = DataType.VFXItemData;
|
|
23507
|
+
item.dataType = DataType$1.VFXItemData;
|
|
22986
23508
|
//@ts-expect-error
|
|
22987
23509
|
item.components.push({ id: item.content.id });
|
|
22988
23510
|
}
|
|
22989
23511
|
else if (item.type === ItemType$1.light) {
|
|
22990
|
-
//@ts-expect-error
|
|
22991
23512
|
item.components = [];
|
|
22992
|
-
//@ts-expect-error
|
|
22993
23513
|
components.push(item.content);
|
|
22994
|
-
//@ts-expect-error
|
|
22995
23514
|
item.content.id = uuid;
|
|
22996
|
-
|
|
22997
|
-
item.content.dataType = DataType.LightComponent;
|
|
22998
|
-
//@ts-expect-error
|
|
23515
|
+
item.content.dataType = DataType$1.LightComponent;
|
|
22999
23516
|
item.content.item = { id: item.id };
|
|
23000
|
-
|
|
23001
|
-
item.dataType = DataType.VFXItemData;
|
|
23517
|
+
item.dataType = DataType$1.VFXItemData;
|
|
23002
23518
|
//@ts-expect-error
|
|
23003
23519
|
item.components.push({ id: item.content.id });
|
|
23004
23520
|
}
|
|
23005
23521
|
else if (item.type === 'camera') {
|
|
23006
|
-
//@ts-expect-error
|
|
23007
23522
|
item.components = [];
|
|
23008
|
-
//@ts-expect-error
|
|
23009
23523
|
components.push(item.content);
|
|
23010
|
-
//@ts-expect-error
|
|
23011
23524
|
item.content.id = uuid;
|
|
23012
|
-
|
|
23013
|
-
item.content.dataType = DataType.CameraComponent;
|
|
23014
|
-
//@ts-expect-error
|
|
23525
|
+
item.content.dataType = DataType$1.CameraComponent;
|
|
23015
23526
|
item.content.item = { id: item.id };
|
|
23016
|
-
|
|
23017
|
-
item.dataType = DataType.VFXItemData;
|
|
23527
|
+
item.dataType = DataType$1.VFXItemData;
|
|
23018
23528
|
//@ts-expect-error
|
|
23019
23529
|
item.components.push({ id: item.content.id });
|
|
23020
23530
|
}
|
|
23021
23531
|
else if (item.type === ItemType$1.tree) {
|
|
23022
|
-
//@ts-expect-error
|
|
23023
23532
|
item.components = [];
|
|
23024
|
-
//@ts-expect-error
|
|
23025
23533
|
components.push(item.content);
|
|
23026
|
-
//@ts-expect-error
|
|
23027
23534
|
item.content.id = uuid;
|
|
23028
|
-
|
|
23029
|
-
item.content.dataType = DataType.TreeComponent;
|
|
23030
|
-
//@ts-expect-error
|
|
23535
|
+
item.content.dataType = DataType$1.TreeComponent;
|
|
23031
23536
|
item.content.item = { id: item.id };
|
|
23032
|
-
|
|
23033
|
-
item.dataType = DataType.VFXItemData;
|
|
23537
|
+
item.dataType = DataType$1.VFXItemData;
|
|
23034
23538
|
//@ts-expect-error
|
|
23035
23539
|
item.components.push({ id: item.content.id });
|
|
23036
23540
|
}
|
|
23037
23541
|
else if (item.type === ItemType$1.interact) {
|
|
23038
|
-
//@ts-expect-error
|
|
23039
23542
|
item.components = [];
|
|
23040
|
-
//@ts-expect-error
|
|
23041
23543
|
components.push(item.content);
|
|
23042
|
-
//@ts-expect-error
|
|
23043
23544
|
item.content.id = uuid;
|
|
23044
|
-
|
|
23045
|
-
item.content.dataType = DataType.InteractComponent;
|
|
23046
|
-
//@ts-expect-error
|
|
23545
|
+
item.content.dataType = DataType$1.InteractComponent;
|
|
23047
23546
|
item.content.item = { id: item.id };
|
|
23048
|
-
|
|
23049
|
-
item.dataType = DataType.VFXItemData;
|
|
23547
|
+
item.dataType = DataType$1.VFXItemData;
|
|
23050
23548
|
//@ts-expect-error
|
|
23051
23549
|
item.components.push({ id: item.content.id });
|
|
23052
23550
|
}
|
|
23053
23551
|
else if (item.type === ItemType$1.camera) {
|
|
23054
|
-
//@ts-expect-error
|
|
23055
23552
|
item.components = [];
|
|
23056
|
-
//@ts-expect-error
|
|
23057
23553
|
components.push(item.content);
|
|
23058
|
-
//@ts-expect-error
|
|
23059
23554
|
item.content.id = uuid;
|
|
23060
|
-
|
|
23061
|
-
item.content.dataType = DataType.CameraController;
|
|
23062
|
-
//@ts-expect-error
|
|
23555
|
+
item.content.dataType = DataType$1.CameraController;
|
|
23063
23556
|
item.content.item = { id: item.id };
|
|
23064
|
-
|
|
23065
|
-
item.dataType = DataType.VFXItemData;
|
|
23557
|
+
item.dataType = DataType$1.VFXItemData;
|
|
23066
23558
|
//@ts-expect-error
|
|
23067
23559
|
item.components.push({ id: item.content.id });
|
|
23068
23560
|
}
|
|
23069
23561
|
else if (item.type === ItemType$1.text) {
|
|
23070
|
-
//@ts-expect-error
|
|
23071
23562
|
item.components = [];
|
|
23072
|
-
//@ts-expect-error
|
|
23073
23563
|
components.push(item.content);
|
|
23074
|
-
//@ts-expect-error
|
|
23075
23564
|
item.content.id = uuid;
|
|
23076
|
-
|
|
23077
|
-
item.content.dataType = DataType.TextComponent;
|
|
23078
|
-
//@ts-expect-error
|
|
23565
|
+
item.content.dataType = DataType$1.TextComponent;
|
|
23079
23566
|
item.content.item = { id: item.id };
|
|
23080
|
-
|
|
23081
|
-
item.dataType = DataType.VFXItemData;
|
|
23567
|
+
item.dataType = DataType$1.VFXItemData;
|
|
23082
23568
|
//@ts-expect-error
|
|
23083
23569
|
item.components.push({ id: item.content.id });
|
|
23084
23570
|
}
|
|
@@ -23101,7 +23587,7 @@ function convertAnchor(anchor, particleOrigin) {
|
|
|
23101
23587
|
return [anchor[0] - 0.5, 0.5 - anchor[1]];
|
|
23102
23588
|
}
|
|
23103
23589
|
else if (particleOrigin) {
|
|
23104
|
-
return particleOriginTranslateMap[particleOrigin];
|
|
23590
|
+
return particleOriginTranslateMap$1[particleOrigin];
|
|
23105
23591
|
}
|
|
23106
23592
|
else {
|
|
23107
23593
|
return [0, 0];
|
|
@@ -23379,16 +23865,17 @@ var AssetManager = /** @class */ (function () {
|
|
|
23379
23865
|
};
|
|
23380
23866
|
AssetManager.prototype.processBins = function (bins) {
|
|
23381
23867
|
return __awaiter(this, void 0, void 0, function () {
|
|
23382
|
-
var renderLevel, jobs;
|
|
23868
|
+
var renderLevel, baseUrl, jobs;
|
|
23383
23869
|
var _this = this;
|
|
23384
23870
|
return __generator(this, function (_a) {
|
|
23385
23871
|
renderLevel = this.options.renderLevel;
|
|
23872
|
+
baseUrl = this.baseUrl;
|
|
23386
23873
|
jobs = bins.map(function (bin) {
|
|
23387
23874
|
if (bin instanceof ArrayBuffer) {
|
|
23388
23875
|
return bin;
|
|
23389
23876
|
}
|
|
23390
23877
|
if (passRenderLevel(bin.renderLevel, renderLevel)) {
|
|
23391
|
-
return _this.loadBins(bin.url);
|
|
23878
|
+
return _this.loadBins(new URL(bin.url, baseUrl).href);
|
|
23392
23879
|
}
|
|
23393
23880
|
throw new Error("Invalid bins source: ".concat(JSON.stringify(bins)));
|
|
23394
23881
|
});
|
|
@@ -23406,13 +23893,14 @@ var AssetManager = /** @class */ (function () {
|
|
|
23406
23893
|
return [2 /*return*/];
|
|
23407
23894
|
}
|
|
23408
23895
|
jobs = fonts.map(function (font) { return __awaiter(_this, void 0, void 0, function () {
|
|
23409
|
-
var fontFace;
|
|
23896
|
+
var url, fontFace;
|
|
23410
23897
|
var _a;
|
|
23411
23898
|
return __generator(this, function (_b) {
|
|
23412
23899
|
switch (_b.label) {
|
|
23413
23900
|
case 0:
|
|
23414
23901
|
if (!(font.fontURL && !AssetManager.fonts.has(font.fontFamily))) return [3 /*break*/, 4];
|
|
23415
|
-
|
|
23902
|
+
url = new URL(font.fontURL, this.baseUrl).href;
|
|
23903
|
+
fontFace = new FontFace((_a = font.fontFamily) !== null && _a !== void 0 ? _a : '', 'url(' + url + ')');
|
|
23416
23904
|
_b.label = 1;
|
|
23417
23905
|
case 1:
|
|
23418
23906
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -23425,7 +23913,7 @@ var AssetManager = /** @class */ (function () {
|
|
|
23425
23913
|
return [3 /*break*/, 4];
|
|
23426
23914
|
case 3:
|
|
23427
23915
|
_b.sent();
|
|
23428
|
-
logger.warn("Invalid fonts source: ".concat(JSON.stringify(
|
|
23916
|
+
logger.warn("Invalid fonts source: ".concat(JSON.stringify(url)));
|
|
23429
23917
|
return [3 /*break*/, 4];
|
|
23430
23918
|
case 4: return [2 /*return*/];
|
|
23431
23919
|
}
|
|
@@ -23674,7 +24162,7 @@ function createTextureOptionsBySource(image, sourceFrom) {
|
|
|
23674
24162
|
return image.source;
|
|
23675
24163
|
}
|
|
23676
24164
|
else if (image instanceof HTMLImageElement ||
|
|
23677
|
-
image
|
|
24165
|
+
isCanvas(image)) {
|
|
23678
24166
|
return {
|
|
23679
24167
|
image: image,
|
|
23680
24168
|
sourceType: TextureSourceType.image,
|
|
@@ -23736,6 +24224,11 @@ function base64ToFile(base64, filename, contentType) {
|
|
|
23736
24224
|
var file = new File([blob], filename, { type: contentType });
|
|
23737
24225
|
return file;
|
|
23738
24226
|
}
|
|
24227
|
+
function isCanvas(cavnas) {
|
|
24228
|
+
var _a;
|
|
24229
|
+
// 小程序 Canvas 无法使用 instanceof HTMLCanvasElement 判断
|
|
24230
|
+
return typeof cavnas === 'object' && cavnas !== null && ((_a = cavnas.tagName) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === 'CANVAS';
|
|
24231
|
+
}
|
|
23739
24232
|
|
|
23740
24233
|
var tmpScale = new Vector3(1, 1, 1);
|
|
23741
24234
|
/**
|
|
@@ -23955,8 +24448,9 @@ var Camera = /** @class */ (function () {
|
|
|
23955
24448
|
Camera.prototype.getInverseVPRatio = function (z) {
|
|
23956
24449
|
var pos = new Vector3(0, 0, z);
|
|
23957
24450
|
var mat = this.getViewProjectionMatrix();
|
|
23958
|
-
var
|
|
23959
|
-
|
|
24451
|
+
var inverseVP = this.getInverseViewProjectionMatrix();
|
|
24452
|
+
var nz = mat.projectPoint(pos).z;
|
|
24453
|
+
return inverseVP.projectPoint(new Vector3(1, 1, nz));
|
|
23960
24454
|
};
|
|
23961
24455
|
/**
|
|
23962
24456
|
* 设置相机的旋转四元数
|
|
@@ -23968,7 +24462,6 @@ var Camera = /** @class */ (function () {
|
|
|
23968
24462
|
this.dirty = true;
|
|
23969
24463
|
}
|
|
23970
24464
|
else {
|
|
23971
|
-
this.options.quat;
|
|
23972
24465
|
if (!this.options.quat.equals(value)) {
|
|
23973
24466
|
this.options.quat.copyFrom(value);
|
|
23974
24467
|
this.dirty = true;
|
|
@@ -24136,8 +24629,7 @@ var CompositionComponent = /** @class */ (function (_super) {
|
|
|
24136
24629
|
}
|
|
24137
24630
|
item.getComponent(CompositionComponent).createContent();
|
|
24138
24631
|
}
|
|
24139
|
-
else if (itemData.type ===
|
|
24140
|
-
itemData.type === ItemType$1.sprite ||
|
|
24632
|
+
else if (itemData.type === ItemType$1.sprite ||
|
|
24141
24633
|
itemData.type === ItemType$1.text ||
|
|
24142
24634
|
itemData.type === ItemType$1.particle ||
|
|
24143
24635
|
itemData.type === ItemType$1.mesh ||
|
|
@@ -24155,20 +24647,7 @@ var CompositionComponent = /** @class */ (function (_super) {
|
|
|
24155
24647
|
item = new VFXItem(this.engine, itemData);
|
|
24156
24648
|
item.composition = this.item.composition;
|
|
24157
24649
|
// 兼容老的数据代码,json 更新后可移除
|
|
24158
|
-
|
|
24159
|
-
case ItemType$1.text: {
|
|
24160
|
-
// 添加文本组件
|
|
24161
|
-
var textItem = new TextComponent(this.engine, itemData.content);
|
|
24162
|
-
textItem.item = item;
|
|
24163
|
-
item.components.push(textItem);
|
|
24164
|
-
item.rendererComponents.push(textItem);
|
|
24165
|
-
item._content = textItem;
|
|
24166
|
-
break;
|
|
24167
|
-
}
|
|
24168
|
-
default: {
|
|
24169
|
-
item = createVFXItem(itemData, this.item.composition);
|
|
24170
|
-
}
|
|
24171
|
-
}
|
|
24650
|
+
item = createVFXItem(itemData, this.item.composition);
|
|
24172
24651
|
}
|
|
24173
24652
|
item.parent = this.item;
|
|
24174
24653
|
// 相机不跟随合成移动
|
|
@@ -25558,10 +26037,8 @@ var Engine = /** @class */ (function () {
|
|
|
25558
26037
|
Engine.prototype.addPackageDatas = function (scene) {
|
|
25559
26038
|
var e_1, _a, e_2, _b, e_3, _c, e_4, _d, e_5, _e, e_6, _f;
|
|
25560
26039
|
var jsonScene = scene.jsonScene;
|
|
25561
|
-
//@ts-expect-error
|
|
25562
26040
|
if (jsonScene.items) {
|
|
25563
26041
|
try {
|
|
25564
|
-
//@ts-expect-error
|
|
25565
26042
|
for (var _g = __values$1(jsonScene.items), _h = _g.next(); !_h.done; _h = _g.next()) {
|
|
25566
26043
|
var vfxItemData = _h.value;
|
|
25567
26044
|
this.addEffectsObjectData(vfxItemData);
|
|
@@ -25575,10 +26052,8 @@ var Engine = /** @class */ (function () {
|
|
|
25575
26052
|
finally { if (e_1) throw e_1.error; }
|
|
25576
26053
|
}
|
|
25577
26054
|
}
|
|
25578
|
-
//@ts-expect-error
|
|
25579
26055
|
if (jsonScene.materials) {
|
|
25580
26056
|
try {
|
|
25581
|
-
//@ts-expect-error
|
|
25582
26057
|
for (var _j = __values$1(jsonScene.materials), _k = _j.next(); !_k.done; _k = _j.next()) {
|
|
25583
26058
|
var materialData = _k.value;
|
|
25584
26059
|
this.addEffectsObjectData(materialData);
|
|
@@ -25592,10 +26067,8 @@ var Engine = /** @class */ (function () {
|
|
|
25592
26067
|
finally { if (e_2) throw e_2.error; }
|
|
25593
26068
|
}
|
|
25594
26069
|
}
|
|
25595
|
-
//@ts-expect-error
|
|
25596
26070
|
if (jsonScene.shaders) {
|
|
25597
26071
|
try {
|
|
25598
|
-
//@ts-expect-error
|
|
25599
26072
|
for (var _l = __values$1(jsonScene.shaders), _m = _l.next(); !_m.done; _m = _l.next()) {
|
|
25600
26073
|
var shaderData = _m.value;
|
|
25601
26074
|
this.addEffectsObjectData(shaderData);
|
|
@@ -25609,10 +26082,8 @@ var Engine = /** @class */ (function () {
|
|
|
25609
26082
|
finally { if (e_3) throw e_3.error; }
|
|
25610
26083
|
}
|
|
25611
26084
|
}
|
|
25612
|
-
//@ts-expect-error
|
|
25613
26085
|
if (jsonScene.geometries) {
|
|
25614
26086
|
try {
|
|
25615
|
-
//@ts-expect-error
|
|
25616
26087
|
for (var _o = __values$1(jsonScene.geometries), _p = _o.next(); !_p.done; _p = _o.next()) {
|
|
25617
26088
|
var geometryData = _p.value;
|
|
25618
26089
|
this.addEffectsObjectData(geometryData);
|
|
@@ -25626,10 +26097,8 @@ var Engine = /** @class */ (function () {
|
|
|
25626
26097
|
finally { if (e_4) throw e_4.error; }
|
|
25627
26098
|
}
|
|
25628
26099
|
}
|
|
25629
|
-
//@ts-expect-error
|
|
25630
26100
|
if (jsonScene.components) {
|
|
25631
26101
|
try {
|
|
25632
|
-
//@ts-expect-error
|
|
25633
26102
|
for (var _q = __values$1(jsonScene.components), _r = _q.next(); !_r.done; _r = _q.next()) {
|
|
25634
26103
|
var componentData = _r.value;
|
|
25635
26104
|
this.addEffectsObjectData(componentData);
|
|
@@ -25983,5 +26452,5 @@ registerPlugin('cal', CalculateLoader, VFXItem, true);
|
|
|
25983
26452
|
registerPlugin('interact', InteractLoader, VFXItem, true);
|
|
25984
26453
|
// registerFilters(filters);
|
|
25985
26454
|
|
|
25986
|
-
export { AbstractPlugin, ActivationPlayable, AssetLoader, AssetManager, BYTES_TYPE_MAP, Behaviour, BezierSegments, COMPRESSED_TEXTURE, COPY_FRAGMENT_SHADER, COPY_MESH_SHADER_ID, COPY_VERTEX_SHADER, CalculateLoader, Camera, CameraController, CameraVFXItemLoader, Component, Composition, CompositionComponent, CompositionSourceManager, CurveValue, DEFAULT_FONTS, 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, SpriteColorPlayable, SpriteComponent, SpriteLoader, StaticValue, TEMPLATE_USE_OFFSCREEN_CANVAS, TextComponent, TextLoader, Texture, TextureFactory, TextureLoadAction, TextureSourceType, TextureStoreAction, 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, 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, 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, particleVert, pluginLoaderMap, random, registerPlugin, removeItem, requestAsync, rotateVec2, screenMeshVert, serialize, setBlendMode, setConfig, setDefaultTextureFactory, setMaskMode, setMaxSpriteMeshItemCount, setRayFromCamera, setSideMode, setSpriteMeshMaxFragmentTextures, setSpriteMeshMaxItemCountByGPU, sortByOrder, index as spec, spriteMeshShaderFromFilter, spriteMeshShaderFromRenderInfo, spriteMeshShaderIdFromRenderInfo, thresholdFrag, throwDestroyedError, trailVert, translatePoint, trianglesFromRect, unregisterPlugin, valIfUndefined, value, valueDefine, vecAssign, vecFill, vecMulCombine, vecNormalize };
|
|
26455
|
+
export { AbstractPlugin, ActivationPlayable, AssetLoader, AssetManager, BYTES_TYPE_MAP, Behaviour, BezierSegments, COMPRESSED_TEXTURE, 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, TextComponent, TextLoader, Texture, TextureFactory, TextureLoadAction, TextureSourceType, TextureStoreAction, 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, 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, sortByOrder, index as spec, spriteMeshShaderFromFilter, spriteMeshShaderFromRenderInfo, spriteMeshShaderIdFromRenderInfo, thresholdFrag, throwDestroyedError, trailVert, translatePoint, trianglesFromRect, unregisterPlugin, valIfUndefined, value, valueDefine, vecAssign, vecFill, vecMulCombine, vecNormalize };
|
|
25987
26456
|
//# sourceMappingURL=index.mjs.map
|