修复
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
yinsx
2026-01-05 14:11:45 +08:00
parent 8e65eeb501
commit 58cd883720
5 changed files with 16 additions and 36 deletions

View File

@ -11,7 +11,7 @@ export const AppConfig = {
success: null as OptionalCallback,
error: null as ErrorCallback,
env: {
hdrPath:"",
envPath:"",
intensity: 1,
rotationY: 0
}

View File

@ -15,17 +15,17 @@ export class AppEnv extends Monobehiver {
/** 初始化 - 创建默认HDR环境 */
Awake(): void {
this.createHDR(AppConfig.env);
}
/**
* 创建HDR环境贴图
* @param hdrPath HDR文件路径
*/
createHDR(options?: { hdrPath?: string; intensity?: number; rotationY?: number }): void {
const hdrPath = options?.hdrPath || AppConfig.env.hdrPath || '/hdr/sanGiuseppeBridge.env';
const intensity = options?.intensity ?? AppConfig.env.intensity ?? 1.5;
const rotationY = options?.rotationY ?? AppConfig.env.rotationY ?? 0;
createHDR(): void {
const hdrPath = AppConfig.env.envPath;
const intensity = AppConfig.env.intensity ?? 1.5;
const rotationY = AppConfig.env.rotationY ?? 0;
const scene = this.mainApp.appScene.object;
if (!scene) return;
if (this.object) {
@ -57,13 +57,6 @@ export class AppEnv extends Monobehiver {
if (this.object) this.object.rotationY = angle;
}
/**
* 更新环境配置
*/
updateEnvironment(options: { hdrPath?: string; intensity?: number; rotationY?: number }): void {
this.createHDR(options);
}
/** 清理资源 */
clean(): void {
if (this.object) {

View File

@ -57,17 +57,6 @@ const kernel = {
await mainApp.loadModel();
},
/** 更新环境贴图配置(路径/强度/旋转) */
setEnvironment: function (envConfig: { hdrPath?: string; intensity?: number; rotationY?: number }): void {
if (!mainApp) {
console.warn('mainApp is not initialized yet');
return;
}
if (envConfig) {
AppConfig.env = { ...AppConfig.env, ...envConfig };
mainApp.appEnv.updateEnvironment(AppConfig.env);
}
}
};
if (!window.faceSDK) {