65 lines
1.8 KiB
C++
65 lines
1.8 KiB
C++
#pragma once
|
|
|
|
#include "Features/Scene/LegacySceneViewportGizmo.h"
|
|
#include "Features/Scene/SceneViewportToolOverlay.h"
|
|
|
|
#include <XCEditor/Workspace/UIEditorWorkspaceCompose.h>
|
|
|
|
#include <XCEngine/UI/DrawData.h>
|
|
#include <XCEngine/UI/Types.h>
|
|
|
|
#include <chrono>
|
|
#include <filesystem>
|
|
|
|
namespace XCEngine::UI::Editor::App {
|
|
|
|
class EditorSceneRuntime;
|
|
class ViewportHostService;
|
|
|
|
} // namespace XCEngine::UI::Editor::App
|
|
|
|
namespace XCEngine::UI::Editor::Host {
|
|
|
|
class TextureHost;
|
|
|
|
} // namespace XCEngine::UI::Editor::Host
|
|
|
|
namespace XCEngine::UI::Editor::App {
|
|
|
|
class SceneViewportController {
|
|
public:
|
|
void Initialize(
|
|
const std::filesystem::path& repoRoot,
|
|
Host::TextureHost& renderer);
|
|
void Shutdown(Host::TextureHost& renderer);
|
|
void ResetInteractionState();
|
|
|
|
void Update(
|
|
EditorSceneRuntime& sceneRuntime,
|
|
ViewportHostService& viewportHostService,
|
|
const UIEditorWorkspaceComposeState& composeState,
|
|
const UIEditorWorkspaceComposeFrame& composeFrame);
|
|
void Append(::XCEngine::UI::UIDrawList& drawList) const;
|
|
|
|
private:
|
|
struct NavigationState {
|
|
bool lookDragging = false;
|
|
bool panDragging = false;
|
|
::XCEngine::UI::UIPointerButton panDragButton =
|
|
::XCEngine::UI::UIPointerButton::None;
|
|
};
|
|
|
|
void ResetFrameState();
|
|
float ConsumeDeltaTimeSeconds();
|
|
|
|
NavigationState m_navigationState = {};
|
|
LegacySceneViewportGizmo m_legacyGizmo = {};
|
|
SceneViewportToolOverlay m_toolOverlay = {};
|
|
std::size_t m_hoveredToolOverlayIndex = kSceneViewportToolOverlayInvalidIndex;
|
|
std::size_t m_activeToolOverlayIndex = kSceneViewportToolOverlayInvalidIndex;
|
|
std::chrono::steady_clock::time_point m_lastUpdateTime = {};
|
|
bool m_hasLastUpdateTime = false;
|
|
};
|
|
|
|
} // namespace XCEngine::UI::Editor::App
|