This commit is contained in:
2026-05-18 18:53:30 +08:00
parent fb193c0528
commit 840e3d6a55
12 changed files with 907 additions and 68 deletions

View File

@ -355762,14 +355762,26 @@ clipPos=viewProjection*worldPos;previousClipPos=previousViewProjection*previousW
const color = Color3.FromHexString(options.albedoColor);
material.albedoColor.copyFrom(color);
}
if (options.albedoTexture) {
material.albedoTexture = new Texture(options.albedoTexture);
if (options.albedoTexture !== void 0) {
if (options.albedoTexture) {
material.albedoTexture = new Texture(options.albedoTexture);
} else {
material.albedoTexture = null;
}
}
if (options.normalMap) {
material.bumpTexture = new Texture(options.normalMap);
if (options.normalMap !== void 0) {
if (options.normalMap) {
material.bumpTexture = new Texture(options.normalMap);
} else {
material.bumpTexture = null;
}
}
if (options.metallicTexture) {
material.metallicTexture = new Texture(options.metallicTexture);
if (options.metallicTexture !== void 0) {
if (options.metallicTexture) {
material.metallicTexture = new Texture(options.metallicTexture);
} else {
material.metallicTexture = null;
}
}
if (options.roughness !== void 0) {
material.roughness = options.roughness;
@ -357185,6 +357197,19 @@ clipPos=viewProjection*worldPos;previousClipPos=previousViewProjection*previousW
*/
removeAll: () => {
this.mainApp.appModel.removeAll();
},
/**
* 检查模型是否已加载
* @param modelId 模型ID
* @returns 模型是否存在
* @example
* // 检查模型是否已加载,避免重复加载
* if (!kernel.model.exists('shed_001')) {
* await kernel.model.add({ modelId: 'shed_001', modelUrl: '...' });
* }
*/
exists: (modelId) => {
return this.mainApp.appModel.exists(modelId);
}
};
/** 材质管理 */