import { Intent } from '@blueprintjs/core'; import { app } from '../ApplicationServices/Application'; import { Command } from '../Editor/CommandMachine'; import { CameraType } from '../GraphicsSystem/CameraUpdate'; import { AppToaster } from '../UI/Components/Toaster'; export class Command_SwitchCamera implements Command { async exec() { app.Viewer.CameraCtrl.SwitchCamera(); AppToaster.show({ message: `成功切换相机为:${app.Viewer.CameraCtrl.CameraType === CameraType.OrthographicCamera ? "正交相机" : "透视相机"}。 请使用SwitchCamera来切换回原来的相机模式!`, timeout: 10000, intent: Intent.SUCCESS, }, "SwitchCamera"); if (app.Viewer.CameraCtrl.CameraType === CameraType.PerspectiveCamera) AppToaster.show({ message: `透视相机模式下:您可以按住鼠标右键旋转观察角度,按WASD或者↑←↓→来进行移动相机,QE进行升高和下降,按住Shift时可加速移动!`, timeout: 10000, intent: Intent.SUCCESS, }, "SwitchCamera2"); } }