1
This commit is contained in:
@ -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);
|
||||
}
|
||||
};
|
||||
/** 材质管理 */
|
||||
|
||||
Reference in New Issue
Block a user