Files
HelloVulkan/App/editor/EditorContext.h
T
atdunbg 26e222a9cf 修复编辑器相机与 game 形态黑屏;中文字体与 Q 选择热键
FPS 式视角合成(yaw 世界轴/pitch 本地轴,永不 roll);
RMB 自由视角后环绕 pivot 失效待重建(修 Focus 后 MMB/滚轮
瞬移锁回);SceneRenderer 默认 kDisplayDirect(game 形态
Blit 空转+清屏黑屏根因);swapchain 优先 Opaque 合成;
ImGui 加载思源黑体(CJK 常用集);Q=纯选择不出杆;
新增 InputMap 动作映射
2026-10-08 17:02:39 +08:00

52 lines
2.3 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
//
// EditorContext:Editor 层与 SandboxApp 之间的桥接上下文。
//
// Editor 是 App 层代码(不属于引擎),它需要的引擎门面与沙盒能力
// 全部经此聚合注入——面板只认识 EditorContext,不反向依赖 main.cpp。
//
#ifndef HELLOVULKAN_EDITORCONTEXT_H
#define HELLOVULKAN_EDITORCONTEXT_H
#include <Engine/Core/Application.h>
#include <Engine/Core/GameFlow.h>
#include <Engine/ECS/Scene.h>
#include <Engine/Assets/AssetManager.h>
#include <Engine/Renderer/Renderer.h>
#include <Engine/Renderer/EditorCamera.h>
#include <Engine/Renderer/SceneTypes.h> // kDisplayViewport / kDisplayDirect
#include <entt/entt.hpp>
class MaterialEditorPanel; // 面板间联动通道(Details 双击槽位 / Content
// Browser 双击 .material → 打开材质编辑器)
class ControllerEditorPanel; // Details Controller 槽 Edit → 打开控制器编辑器
// 沙盒特有状态(面板可选读取,空指针 = 该面板区块不显示)
struct EditorContext {
// 引擎门面
Engine::Renderer *renderer = nullptr;
Engine::ECS::Scene *scene = nullptr;
Engine::Assets::AssetManager *assets = nullptr;
Engine::Application *app = nullptr;
// 游戏流状态机(PIE 状态权威;Editor::Init 注册快照/恢复监听)
Engine::GameFlow *flow = nullptr;
// 编辑器相机(Scene view 专用,归 Renderer 持有——与场景相机实体
// 无关;面板经此做 F 焦点/Gizmo 视图/对齐跳转)
Engine::EditorCamera *editorCamera = nullptr;
// 材质编辑器面板(Editor 持有;指派/编辑分离的联动入口)
MaterialEditorPanel *materialEditor = nullptr;
// 控制器编辑器面板(Editor 持有;指派/编辑分离的联动入口)
ControllerEditorPanel *controllerEditor = nullptr;
// 当前选中实体(Controller 编辑器 Preview 的驱动目标)
entt::entity *selected = nullptr;
// PIE 运行态(Play-In-Editor):Editor 持有,只读指针。
// 面板门控用——运行态禁 Gizmo/编辑器热键,渲染源已是 primary 相机
const bool *playState = nullptr;
// PIE 暂停态(timeScale=0):Editor 持有,只读指针(视口 PAUSED 提示)
const bool *pausedState = nullptr;
};
#endif //HELLOVULKAN_EDITORCONTEXT_H