This commit is contained in:
@ -11,6 +11,8 @@ import { AppLight } from './AppLight';
|
||||
import { AppEnv } from './AppEnv';
|
||||
import { AppModel } from './AppModel';
|
||||
import { AppConfig } from './AppConfig';
|
||||
import { AppRay } from './AppRay';
|
||||
import { EventBridge } from '../event/bridge';
|
||||
|
||||
/**
|
||||
* 主应用类 - 3D场景的核心控制器
|
||||
@ -24,6 +26,7 @@ export class MainApp {
|
||||
appModel: AppModel;
|
||||
appLight: AppLight;
|
||||
appEnv: AppEnv;
|
||||
appRay: AppRay;
|
||||
|
||||
|
||||
constructor() {
|
||||
@ -34,6 +37,7 @@ export class MainApp {
|
||||
this.appModel = new AppModel(this);
|
||||
this.appLight = new AppLight(this);
|
||||
this.appEnv = new AppEnv(this);
|
||||
this.appRay = new AppRay(this);
|
||||
|
||||
window.addEventListener("resize", () => this.appEngin.handleResize());
|
||||
}
|
||||
@ -45,10 +49,7 @@ export class MainApp {
|
||||
loadAConfig(config: any): void {
|
||||
AppConfig.container = config.container || 'renderDom';
|
||||
AppConfig.modelUrlList = config.modelUrlList || [];
|
||||
AppConfig.env = config.env
|
||||
AppConfig.success = config.success;
|
||||
AppConfig.error = config.error;
|
||||
|
||||
AppConfig.env = config.env;
|
||||
}
|
||||
|
||||
loadModel(): void {
|
||||
@ -63,9 +64,10 @@ export class MainApp {
|
||||
this.appCamera.Awake();
|
||||
this.appLight.Awake();
|
||||
this.appEnv.Awake();
|
||||
|
||||
this.appRay.Awake()
|
||||
this.appModel.initManagers();
|
||||
this.update();
|
||||
EventBridge.sceneReady({ scene: this.appScene.object });
|
||||
}
|
||||
|
||||
/** 启动渲染循环 */
|
||||
|
||||
Reference in New Issue
Block a user