@galacean/engine-loader 1.0.0-beta.0 → 1.0.0-beta.3
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/main.js +16 -48
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +16 -48
- package/dist/module.js +16 -48
- package/dist/module.js.map +1 -1
- package/package.json +5 -5
- package/types/GLTFContentRestorer.d.ts +0 -3
- package/types/GLTFLoader.d.ts +0 -3
- package/types/Texture2DContentRestorer.d.ts +0 -3
- package/types/TextureCubeContentRestorer.d.ts +0 -3
- package/types/gltf/GLTFParser.d.ts +9 -0
- package/types/gltf/GLTFResource.d.ts +0 -3
- package/types/gltf/GLTFUtil.d.ts +53 -0
- package/types/gltf/Schema.d.ts +814 -0
- package/types/gltf/extensions/ExtensionParser.d.ts +8 -0
- package/types/gltf/extensions/Schema.d.ts +142 -0
- package/types/gltf/parser/AnimationParser.d.ts +7 -0
- package/types/gltf/parser/BufferParser.d.ts +7 -0
- package/types/gltf/parser/EntityParser.d.ts +9 -0
- package/types/gltf/parser/MaterialParser.d.ts +8 -0
- package/types/gltf/parser/MeshParser.d.ts +13 -0
- package/types/gltf/parser/Parser.d.ts +21 -0
- package/types/gltf/parser/ParserContext.d.ts +46 -0
- package/types/gltf/parser/SceneParser.d.ts +11 -0
- package/types/gltf/parser/SkinParser.d.ts +6 -0
- package/types/gltf/parser/TextureParser.d.ts +8 -0
- package/types/gltf/parser/Validator.d.ts +5 -0
package/dist/main.js
CHANGED
|
@@ -397,9 +397,7 @@ function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
|
|
|
397
397
|
return _this;
|
|
398
398
|
}
|
|
399
399
|
var _proto = GLTFContentRestorer.prototype;
|
|
400
|
-
|
|
401
|
-
* @override
|
|
402
|
-
*/ _proto.restoreContent = function restoreContent() {
|
|
400
|
+
_proto.restoreContent = function restoreContent() {
|
|
403
401
|
var _this = this;
|
|
404
402
|
return new engineCore.AssetPromise(function(resolve, reject) {
|
|
405
403
|
Promise.all(_this.bufferRequests.map(function(bufferRequestInfo) {
|
|
@@ -2329,9 +2327,7 @@ var GLTFValidator = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
2329
2327
|
return _this;
|
|
2330
2328
|
}
|
|
2331
2329
|
var _proto = GLTFResource.prototype;
|
|
2332
|
-
|
|
2333
|
-
* @override
|
|
2334
|
-
*/ _proto._onDestroy = function _onDestroy() {
|
|
2330
|
+
_proto._onDestroy = function _onDestroy() {
|
|
2335
2331
|
EngineObject.prototype._onDestroy.call(this);
|
|
2336
2332
|
this.defaultSceneRoot.destroy();
|
|
2337
2333
|
this.textures = null;
|
|
@@ -2354,9 +2350,7 @@ var GLTFLoader = /*#__PURE__*/ function(Loader) {
|
|
|
2354
2350
|
return Loader.apply(this, arguments);
|
|
2355
2351
|
}
|
|
2356
2352
|
var _proto = GLTFLoader.prototype;
|
|
2357
|
-
|
|
2358
|
-
* @override
|
|
2359
|
-
*/ _proto.load = function load(item, resourceManager) {
|
|
2353
|
+
_proto.load = function load(item, resourceManager) {
|
|
2360
2354
|
var url = item.url;
|
|
2361
2355
|
var params = item.params;
|
|
2362
2356
|
var context = new GLTFParserContext(url);
|
|
@@ -4203,9 +4197,7 @@ SpriteLoader = __decorate([
|
|
|
4203
4197
|
return _this;
|
|
4204
4198
|
}
|
|
4205
4199
|
var _proto = Texture2DContentRestorer.prototype;
|
|
4206
|
-
|
|
4207
|
-
* @override
|
|
4208
|
-
*/ _proto.restoreContent = function restoreContent() {
|
|
4200
|
+
_proto.restoreContent = function restoreContent() {
|
|
4209
4201
|
var _this = this;
|
|
4210
4202
|
return engineCore.request(this.url, this.requestConfig).then(function(image) {
|
|
4211
4203
|
var resource = _this.resource;
|
|
@@ -4223,9 +4215,7 @@ var Texture2DLoader = /*#__PURE__*/ function(Loader) {
|
|
|
4223
4215
|
return Loader.apply(this, arguments);
|
|
4224
4216
|
}
|
|
4225
4217
|
var _proto = Texture2DLoader.prototype;
|
|
4226
|
-
|
|
4227
|
-
* @override
|
|
4228
|
-
*/ _proto.load = function load(item, resourceManager) {
|
|
4218
|
+
_proto.load = function load(item, resourceManager) {
|
|
4229
4219
|
var _this = this;
|
|
4230
4220
|
return new engineCore.AssetPromise(function(resolve, reject) {
|
|
4231
4221
|
var url = item.url;
|
|
@@ -4271,9 +4261,7 @@ Texture2DLoader = __decorate([
|
|
|
4271
4261
|
return _this;
|
|
4272
4262
|
}
|
|
4273
4263
|
var _proto = TextureCubeContentRestorer.prototype;
|
|
4274
|
-
|
|
4275
|
-
* @override
|
|
4276
|
-
*/ _proto.restoreContent = function restoreContent() {
|
|
4264
|
+
_proto.restoreContent = function restoreContent() {
|
|
4277
4265
|
var _this = this;
|
|
4278
4266
|
return new engineCore.AssetPromise(function(resolve, reject) {
|
|
4279
4267
|
Promise.all(_this.urls.map(function(url) {
|
|
@@ -4299,9 +4287,7 @@ var TextureCubeLoader = /*#__PURE__*/ function(Loader) {
|
|
|
4299
4287
|
return Loader.apply(this, arguments);
|
|
4300
4288
|
}
|
|
4301
4289
|
var _proto = TextureCubeLoader.prototype;
|
|
4302
|
-
|
|
4303
|
-
* @override
|
|
4304
|
-
*/ _proto.load = function load(item, resourceManager) {
|
|
4290
|
+
_proto.load = function load(item, resourceManager) {
|
|
4305
4291
|
var _this = this;
|
|
4306
4292
|
return new engineCore.AssetPromise(function(resolve, reject) {
|
|
4307
4293
|
var urls = item.urls;
|
|
@@ -4467,16 +4453,12 @@ var KHR_draco_mesh_compression = (_KHR_draco_mesh_compression = /*#__PURE__*/ fu
|
|
|
4467
4453
|
return GLTFExtensionParser.apply(this, arguments);
|
|
4468
4454
|
}
|
|
4469
4455
|
var _proto = KHR_draco_mesh_compression1.prototype;
|
|
4470
|
-
|
|
4471
|
-
* @override
|
|
4472
|
-
*/ _proto.initialize = function initialize() {
|
|
4456
|
+
_proto.initialize = function initialize() {
|
|
4473
4457
|
if (!KHR_draco_mesh_compression._decoder) {
|
|
4474
4458
|
KHR_draco_mesh_compression._decoder = new engineDraco.DRACODecoder();
|
|
4475
4459
|
}
|
|
4476
4460
|
};
|
|
4477
|
-
|
|
4478
|
-
* @override
|
|
4479
|
-
*/ _proto.createAndParse = function createAndParse(context, schema, glTFPrimitive, glTFMesh) {
|
|
4461
|
+
_proto.createAndParse = function createAndParse(context, schema, glTFPrimitive, glTFMesh) {
|
|
4480
4462
|
var _this = this;
|
|
4481
4463
|
var glTF = context.glTF, buffers = context.buffers, engine = context.glTFResource.engine;
|
|
4482
4464
|
var bufferViews = glTF.bufferViews, accessors = glTF.accessors;
|
|
@@ -4631,9 +4613,7 @@ var KHR_lights_punctual = /*#__PURE__*/ function(GLTFExtensionParser) {
|
|
|
4631
4613
|
return GLTFExtensionParser.apply(this, arguments);
|
|
4632
4614
|
}
|
|
4633
4615
|
var _proto = KHR_lights_punctual.prototype;
|
|
4634
|
-
|
|
4635
|
-
* @override
|
|
4636
|
-
*/ _proto.additiveParse = function additiveParse(context, entity, extensionSchema) {
|
|
4616
|
+
_proto.additiveParse = function additiveParse(context, entity, extensionSchema) {
|
|
4637
4617
|
var lightsSchema = context.glTF.extensions.KHR_lights_punctual.lights;
|
|
4638
4618
|
var lightSchema = lightsSchema[extensionSchema.light];
|
|
4639
4619
|
var color = lightSchema.color, _lightSchema_intensity = lightSchema.intensity, intensity = _lightSchema_intensity === void 0 ? 1 : _lightSchema_intensity, type = lightSchema.type, range = lightSchema.range, spot = lightSchema.spot;
|
|
@@ -4673,9 +4653,7 @@ var KHR_materials_clearcoat = /*#__PURE__*/ function(GLTFExtensionParser) {
|
|
|
4673
4653
|
return GLTFExtensionParser.apply(this, arguments);
|
|
4674
4654
|
}
|
|
4675
4655
|
var _proto = KHR_materials_clearcoat.prototype;
|
|
4676
|
-
|
|
4677
|
-
* @override
|
|
4678
|
-
*/ _proto.additiveParse = function additiveParse(context, material, schema) {
|
|
4656
|
+
_proto.additiveParse = function additiveParse(context, material, schema) {
|
|
4679
4657
|
var textures = context.glTFResource.textures;
|
|
4680
4658
|
var _schema_clearcoatFactor = schema.clearcoatFactor, clearcoatFactor = _schema_clearcoatFactor === void 0 ? 0 : _schema_clearcoatFactor, clearcoatTexture = schema.clearcoatTexture, _schema_clearcoatRoughnessFactor = schema.clearcoatRoughnessFactor, clearcoatRoughnessFactor = _schema_clearcoatRoughnessFactor === void 0 ? 0 : _schema_clearcoatRoughnessFactor, clearcoatRoughnessTexture = schema.clearcoatRoughnessTexture, clearcoatNormalTexture = schema.clearcoatNormalTexture;
|
|
4681
4659
|
material.clearCoat = clearcoatFactor;
|
|
@@ -4705,9 +4683,7 @@ var KHR_materials_pbrSpecularGlossiness = /*#__PURE__*/ function(GLTFExtensionPa
|
|
|
4705
4683
|
return GLTFExtensionParser.apply(this, arguments);
|
|
4706
4684
|
}
|
|
4707
4685
|
var _proto = KHR_materials_pbrSpecularGlossiness.prototype;
|
|
4708
|
-
|
|
4709
|
-
* @override
|
|
4710
|
-
*/ _proto.createAndParse = function createAndParse(context, schema, ownerSchema) {
|
|
4686
|
+
_proto.createAndParse = function createAndParse(context, schema, ownerSchema) {
|
|
4711
4687
|
var _context_glTFResource = context.glTFResource, engine = _context_glTFResource.engine, textures = _context_glTFResource.textures;
|
|
4712
4688
|
var material = new engineCore.PBRSpecularMaterial(engine);
|
|
4713
4689
|
var diffuseFactor = schema.diffuseFactor, diffuseTexture = schema.diffuseTexture, specularFactor = schema.specularFactor, glossinessFactor = schema.glossinessFactor, specularGlossinessTexture = schema.specularGlossinessTexture;
|
|
@@ -4744,9 +4720,7 @@ var KHR_materials_unlit = /*#__PURE__*/ function(GLTFExtensionParser) {
|
|
|
4744
4720
|
return GLTFExtensionParser.apply(this, arguments);
|
|
4745
4721
|
}
|
|
4746
4722
|
var _proto = KHR_materials_unlit.prototype;
|
|
4747
|
-
|
|
4748
|
-
* @override
|
|
4749
|
-
*/ _proto.createAndParse = function createAndParse(context, _, ownerSchema) {
|
|
4723
|
+
_proto.createAndParse = function createAndParse(context, _, ownerSchema) {
|
|
4750
4724
|
var engine = context.glTFResource.engine;
|
|
4751
4725
|
var material = new engineCore.UnlitMaterial(engine);
|
|
4752
4726
|
material.name = ownerSchema.name;
|
|
@@ -4776,9 +4750,7 @@ var KHR_texture_transform = /*#__PURE__*/ function(GLTFExtensionParser) {
|
|
|
4776
4750
|
return GLTFExtensionParser.apply(this, arguments);
|
|
4777
4751
|
}
|
|
4778
4752
|
var _proto = KHR_texture_transform.prototype;
|
|
4779
|
-
|
|
4780
|
-
* @override
|
|
4781
|
-
*/ _proto.additiveParse = function additiveParse(context, material, schema) {
|
|
4753
|
+
_proto.additiveParse = function additiveParse(context, material, schema) {
|
|
4782
4754
|
var offset = schema.offset, rotation = schema.rotation, scale = schema.scale, texCoord = schema.texCoord;
|
|
4783
4755
|
if (offset) {
|
|
4784
4756
|
material.tilingOffset.z = offset[0];
|
|
@@ -4807,9 +4779,7 @@ var GALACEAN_materials_remap = /*#__PURE__*/ function(GLTFExtensionParser) {
|
|
|
4807
4779
|
return GLTFExtensionParser.apply(this, arguments);
|
|
4808
4780
|
}
|
|
4809
4781
|
var _proto = GALACEAN_materials_remap.prototype;
|
|
4810
|
-
|
|
4811
|
-
* @override
|
|
4812
|
-
*/ _proto.createAndParse = function createAndParse(context, schema) {
|
|
4782
|
+
_proto.createAndParse = function createAndParse(context, schema) {
|
|
4813
4783
|
var engine = context.glTFResource.engine;
|
|
4814
4784
|
// @ts-ignore
|
|
4815
4785
|
return engine.resourceManager.getResourceByRef(schema);
|
|
@@ -4826,9 +4796,7 @@ var GALACEAN_animation_event = /*#__PURE__*/ function(GLTFExtensionParser) {
|
|
|
4826
4796
|
return GLTFExtensionParser.apply(this, arguments);
|
|
4827
4797
|
}
|
|
4828
4798
|
var _proto = GALACEAN_animation_event.prototype;
|
|
4829
|
-
|
|
4830
|
-
* @override
|
|
4831
|
-
*/ _proto.additiveParse = function additiveParse(context, animationClip, schema) {
|
|
4799
|
+
_proto.additiveParse = function additiveParse(context, animationClip, schema) {
|
|
4832
4800
|
context.glTFResource.engine;
|
|
4833
4801
|
var events = schema.events;
|
|
4834
4802
|
events.map(function(eventData) {
|