|
|
|
@ -1,8 +1,10 @@
|
|
|
|
|
|
|
|
|
|
import { AbstractMesh, Material, Mesh, PBRMaterial, Texture } from "@babylonjs/core"; |
|
|
|
|
import { AbstractMesh, Material, Mesh, PBRMaterial, Texture, Animatable } from "@babylonjs/core"; |
|
|
|
|
import { PlanComponent } from "src/app/pages/plan/plan.component"; |
|
|
|
|
import { ConfigManager } from "../../controller/config-manager"; |
|
|
|
|
import { DataManager } from "../../controller/data-manager"; |
|
|
|
|
import { EventManager } from "../../controller/event-manager/event-manager"; |
|
|
|
|
import { Event_LoadingChange } from "../../controller/event-manager/events/event-loading-change"; |
|
|
|
|
import { InfoManager } from "../../controller/info-manager"; |
|
|
|
|
import { ModeManager, ModeType } from "../../controller/mode-manager"; |
|
|
|
|
import { SceneManager } from "../../controller/scene-manager"; |
|
|
|
@ -23,6 +25,7 @@ import { ModelInfo_building } from "../../model/info/model/model-info-building";
|
|
|
|
|
import { FacilityInfoByType, ModelInfo_facility } from "../../model/info/model/model-info-facility"; |
|
|
|
|
import { BabylonTool } from "../../tool/babylon-tool"; |
|
|
|
|
import { GizmoTool } from "../../tool/gizmo-tool"; |
|
|
|
|
import { LoadTool } from "../../tool/load-tool"; |
|
|
|
|
import { TsTool } from "../../tool/ts-tool"; |
|
|
|
|
import { FacilityInfoInSceneWindow } from "../facilityinfoinscene-window/facilityinfoinscene-window"; |
|
|
|
|
import { MarkWindow } from "../mark-window/mark-window"; |
|
|
|
@ -49,6 +52,7 @@ export class BuildingWindow extends UIBase {
|
|
|
|
|
three: PlanComponent;//前端组件
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cameraAnim: Animatable;//相机动画
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//#region 与前端对接部分
|
|
|
|
@ -283,12 +287,15 @@ export class BuildingWindow extends UIBase {
|
|
|
|
|
* @param cameraData
|
|
|
|
|
* @param showZP
|
|
|
|
|
*/ |
|
|
|
|
revoverCamera(cameraData: ArcRotateCameraData, showZP: boolean) { |
|
|
|
|
revoverCamera(cameraData: ArcRotateCameraData, showZP: boolean, onAnimationEnd?: () => void) { |
|
|
|
|
this.showZP(showZP); |
|
|
|
|
PlanComponent.instance.isOpenAwning = showZP; |
|
|
|
|
let camera = SceneManager.Instance.defaultCamera; |
|
|
|
|
if (cameraData != null) { |
|
|
|
|
BabylonTool.AnimMoveCameraTargetAB(camera, 60, cameraData.target, cameraData.radius, cameraData.alpha, cameraData.beta); |
|
|
|
|
this.cameraAnim = BabylonTool.AnimMoveCameraTargetAB(camera, 60, cameraData.target, cameraData.radius, cameraData.alpha, cameraData.beta, onAnimationEnd); |
|
|
|
|
if (Event_LoadingChange.isLoading) { |
|
|
|
|
this.cameraAnim.pause(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -314,6 +321,10 @@ export class BuildingWindow extends UIBase {
|
|
|
|
|
SceneManager.Instance.scene.onBeforeRenderObservable.add(() => { |
|
|
|
|
instance.onUpdate(); |
|
|
|
|
}) |
|
|
|
|
EventManager.addListener<Event_LoadingChange>(Event_LoadingChange, (eventInfo) => { |
|
|
|
|
instance.onChangeLoading(eventInfo); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
onShow() { |
|
|
|
@ -331,6 +342,25 @@ export class BuildingWindow extends UIBase {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* loading状态改变时 |
|
|
|
|
* @param eventInfo
|
|
|
|
|
*/ |
|
|
|
|
onChangeLoading(eventInfo: Event_LoadingChange) { |
|
|
|
|
if (eventInfo.showLoading) { |
|
|
|
|
if (this.cameraAnim != null) { |
|
|
|
|
this.cameraAnim.pause(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
if (this.cameraAnim != null) { |
|
|
|
|
this.cameraAnim.restart(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|