@galacean/effects-plugin-model 2.8.0-alpha.2 → 2.8.0-alpha.4
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/alipay.js +1 -1
- package/dist/alipay.js.map +1 -1
- package/dist/alipay.mjs +1 -1
- package/dist/alipay.mjs.map +1 -1
- package/dist/douyin.js +1 -1
- package/dist/douyin.js.map +1 -1
- package/dist/douyin.mjs +1 -1
- package/dist/douyin.mjs.map +1 -1
- package/dist/index.js +77 -9
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +2 -2
- package/dist/index.min.js.map +1 -1
- package/dist/index.mjs +78 -10
- package/dist/index.mjs.map +1 -1
- package/dist/loader.mjs +78 -10
- package/dist/loader.mjs.map +1 -1
- package/dist/plugin/model-plugin.d.ts +5 -5
- package/dist/weapp.js +1 -1
- package/dist/weapp.js.map +1 -1
- package/dist/weapp.mjs +1 -1
- package/dist/weapp.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Description: Galacean Effects player model plugin
|
|
4
4
|
* Author: Ant Group CO., Ltd.
|
|
5
5
|
* Contributors: 飂兮
|
|
6
|
-
* Version: v2.8.0-alpha.
|
|
6
|
+
* Version: v2.8.0-alpha.4
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
'use strict';
|
|
@@ -91,6 +91,74 @@ function _instanceof1(left, right) {
|
|
|
91
91
|
} else return _instanceof1(left, right);
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
+
function _is_native_reflect_construct() {
|
|
95
|
+
// Since Reflect.construct can't be properly polyfilled, some
|
|
96
|
+
// implementations (e.g. core-js@2) don't set the correct internal slots.
|
|
97
|
+
// Those polyfills don't allow us to subclass built-ins, so we need to
|
|
98
|
+
// use our fallback implementation.
|
|
99
|
+
try {
|
|
100
|
+
// If the internal slots aren't set, this throws an error similar to
|
|
101
|
+
// TypeError: this is not a Boolean object.
|
|
102
|
+
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
103
|
+
} catch (_) {}
|
|
104
|
+
return (_is_native_reflect_construct = function _is_native_reflect_construct() {
|
|
105
|
+
return !!result;
|
|
106
|
+
})();
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function _construct(Parent, args, Class) {
|
|
110
|
+
if (_is_native_reflect_construct()) _construct = Reflect.construct;
|
|
111
|
+
else {
|
|
112
|
+
_construct = function construct(Parent, args, Class) {
|
|
113
|
+
var a = [
|
|
114
|
+
null
|
|
115
|
+
];
|
|
116
|
+
a.push.apply(a, args);
|
|
117
|
+
var Constructor = Function.bind.apply(Parent, a);
|
|
118
|
+
var instance = new Constructor();
|
|
119
|
+
if (Class) _set_prototype_of(instance, Class.prototype);
|
|
120
|
+
return instance;
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
return _construct.apply(null, arguments);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function _get_prototype_of(o) {
|
|
127
|
+
_get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
|
|
128
|
+
return o.__proto__ || Object.getPrototypeOf(o);
|
|
129
|
+
};
|
|
130
|
+
return _get_prototype_of(o);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function _is_native_function(fn) {
|
|
134
|
+
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function _wrap_native_super(Class) {
|
|
138
|
+
var _cache = typeof Map === "function" ? new Map() : undefined;
|
|
139
|
+
_wrap_native_super = function _wrap_native_super(Class) {
|
|
140
|
+
if (Class === null || !_is_native_function(Class)) return Class;
|
|
141
|
+
if (typeof Class !== "function") throw new TypeError("Super expression must either be null or a function");
|
|
142
|
+
if (typeof _cache !== "undefined") {
|
|
143
|
+
if (_cache.has(Class)) return _cache.get(Class);
|
|
144
|
+
_cache.set(Class, Wrapper);
|
|
145
|
+
}
|
|
146
|
+
function Wrapper() {
|
|
147
|
+
return _construct(Class, arguments, _get_prototype_of(this).constructor);
|
|
148
|
+
}
|
|
149
|
+
Wrapper.prototype = Object.create(Class.prototype, {
|
|
150
|
+
constructor: {
|
|
151
|
+
value: Wrapper,
|
|
152
|
+
enumerable: false,
|
|
153
|
+
writable: true,
|
|
154
|
+
configurable: true
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
return _set_prototype_of(Wrapper, Class);
|
|
158
|
+
};
|
|
159
|
+
return _wrap_native_super(Class);
|
|
160
|
+
}
|
|
161
|
+
|
|
94
162
|
function __decorate(decorators, target, key, desc) {
|
|
95
163
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
96
164
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -9178,18 +9246,18 @@ var EffectsMeshProxy = /*#__PURE__*/ function() {
|
|
|
9178
9246
|
|
|
9179
9247
|
/**
|
|
9180
9248
|
* Model 插件类,负责支持播放器中的 3D 功能
|
|
9181
|
-
*/ var ModelPlugin = /*#__PURE__*/ function(
|
|
9182
|
-
_inherits(ModelPlugin,
|
|
9249
|
+
*/ var ModelPlugin = /*#__PURE__*/ function(Plugin) {
|
|
9250
|
+
_inherits(ModelPlugin, Plugin);
|
|
9183
9251
|
function ModelPlugin() {
|
|
9184
9252
|
var _this;
|
|
9185
|
-
_this =
|
|
9253
|
+
_this = Plugin.apply(this, arguments) || this;
|
|
9186
9254
|
/**
|
|
9187
9255
|
* 插件名称
|
|
9188
9256
|
*/ _this.name = "model";
|
|
9189
9257
|
return _this;
|
|
9190
9258
|
}
|
|
9191
9259
|
var _proto = ModelPlugin.prototype;
|
|
9192
|
-
_proto.
|
|
9260
|
+
_proto.onAssetsLoadStart = function onAssetsLoadStart(scene, options) {
|
|
9193
9261
|
return _async_to_generator(function() {
|
|
9194
9262
|
return __generator(this, function(_state) {
|
|
9195
9263
|
switch(_state.label){
|
|
@@ -9211,7 +9279,7 @@ var EffectsMeshProxy = /*#__PURE__*/ function() {
|
|
|
9211
9279
|
* 整个 load 阶段都不会创建 GL 相关的对象,只创建 JS 对象
|
|
9212
9280
|
* @param scene - 场景
|
|
9213
9281
|
* @param options - 加载选项
|
|
9214
|
-
*/ _proto.
|
|
9282
|
+
*/ _proto.onAssetsLoadFinish = function onAssetsLoadFinish(scene, options, engine) {
|
|
9215
9283
|
var _options_pluginData;
|
|
9216
9284
|
if (options.pluginData !== undefined) {
|
|
9217
9285
|
var keyList = [
|
|
@@ -9265,7 +9333,7 @@ var EffectsMeshProxy = /*#__PURE__*/ function() {
|
|
|
9265
9333
|
* 创建 3D 场景管理器和缓存器
|
|
9266
9334
|
* @param composition - 合成
|
|
9267
9335
|
* @param scene - 场景
|
|
9268
|
-
*/ _proto.
|
|
9336
|
+
*/ _proto.onCompositionCreated = function onCompositionCreated(composition, scene) {
|
|
9269
9337
|
var props = {
|
|
9270
9338
|
id: "ModelPluginItem",
|
|
9271
9339
|
name: "ModelPluginItem",
|
|
@@ -9278,7 +9346,7 @@ var EffectsMeshProxy = /*#__PURE__*/ function() {
|
|
|
9278
9346
|
modelPluginComponent.sceneParams = scene.storage;
|
|
9279
9347
|
};
|
|
9280
9348
|
return ModelPlugin;
|
|
9281
|
-
}(EFFECTS.
|
|
9349
|
+
}(_wrap_native_super(EFFECTS.Plugin));
|
|
9282
9350
|
exports.ModelPluginComponent = /*#__PURE__*/ function(Behaviour) {
|
|
9283
9351
|
_inherits(ModelPluginComponent, Behaviour);
|
|
9284
9352
|
function ModelPluginComponent(engine) {
|
|
@@ -13129,7 +13197,7 @@ var GLTFHelper = /*#__PURE__*/ function() {
|
|
|
13129
13197
|
EFFECTS.registerPlugin("model", ModelPlugin);
|
|
13130
13198
|
/**
|
|
13131
13199
|
* 插件版本号
|
|
13132
|
-
*/ var version = "2.8.0-alpha.
|
|
13200
|
+
*/ var version = "2.8.0-alpha.4";
|
|
13133
13201
|
EFFECTS.logger.info("Plugin model version: " + version + ".");
|
|
13134
13202
|
if (version !== EFFECTS__namespace.version) {
|
|
13135
13203
|
console.error("注意:请统一 Model 插件与 Player 版本,不统一的版本混用会有不可预知的后果!", "\nAttention: Please ensure the Model plugin is synchronized with the Player version. Mixing and matching incompatible versions may result in unpredictable consequences!");
|