修复编辑器相机与 game 形态黑屏;中文字体与 Q 选择热键

FPS 式视角合成(yaw 世界轴/pitch 本地轴,永不 roll);
RMB 自由视角后环绕 pivot 失效待重建(修 Focus 后 MMB/滚轮
瞬移锁回);SceneRenderer 默认 kDisplayDirect(game 形态
Blit 空转+清屏黑屏根因);swapchain 优先 Opaque 合成;
ImGui 加载思源黑体(CJK 常用集);Q=纯选择不出杆;
新增 InputMap 动作映射
This commit is contained in:
2026-10-08 17:02:39 +08:00
parent 36b1fc0566
commit 26e222a9cf
15 changed files with 730 additions and 50 deletions
+11 -8
View File
@@ -220,12 +220,12 @@ std::optional<entt::entity> ViewportPanel::Draw(const EditorContext &ctx,
}
}
// ---- 工具热键(UE 语义):W/E/R 切 Gizmo 模式、T 切
// local/world、F 焦点选中实体。仅 Viewport 持焦时生效——
// 输入框打字(WantTextInput)由 BlockingKeyboard 拦游戏侧,
// 但 ImGui 自身仍收键,故必须限定持焦面板。RMB 按住 = 相机
// 飞行模式(键盘归相机),工具热键全部抑制——W 前进与
// W 平移 Gizmo 的键位冲突就此解耦 ----
// ---- 工具热键(UE 语义):Q 纯选择(不出杆)、W/E/R 切
// Gizmo 模式、T 切 local/world、F 焦点选中实体。仅 Viewport
// 持焦时生效——输入框打字(WantTextInput)由 BlockingKeyboard
// 拦游戏侧,但 ImGui 自身仍收键,故必须限定持焦面板。RMB 按
// 住 = 相机飞行模式(键盘归相机),工具热键全部抑制——W 前
// 进与 W 平移 Gizmo 的键位冲突就此解耦 ----
auto &reg = ctx.scene->GetRegistry();
ECS::TransformComponent *tr =
selected != entt::null
@@ -236,6 +236,9 @@ std::optional<entt::entity> ViewportPanel::Draw(const EditorContext &ctx,
const bool playing = ctx.playState && *ctx.playState;
if (!playing && out.focused && !ImGui::GetIO().WantTextInput &&
!ImGui::IsMouseDown(ImGuiMouseButton_Right)) {
// Q = 纯选择模式(UE Q 工具语义):op=0 无任何轴位,
// ImGuizmo 不绘制不响应——选中实体只高亮不出杆
if (ImGui::IsKeyPressed(ImGuiKey_Q)) gizmo.op = 0;
if (ImGui::IsKeyPressed(ImGuiKey_W)) gizmo.op = ImGuizmo::TRANSLATE;
if (ImGui::IsKeyPressed(ImGuiKey_E)) gizmo.op = ImGuizmo::ROTATE;
if (ImGui::IsKeyPressed(ImGuiKey_R)) gizmo.op = ImGuizmo::SCALE;
@@ -370,8 +373,8 @@ std::optional<entt::entity> ViewportPanel::Draw(const EditorContext &ctx,
: "PLAYING - Ctrl+P to stop");
} else {
std::snprintf(tip, sizeof(tip),
"Space: %s [T] Snap: Ctrl F: Focus "
"Ctrl+Shift+F: To Selection",
"Q/W/E/R: Sel/Move/Rot/Scale T: %s "
"Snap: Ctrl F: Focus",
gizmo.localSpace ? "Local" : "World");
}
const ImVec2 imgMin = ImGui::GetItemRectMin();