@galacean/engine-loader 1.1.0-beta.12 → 1.1.0-beta.13
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 +9 -6
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +9 -6
- package/dist/module.js +9 -6
- package/dist/module.js.map +1 -1
- package/package.json +5 -5
- package/types/GLTFLoader.d.ts +1 -0
- package/types/gltf/parser/GLTFParserContext.d.ts +3 -2
package/dist/miniprogram.js
CHANGED
|
@@ -1547,10 +1547,10 @@ var TextureWrapMode;
|
|
|
1547
1547
|
/**
|
|
1548
1548
|
* @internal
|
|
1549
1549
|
*/ var GLTFParserContext = /*#__PURE__*/ function() {
|
|
1550
|
-
function GLTFParserContext(glTFResource, resourceManager,
|
|
1550
|
+
function GLTFParserContext(glTFResource, resourceManager, params) {
|
|
1551
1551
|
this.glTFResource = glTFResource;
|
|
1552
1552
|
this.resourceManager = resourceManager;
|
|
1553
|
-
this.
|
|
1553
|
+
this.params = params;
|
|
1554
1554
|
this.accessorBufferCache = {};
|
|
1555
1555
|
this._resourceCache = new Map();
|
|
1556
1556
|
this.contentRestorer = new GLTFContentRestorer(glTFResource);
|
|
@@ -3885,7 +3885,7 @@ exports.GLTFMeshParser = (_GLTFMeshParser = /*#__PURE__*/ function(GLTFParser1)
|
|
|
3885
3885
|
return context.get(exports.GLTFParserType.Buffer).then(function(buffers) {
|
|
3886
3886
|
return GLTFUtils.getAccessorData(glTF, indexAccessor, buffers);
|
|
3887
3887
|
});
|
|
3888
|
-
}, context.keepMeshData).then(resolve);
|
|
3888
|
+
}, context.params.keepMeshData).then(resolve);
|
|
3889
3889
|
}
|
|
3890
3890
|
});
|
|
3891
3891
|
};
|
|
@@ -4066,6 +4066,7 @@ exports.GLTFSceneParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
4066
4066
|
var _this = this;
|
|
4067
4067
|
var _context_glTF = context.glTF, scenes = _context_glTF.scenes, _context_glTF_scene = _context_glTF.scene, scene = _context_glTF_scene === void 0 ? 0 : _context_glTF_scene, glTFResource = context.glTFResource;
|
|
4068
4068
|
var sceneInfo = scenes[index];
|
|
4069
|
+
var sceneExtensions = sceneInfo.extensions;
|
|
4069
4070
|
var engine = glTFResource.engine;
|
|
4070
4071
|
var isDefaultScene = scene === index;
|
|
4071
4072
|
var sceneNodes = sceneInfo.nodes;
|
|
@@ -4091,6 +4092,7 @@ exports.GLTFSceneParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
4091
4092
|
promises.push(this._parseEntityComponent(context, sceneNodes[i1]));
|
|
4092
4093
|
}
|
|
4093
4094
|
return Promise.all(promises).then(function() {
|
|
4095
|
+
GLTFParser.executeExtensionsAdditiveAndParse(sceneExtensions, context, sceneRoot, sceneInfo);
|
|
4094
4096
|
if (isDefaultScene) {
|
|
4095
4097
|
return Promise.all([
|
|
4096
4098
|
context.get(exports.GLTFParserType.Skin),
|
|
@@ -4467,11 +4469,12 @@ var GLTFLoader = /*#__PURE__*/ function(Loader1) {
|
|
|
4467
4469
|
}
|
|
4468
4470
|
var _proto = GLTFLoader.prototype;
|
|
4469
4471
|
_proto.load = function load(item, resourceManager) {
|
|
4470
|
-
var _params;
|
|
4471
4472
|
var url = item.url;
|
|
4472
4473
|
var params = item.params;
|
|
4473
4474
|
var glTFResource = new GLTFResource(resourceManager.engine, url);
|
|
4474
|
-
var context = new GLTFParserContext(glTFResource, resourceManager,
|
|
4475
|
+
var context = new GLTFParserContext(glTFResource, resourceManager, _extends({
|
|
4476
|
+
keepMeshData: false
|
|
4477
|
+
}, params));
|
|
4475
4478
|
return context.parse();
|
|
4476
4479
|
};
|
|
4477
4480
|
return GLTFLoader;
|
|
@@ -5683,7 +5686,7 @@ var KHR_draco_mesh_compression = (_KHR_draco_mesh_compression = /*#__PURE__*/ fu
|
|
|
5683
5686
|
throw "BlendShape animation is not supported when using draco.";
|
|
5684
5687
|
}, function() {
|
|
5685
5688
|
return decodedGeometry.index.array;
|
|
5686
|
-
}, context.keepMeshData);
|
|
5689
|
+
}, context.params.keepMeshData);
|
|
5687
5690
|
});
|
|
5688
5691
|
});
|
|
5689
5692
|
};
|
package/dist/module.js
CHANGED
|
@@ -1542,10 +1542,10 @@ var TextureWrapMode;
|
|
|
1542
1542
|
/**
|
|
1543
1543
|
* @internal
|
|
1544
1544
|
*/ var GLTFParserContext = /*#__PURE__*/ function() {
|
|
1545
|
-
function GLTFParserContext(glTFResource, resourceManager,
|
|
1545
|
+
function GLTFParserContext(glTFResource, resourceManager, params) {
|
|
1546
1546
|
this.glTFResource = glTFResource;
|
|
1547
1547
|
this.resourceManager = resourceManager;
|
|
1548
|
-
this.
|
|
1548
|
+
this.params = params;
|
|
1549
1549
|
this.accessorBufferCache = {};
|
|
1550
1550
|
this._resourceCache = new Map();
|
|
1551
1551
|
this.contentRestorer = new GLTFContentRestorer(glTFResource);
|
|
@@ -3880,7 +3880,7 @@ var GLTFMeshParser = (_GLTFMeshParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
3880
3880
|
return context.get(GLTFParserType.Buffer).then(function(buffers) {
|
|
3881
3881
|
return GLTFUtils.getAccessorData(glTF, indexAccessor, buffers);
|
|
3882
3882
|
});
|
|
3883
|
-
}, context.keepMeshData).then(resolve);
|
|
3883
|
+
}, context.params.keepMeshData).then(resolve);
|
|
3884
3884
|
}
|
|
3885
3885
|
});
|
|
3886
3886
|
};
|
|
@@ -4061,6 +4061,7 @@ var GLTFSceneParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
4061
4061
|
var _this = this;
|
|
4062
4062
|
var _context_glTF = context.glTF, scenes = _context_glTF.scenes, _context_glTF_scene = _context_glTF.scene, scene = _context_glTF_scene === void 0 ? 0 : _context_glTF_scene, glTFResource = context.glTFResource;
|
|
4063
4063
|
var sceneInfo = scenes[index];
|
|
4064
|
+
var sceneExtensions = sceneInfo.extensions;
|
|
4064
4065
|
var engine = glTFResource.engine;
|
|
4065
4066
|
var isDefaultScene = scene === index;
|
|
4066
4067
|
var sceneNodes = sceneInfo.nodes;
|
|
@@ -4086,6 +4087,7 @@ var GLTFSceneParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
4086
4087
|
promises.push(this._parseEntityComponent(context, sceneNodes[i1]));
|
|
4087
4088
|
}
|
|
4088
4089
|
return Promise.all(promises).then(function() {
|
|
4090
|
+
GLTFParser.executeExtensionsAdditiveAndParse(sceneExtensions, context, sceneRoot, sceneInfo);
|
|
4089
4091
|
if (isDefaultScene) {
|
|
4090
4092
|
return Promise.all([
|
|
4091
4093
|
context.get(GLTFParserType.Skin),
|
|
@@ -4462,11 +4464,12 @@ var GLTFLoader = /*#__PURE__*/ function(Loader1) {
|
|
|
4462
4464
|
}
|
|
4463
4465
|
var _proto = GLTFLoader.prototype;
|
|
4464
4466
|
_proto.load = function load(item, resourceManager) {
|
|
4465
|
-
var _params;
|
|
4466
4467
|
var url = item.url;
|
|
4467
4468
|
var params = item.params;
|
|
4468
4469
|
var glTFResource = new GLTFResource(resourceManager.engine, url);
|
|
4469
|
-
var context = new GLTFParserContext(glTFResource, resourceManager,
|
|
4470
|
+
var context = new GLTFParserContext(glTFResource, resourceManager, _extends({
|
|
4471
|
+
keepMeshData: false
|
|
4472
|
+
}, params));
|
|
4470
4473
|
return context.parse();
|
|
4471
4474
|
};
|
|
4472
4475
|
return GLTFLoader;
|
|
@@ -5678,7 +5681,7 @@ var KHR_draco_mesh_compression = (_KHR_draco_mesh_compression = /*#__PURE__*/ fu
|
|
|
5678
5681
|
throw "BlendShape animation is not supported when using draco.";
|
|
5679
5682
|
}, function() {
|
|
5680
5683
|
return decodedGeometry.index.array;
|
|
5681
|
-
}, context.keepMeshData);
|
|
5684
|
+
}, context.params.keepMeshData);
|
|
5682
5685
|
});
|
|
5683
5686
|
});
|
|
5684
5687
|
};
|