feat: Editor Gizmo——ImGuizmo 平移/旋转/缩放操纵杆
- ImGuizmo 接入:Lib/ImGuizmo(src/ 布局)静态库,IMGUI_DEFINE_MATH_OPERATORS - ViewportPanel:Vulkan→GL 投影转换(Y 翻回 + 深度 [-1,1])、 SetDrawlist/SetRect 叠加绘制、decompose 写回 TransformComponent - W/E/R 切换(UE 语义);拖拽中 BlockingMouse 门控(输入归 Gizmo) - Dynamic 刚体选中提示:物理每帧写回,编辑被覆盖 - 修复:GizmoState.op 初值 0 无轴位(ImGuizmo::TRANSLATE=7)导致杆不绘制 - 点击拾取门控:抓杆时(IsOver/IsUsing)不发 pick 请求
This commit is contained in:
@@ -65,7 +65,8 @@ void Editor::Draw()
|
||||
if (m_ShowInspector) m_Inspector->Draw(m_Ctx, m_Selected);
|
||||
if (m_ShowViewport)
|
||||
{
|
||||
if (auto picked = m_Viewport->Draw(m_Ctx, m_VpInput)) {
|
||||
if (auto picked = m_Viewport->Draw(m_Ctx, m_VpInput, m_Gizmo,
|
||||
m_Selected)) {
|
||||
SelectEntity(*picked); // Viewport 点击拾取 → 选中联动 Inspector/Hierarchy
|
||||
}
|
||||
}
|
||||
@@ -96,6 +97,9 @@ bool Editor::BlockingKeyboard() const
|
||||
|
||||
bool Editor::BlockingMouse() const
|
||||
{
|
||||
// Gizmo 拖拽中:鼠标归操纵杆,不给游戏侧相机(松手自动恢复)
|
||||
if (m_Gizmo.dragging) return true;
|
||||
|
||||
// 游戏形态:沿用 ImGui 全局判定(UI 隐藏时 WantCaptureMouse=false)
|
||||
if (m_Ctx.renderer &&
|
||||
m_Ctx.renderer->GetDisplayMode() == kDisplayDirect)
|
||||
|
||||
Reference in New Issue
Block a user