添加鼠标点击实体事件,添加spirv着色器系统

This commit is contained in:
2025-06-09 13:19:14 +08:00
parent de75ee9481
commit f4aa895bbb
24 changed files with 664 additions and 54 deletions

View File

@ -63,7 +63,7 @@ namespace Hazel
}
// update camera
if (m_ViewportFocused && m_ViewportHovered)
if (m_ViewportFocused)
{
m_CameraController.OnUpdate(ts);
m_EditorCamera.OnUpdate(ts);
@ -284,10 +284,9 @@ namespace Hazel
snapValue = 0.25f;
float snapValues[3] = {snapValue, snapValue, snapValue};
if (ImGuizmo::Manipulate(glm::value_ptr(cameraView), glm::value_ptr(cameraProjection),
ImGuizmo::OPERATION(m_GizmoType), ImGuizmo::LOCAL,
glm::value_ptr(transform), nullptr, snap ? snapValues : nullptr))
glm::value_ptr(transform), nullptr, snap ? snapValues : nullptr) && !Input::IsKeyPressed(SDL_SCANCODE_LALT))
{
if (ImGuizmo::IsUsing())
{
@ -352,11 +351,13 @@ namespace Hazel
void EditorLayer::OnEvent(SDL_Event& e)
{
if (m_ViewportFocused && m_ViewportHovered)
if (m_ViewportFocused)
{
m_CameraController.OnEvent(e);
m_EditorCamera.OnEvent(e);
}
if (e.button.clicks && m_ViewportHovered && !ImGuizmo::IsOver() && Input::IsMouseButtonPressed(SDL_BUTTON_LEFT) && !Input::IsKeyPressed(SDL_SCANCODE_LALT))
m_SceneHierachyPanel.SetSelectedEntity(m_HoveredEntity);
#define SHORTCUT_NEW (SDL_KMOD_CTRL | SDLK_N)
#define SHORTCUT_OPEN (SDL_KMOD_CTRL | SDLK_O)