@galacean/effects 0.0.1-alpha.3 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +42 -37
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +4 -4
- package/dist/index.min.js.map +1 -1
- package/dist/index.mjs +42 -37
- package/dist/index.mjs.map +1 -1
- package/dist/player.d.ts +0 -12
- package/dist/weapp.js +41 -36
- package/dist/weapp.js.map +1 -1
- package/dist/weapp.mjs +41 -36
- package/dist/weapp.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Description: Galacean Effects runtime player for the web
|
|
4
4
|
* Author: Ant Group CO., Ltd.
|
|
5
5
|
* Contributors: 燃然,飂兮,十弦,云垣,茂安,意绮
|
|
6
|
-
* Version:
|
|
6
|
+
* Version: v1.0.1
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
'use strict';
|
|
@@ -9457,6 +9457,7 @@ var Transform = /** @class */ (function () {
|
|
|
9457
9457
|
*/
|
|
9458
9458
|
Transform.prototype.rotateByQuat = function (quat) {
|
|
9459
9459
|
quatMultiply(this.quat, this.quat, quat);
|
|
9460
|
+
rotationFromMat3(this.rotation, mat3FromQuat(tempMat3$3, quat));
|
|
9460
9461
|
this.dirtyFlags.localData = true;
|
|
9461
9462
|
this.dispatchValueChange();
|
|
9462
9463
|
};
|
|
@@ -10283,7 +10284,7 @@ var PluginSystem = /** @class */ (function () {
|
|
|
10283
10284
|
.map(function (name) {
|
|
10284
10285
|
var CTRL = pluginLoaderMap[name];
|
|
10285
10286
|
if (!CTRL) {
|
|
10286
|
-
throw new Error("plugin '".concat(name, "' not found"));
|
|
10287
|
+
throw new Error("plugin '".concat(name, "' not found.") + getPluginUsageInfo(name));
|
|
10287
10288
|
}
|
|
10288
10289
|
var loader = new CTRL();
|
|
10289
10290
|
loader.name = name;
|
|
@@ -10355,6 +10356,23 @@ var PluginSystem = /** @class */ (function () {
|
|
|
10355
10356
|
};
|
|
10356
10357
|
return PluginSystem;
|
|
10357
10358
|
}());
|
|
10359
|
+
var pluginInfoMap = {
|
|
10360
|
+
'alipay-downgrade': '@galacean/effects-plugin-alipay-downgrade',
|
|
10361
|
+
'editor-gizmo': '@galacean/effects-plugin-editor-gizmo',
|
|
10362
|
+
'tree': '@galacean/effects-plugin-model',
|
|
10363
|
+
'model': '@galacean/effects-plugin-model',
|
|
10364
|
+
'orientation-transformer': '@galacean/effects-plugin-orientation-transformer',
|
|
10365
|
+
'spine': '@galacean/effects-plugin-spine',
|
|
10366
|
+
};
|
|
10367
|
+
function getPluginUsageInfo(name) {
|
|
10368
|
+
var info = pluginInfoMap[name];
|
|
10369
|
+
if (info) {
|
|
10370
|
+
return "\nInstall Plugin: npm i ".concat(info, "@latest --save\nImport Plugin: import '").concat(info, "'");
|
|
10371
|
+
}
|
|
10372
|
+
else {
|
|
10373
|
+
return '';
|
|
10374
|
+
}
|
|
10375
|
+
}
|
|
10358
10376
|
|
|
10359
10377
|
/**
|
|
10360
10378
|
* 抽象插件类
|
|
@@ -25209,12 +25227,6 @@ var Composition = /** @class */ (function () {
|
|
|
25209
25227
|
enumerable: false,
|
|
25210
25228
|
configurable: true
|
|
25211
25229
|
});
|
|
25212
|
-
/**
|
|
25213
|
-
* 获取合成的时长
|
|
25214
|
-
*/
|
|
25215
|
-
Composition.prototype.getDuration = function () {
|
|
25216
|
-
return this.content.duration;
|
|
25217
|
-
};
|
|
25218
25230
|
Object.defineProperty(Composition.prototype, "isDestroyed", {
|
|
25219
25231
|
/**
|
|
25220
25232
|
* 获取销毁状态
|
|
@@ -25225,6 +25237,12 @@ var Composition = /** @class */ (function () {
|
|
|
25225
25237
|
enumerable: false,
|
|
25226
25238
|
configurable: true
|
|
25227
25239
|
});
|
|
25240
|
+
/**
|
|
25241
|
+
* 获取合成的时长
|
|
25242
|
+
*/
|
|
25243
|
+
Composition.prototype.getDuration = function () {
|
|
25244
|
+
return this.content.duration;
|
|
25245
|
+
};
|
|
25228
25246
|
/**
|
|
25229
25247
|
* 重新开始合成
|
|
25230
25248
|
*/
|
|
@@ -30878,25 +30896,6 @@ var Player = /** @class */ (function () {
|
|
|
30878
30896
|
});
|
|
30879
30897
|
}
|
|
30880
30898
|
};
|
|
30881
|
-
/**
|
|
30882
|
-
* 修改播放器的配置
|
|
30883
|
-
* @param config - 播放配置,当前仅支持修改合成播放速度
|
|
30884
|
-
*/
|
|
30885
|
-
Player.prototype.config = function (config) {
|
|
30886
|
-
var singleComp = typeof config.compositionName === 'string';
|
|
30887
|
-
if ('speed' in config) {
|
|
30888
|
-
var speed_1 = +(config.speed || 1);
|
|
30889
|
-
if (singleComp) {
|
|
30890
|
-
var comp = this.compositions.find(function (comp) { return comp.name === config.compositionName; });
|
|
30891
|
-
if (comp) {
|
|
30892
|
-
comp.speed = speed_1;
|
|
30893
|
-
}
|
|
30894
|
-
}
|
|
30895
|
-
else {
|
|
30896
|
-
this.compositions.forEach(function (comp) { return (comp.speed = speed_1); });
|
|
30897
|
-
}
|
|
30898
|
-
}
|
|
30899
|
-
};
|
|
30900
30899
|
/**
|
|
30901
30900
|
* 清空 canvas 的画面
|
|
30902
30901
|
* @param immediate - 如果立即清理,当前画面将会消失,如果 player 还有合成在渲染,可能出现闪烁
|
|
@@ -30964,11 +30963,15 @@ var Player = /** @class */ (function () {
|
|
|
30964
30963
|
}
|
|
30965
30964
|
this.canvas.remove();
|
|
30966
30965
|
}
|
|
30967
|
-
|
|
30968
|
-
|
|
30969
|
-
|
|
30970
|
-
|
|
30971
|
-
this.
|
|
30966
|
+
// 在报错函数中传入 player.name
|
|
30967
|
+
var errorMsg = getDestroyedErrorMessage(this.name);
|
|
30968
|
+
var throwErrorFunc = function () { return throwDestroyedError(errorMsg); };
|
|
30969
|
+
var throwErrorPromiseFunc = function () { return throwDestroyedErrorPromise(errorMsg); };
|
|
30970
|
+
this.tick = throwErrorFunc;
|
|
30971
|
+
this.resize = throwErrorFunc;
|
|
30972
|
+
this.loadScene = throwErrorPromiseFunc;
|
|
30973
|
+
this.play = throwErrorPromiseFunc;
|
|
30974
|
+
this.resume = throwErrorPromiseFunc;
|
|
30972
30975
|
this.disposed = true;
|
|
30973
30976
|
};
|
|
30974
30977
|
Player.prototype.offloadTexture = function () {
|
|
@@ -31093,11 +31096,13 @@ function assertContainer(container) {
|
|
|
31093
31096
|
throw new Error("Container is not an HTMLElement, see ".concat(HELP_LINK['Container is not an HTMLElement']));
|
|
31094
31097
|
}
|
|
31095
31098
|
}
|
|
31096
|
-
|
|
31097
|
-
|
|
31099
|
+
function getDestroyedErrorMessage(name) {
|
|
31100
|
+
return "Never use destroyed player: ".concat(name, " again, see ").concat(HELP_LINK['Never use destroyed player again']);
|
|
31101
|
+
}
|
|
31102
|
+
function throwDestroyedError(destroyedErrorMessage) {
|
|
31098
31103
|
throw new Error(destroyedErrorMessage);
|
|
31099
31104
|
}
|
|
31100
|
-
function throwDestroyedErrorPromise() {
|
|
31105
|
+
function throwDestroyedErrorPromise(destroyedErrorMessage) {
|
|
31101
31106
|
return Promise.reject(destroyedErrorMessage);
|
|
31102
31107
|
}
|
|
31103
31108
|
|
|
@@ -31143,9 +31148,9 @@ Renderer.create = function (canvas, framework, renderOptions) {
|
|
|
31143
31148
|
Engine.create = function (gl) {
|
|
31144
31149
|
return new GLEngine(gl);
|
|
31145
31150
|
};
|
|
31146
|
-
var version = "
|
|
31151
|
+
var version = "1.0.1";
|
|
31147
31152
|
console.info({
|
|
31148
|
-
content: '[Galacean Effects Player] version: ' + "
|
|
31153
|
+
content: '[Galacean Effects Player] version: ' + "1.0.1",
|
|
31149
31154
|
type: LOG_TYPE,
|
|
31150
31155
|
});
|
|
31151
31156
|
|