@galacean/engine 1.3.2 → 1.3.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/browser.js +99 -59
- package/dist/browser.js.map +1 -1
- package/dist/browser.min.js +1 -1
- package/dist/browser.min.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/miniprogram.js +1 -1
- package/dist/module.js +1 -1
- package/package.json +5 -5
- package/dist/.DS_Store +0 -0
- package/dist/browser.js.map.zip +0 -0
- package/dist/browser.min.js.map.zip +0 -0
package/dist/browser.js
CHANGED
|
@@ -22571,6 +22571,17 @@
|
|
|
22571
22571
|
this._setInActiveInHierarchy(this._activeChangedComponents, activeChangeFlag);
|
|
22572
22572
|
this._setActiveComponents(false, activeChangeFlag);
|
|
22573
22573
|
};
|
|
22574
|
+
/**
|
|
22575
|
+
* @internal
|
|
22576
|
+
*/ _proto._setTransformDirty = function _setTransformDirty() {
|
|
22577
|
+
if (this.transform) {
|
|
22578
|
+
this.transform._parentChange();
|
|
22579
|
+
} else {
|
|
22580
|
+
for(var i = 0, len = this._children.length; i < len; i++){
|
|
22581
|
+
this._children[i]._setTransformDirty();
|
|
22582
|
+
}
|
|
22583
|
+
}
|
|
22584
|
+
};
|
|
22574
22585
|
_proto._addToChildrenList = function _addToChildrenList(index, child) {
|
|
22575
22586
|
var children = this._children;
|
|
22576
22587
|
var childCount = children.length;
|
|
@@ -22680,15 +22691,6 @@
|
|
|
22680
22691
|
child.isActive && child._setInActiveInHierarchy(activeChangedComponents, activeChangeFlag);
|
|
22681
22692
|
}
|
|
22682
22693
|
};
|
|
22683
|
-
_proto._setTransformDirty = function _setTransformDirty() {
|
|
22684
|
-
if (this.transform) {
|
|
22685
|
-
this.transform._parentChange();
|
|
22686
|
-
} else {
|
|
22687
|
-
for(var i = 0, len = this._children.length; i < len; i++){
|
|
22688
|
-
this._children[i]._setTransformDirty();
|
|
22689
|
-
}
|
|
22690
|
-
}
|
|
22691
|
-
};
|
|
22692
22694
|
_proto._setSiblingIndex = function _setSiblingIndex(sibling, target) {
|
|
22693
22695
|
target = Math.min(target, sibling.length - 1);
|
|
22694
22696
|
if (target < 0) {
|
|
@@ -30295,6 +30297,7 @@
|
|
|
30295
30297
|
if (!isRoot) {
|
|
30296
30298
|
entity._isRoot = true;
|
|
30297
30299
|
entity._removeFromParent();
|
|
30300
|
+
entity._setTransformDirty();
|
|
30298
30301
|
}
|
|
30299
30302
|
// Add or remove from scene's rootEntities
|
|
30300
30303
|
var oldScene = entity._scene;
|
|
@@ -45946,57 +45949,18 @@
|
|
|
45946
45949
|
], exports.GLTFSkinParser);
|
|
45947
45950
|
var _GLTFTextureParser;
|
|
45948
45951
|
exports.GLTFTextureParser = (_GLTFTextureParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
45949
|
-
var
|
|
45952
|
+
var GLTFTextureParser1 = function GLTFTextureParser1() {
|
|
45950
45953
|
return GLTFParser1.apply(this, arguments);
|
|
45951
45954
|
};
|
|
45952
|
-
_inherits(
|
|
45953
|
-
var _proto =
|
|
45954
|
-
_proto.parse = function parse(context,
|
|
45955
|
-
var textureInfo = context.glTF.textures[
|
|
45956
|
-
var glTFResource = context.glTFResource
|
|
45957
|
-
var
|
|
45958
|
-
var
|
|
45959
|
-
var _glTF_images_source = glTF.images[source], uri = _glTF_images_source.uri, bufferViewIndex = _glTF_images_source.bufferView, mimeType = _glTF_images_source.mimeType, imageName = _glTF_images_source.name;
|
|
45960
|
-
var texture = GLTFParser.executeExtensionsCreateAndParse(extensions, context, textureInfo);
|
|
45955
|
+
_inherits(GLTFTextureParser1, GLTFParser1);
|
|
45956
|
+
var _proto = GLTFTextureParser1.prototype;
|
|
45957
|
+
_proto.parse = function parse(context, textureIndex) {
|
|
45958
|
+
var textureInfo = context.glTF.textures[textureIndex];
|
|
45959
|
+
var glTFResource = context.glTFResource;
|
|
45960
|
+
var sampler = textureInfo.sampler, tmp = textureInfo.source, imageIndex = tmp === void 0 ? 0 : tmp, textureName = textureInfo.name, extensions = textureInfo.extensions;
|
|
45961
|
+
var texture = GLTFParser.executeExtensionsCreateAndParse(extensions, context, textureInfo, textureIndex);
|
|
45961
45962
|
if (!texture) {
|
|
45962
|
-
|
|
45963
|
-
var samplerInfo = sampler !== undefined && GLTFUtils.getSamplerInfo(glTF.samplers[sampler]);
|
|
45964
|
-
if (uri) {
|
|
45965
|
-
var _samplerInfo;
|
|
45966
|
-
// TODO: deleted in 2.0
|
|
45967
|
-
var extIndex = uri.lastIndexOf(".");
|
|
45968
|
-
var ext = uri.substring(extIndex + 1);
|
|
45969
|
-
var type = ext.startsWith("ktx") ? exports.AssetType.KTX : exports.AssetType.Texture2D;
|
|
45970
|
-
texture = engine.resourceManager.load({
|
|
45971
|
-
url: Utils.resolveAbsoluteUrl(url, uri),
|
|
45972
|
-
type: type,
|
|
45973
|
-
params: {
|
|
45974
|
-
mipmap: (_samplerInfo = samplerInfo) == null ? void 0 : _samplerInfo.mipmap
|
|
45975
|
-
}
|
|
45976
|
-
}).onProgress(undefined, context._onTaskDetail).then(function(texture) {
|
|
45977
|
-
texture.name = textureName || imageName || texture.name || "texture_" + index;
|
|
45978
|
-
useSampler && GLTFUtils.parseSampler(texture, samplerInfo);
|
|
45979
|
-
return texture;
|
|
45980
|
-
});
|
|
45981
|
-
context._addTaskCompletePromise(texture);
|
|
45982
|
-
} else {
|
|
45983
|
-
var bufferView = glTF.bufferViews[bufferViewIndex];
|
|
45984
|
-
texture = context.get(exports.GLTFParserType.Buffer).then(function(buffers) {
|
|
45985
|
-
var buffer = buffers[bufferView.buffer];
|
|
45986
|
-
var imageBuffer = new Uint8Array(buffer, bufferView.byteOffset, bufferView.byteLength);
|
|
45987
|
-
return GLTFUtils.loadImageBuffer(imageBuffer, mimeType).then(function(image) {
|
|
45988
|
-
var _samplerInfo;
|
|
45989
|
-
var texture = new Texture2D(engine, image.width, image.height, undefined, (_samplerInfo = samplerInfo) == null ? void 0 : _samplerInfo.mipmap);
|
|
45990
|
-
texture.setImageSource(image);
|
|
45991
|
-
texture.generateMipmaps();
|
|
45992
|
-
texture.name = textureName || imageName || "texture_" + index;
|
|
45993
|
-
useSampler && GLTFUtils.parseSampler(texture, samplerInfo);
|
|
45994
|
-
var bufferTextureRestoreInfo = new BufferTextureRestoreInfo(texture, bufferView, mimeType);
|
|
45995
|
-
context.contentRestorer.bufferTextures.push(bufferTextureRestoreInfo);
|
|
45996
|
-
return texture;
|
|
45997
|
-
});
|
|
45998
|
-
});
|
|
45999
|
-
}
|
|
45963
|
+
texture = exports.GLTFTextureParser._parseTexture(context, imageIndex, textureIndex, sampler, textureName);
|
|
46000
45964
|
}
|
|
46001
45965
|
return Promise.resolve(texture).then(function(texture) {
|
|
46002
45966
|
GLTFParser.executeExtensionsAdditiveAndParse(extensions, context, texture, textureInfo);
|
|
@@ -46005,7 +45969,51 @@
|
|
|
46005
45969
|
return texture;
|
|
46006
45970
|
});
|
|
46007
45971
|
};
|
|
46008
|
-
|
|
45972
|
+
/** @internal */ GLTFTextureParser1._parseTexture = function _parseTexture(context, imageIndex, textureIndex, sampler, textureName) {
|
|
45973
|
+
var glTFResource = context.glTFResource, glTF = context.glTF;
|
|
45974
|
+
var engine = glTFResource.engine, url = glTFResource.url;
|
|
45975
|
+
var _glTF_images_imageIndex = glTF.images[imageIndex], uri = _glTF_images_imageIndex.uri, bufferViewIndex = _glTF_images_imageIndex.bufferView, mimeType = _glTF_images_imageIndex.mimeType, imageName = _glTF_images_imageIndex.name;
|
|
45976
|
+
var useSampler = sampler !== undefined;
|
|
45977
|
+
var samplerInfo = useSampler && GLTFUtils.getSamplerInfo(glTF.samplers[sampler]);
|
|
45978
|
+
var texture;
|
|
45979
|
+
if (uri) {
|
|
45980
|
+
var _samplerInfo;
|
|
45981
|
+
var extIndex = uri.lastIndexOf(".");
|
|
45982
|
+
var ext = uri.substring(extIndex + 1);
|
|
45983
|
+
var type = ext.startsWith("ktx") ? exports.AssetType.KTX : exports.AssetType.Texture2D;
|
|
45984
|
+
texture = engine.resourceManager.load({
|
|
45985
|
+
url: Utils.resolveAbsoluteUrl(url, uri),
|
|
45986
|
+
type: type,
|
|
45987
|
+
params: {
|
|
45988
|
+
mipmap: (_samplerInfo = samplerInfo) == null ? void 0 : _samplerInfo.mipmap
|
|
45989
|
+
}
|
|
45990
|
+
}).onProgress(undefined, context._onTaskDetail).then(function(texture) {
|
|
45991
|
+
texture.name = textureName || imageName || texture.name || "texture_" + textureIndex;
|
|
45992
|
+
useSampler && GLTFUtils.parseSampler(texture, samplerInfo);
|
|
45993
|
+
return texture;
|
|
45994
|
+
});
|
|
45995
|
+
context._addTaskCompletePromise(texture);
|
|
45996
|
+
} else {
|
|
45997
|
+
var bufferView = glTF.bufferViews[bufferViewIndex];
|
|
45998
|
+
texture = context.get(exports.GLTFParserType.Buffer).then(function(buffers) {
|
|
45999
|
+
var buffer = buffers[bufferView.buffer];
|
|
46000
|
+
var imageBuffer = new Uint8Array(buffer, bufferView.byteOffset, bufferView.byteLength);
|
|
46001
|
+
return GLTFUtils.loadImageBuffer(imageBuffer, mimeType).then(function(image) {
|
|
46002
|
+
var _samplerInfo;
|
|
46003
|
+
var texture = new Texture2D(engine, image.width, image.height, undefined, (_samplerInfo = samplerInfo) == null ? void 0 : _samplerInfo.mipmap);
|
|
46004
|
+
texture.setImageSource(image);
|
|
46005
|
+
texture.generateMipmaps();
|
|
46006
|
+
texture.name = textureName || imageName || "texture_" + textureIndex;
|
|
46007
|
+
useSampler && GLTFUtils.parseSampler(texture, samplerInfo);
|
|
46008
|
+
var bufferTextureRestoreInfo = new BufferTextureRestoreInfo(texture, bufferView, mimeType);
|
|
46009
|
+
context.contentRestorer.bufferTextures.push(bufferTextureRestoreInfo);
|
|
46010
|
+
return texture;
|
|
46011
|
+
});
|
|
46012
|
+
});
|
|
46013
|
+
}
|
|
46014
|
+
return texture;
|
|
46015
|
+
};
|
|
46016
|
+
return GLTFTextureParser1;
|
|
46009
46017
|
}(GLTFParser), function() {
|
|
46010
46018
|
var _obj;
|
|
46011
46019
|
/** @internal */ _GLTFTextureParser._wrapMap = (_obj = {}, _obj[TextureWrapMode.CLAMP_TO_EDGE] = exports.TextureWrapMode.Clamp, _obj[TextureWrapMode.MIRRORED_REPEAT] = exports.TextureWrapMode.Mirror, _obj[TextureWrapMode.REPEAT] = exports.TextureWrapMode.Repeat, _obj);
|
|
@@ -48028,9 +48036,41 @@
|
|
|
48028
48036
|
KHR_materials_anisotropy = __decorate([
|
|
48029
48037
|
registerGLTFExtension("KHR_materials_anisotropy", exports.GLTFExtensionMode.AdditiveParse)
|
|
48030
48038
|
], KHR_materials_anisotropy);
|
|
48039
|
+
var EXT_texture_webp = /*#__PURE__*/ function(GLTFExtensionParser1) {
|
|
48040
|
+
var EXT_texture_webp = function EXT_texture_webp() {
|
|
48041
|
+
var _this;
|
|
48042
|
+
_this = GLTFExtensionParser1.call(this) || this;
|
|
48043
|
+
_this._supportWebP = false;
|
|
48044
|
+
var testCanvas = document.createElement("canvas");
|
|
48045
|
+
testCanvas.width = testCanvas.height = 1;
|
|
48046
|
+
_this._supportWebP = testCanvas.toDataURL("image/webp").indexOf("data:image/webp") == 0;
|
|
48047
|
+
return _this;
|
|
48048
|
+
};
|
|
48049
|
+
_inherits(EXT_texture_webp, GLTFExtensionParser1);
|
|
48050
|
+
var _proto = EXT_texture_webp.prototype;
|
|
48051
|
+
_proto.createAndParse = function createAndParse(context, schema, textureInfo, textureIndex) {
|
|
48052
|
+
var _this = this;
|
|
48053
|
+
return _async_to_generator(function() {
|
|
48054
|
+
var webPIndex, sampler, tmp, fallbackIndex, textureName, texture;
|
|
48055
|
+
return __generator(this, function(_state) {
|
|
48056
|
+
webPIndex = schema.source;
|
|
48057
|
+
sampler = textureInfo.sampler, tmp = textureInfo.source, fallbackIndex = tmp === void 0 ? 0 : tmp, textureName = textureInfo.name;
|
|
48058
|
+
texture = exports.GLTFTextureParser._parseTexture(context, _this._supportWebP ? webPIndex : fallbackIndex, textureIndex, sampler, textureName);
|
|
48059
|
+
return [
|
|
48060
|
+
2,
|
|
48061
|
+
texture
|
|
48062
|
+
];
|
|
48063
|
+
});
|
|
48064
|
+
})();
|
|
48065
|
+
};
|
|
48066
|
+
return EXT_texture_webp;
|
|
48067
|
+
}(GLTFExtensionParser);
|
|
48068
|
+
EXT_texture_webp = __decorate([
|
|
48069
|
+
registerGLTFExtension("EXT_texture_webp", exports.GLTFExtensionMode.CreateAndParse)
|
|
48070
|
+
], EXT_texture_webp);
|
|
48031
48071
|
|
|
48032
48072
|
//@ts-ignore
|
|
48033
|
-
var version = "1.3.
|
|
48073
|
+
var version = "1.3.3";
|
|
48034
48074
|
console.log("Galacean engine version: " + version);
|
|
48035
48075
|
for(var key in CoreObjects){
|
|
48036
48076
|
Loader.registerClass(key, CoreObjects[key]);
|