关键节点
This commit is contained in:
49
editor/app/Features/Scene/SceneViewportSceneOverlay.h
Normal file
49
editor/app/Features/Scene/SceneViewportSceneOverlay.h
Normal file
@@ -0,0 +1,49 @@
|
||||
#pragma once
|
||||
|
||||
#include <XCEngine/UI/DrawData.h>
|
||||
#include <XCEngine/UI/Types.h>
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace XCEngine::UI::Editor::App {
|
||||
|
||||
class BuiltInIcons;
|
||||
class EditorSceneRuntime;
|
||||
|
||||
class SceneViewportSceneOverlay {
|
||||
public:
|
||||
struct HitResult {
|
||||
std::uint64_t entityId = 0;
|
||||
float sortDepth = 0.0f;
|
||||
|
||||
bool HasHit() const {
|
||||
return entityId != 0;
|
||||
}
|
||||
};
|
||||
|
||||
void SetBuiltInIcons(const BuiltInIcons* icons);
|
||||
void ResetFrame();
|
||||
void Refresh(
|
||||
EditorSceneRuntime& sceneRuntime,
|
||||
const ::XCEngine::UI::UIRect& viewportRect);
|
||||
HitResult HitTest(const ::XCEngine::UI::UIPoint& point) const;
|
||||
void Append(::XCEngine::UI::UIDrawList& drawList) const;
|
||||
struct IconFrame {
|
||||
std::uint64_t entityId = 0;
|
||||
::XCEngine::UI::UIRect rect = {};
|
||||
::XCEngine::UI::UITextureHandle texture = {};
|
||||
float sortDepth = 0.0f;
|
||||
};
|
||||
|
||||
struct Frame {
|
||||
bool visible = false;
|
||||
::XCEngine::UI::UIRect clipRect = {};
|
||||
std::vector<IconFrame> icons = {};
|
||||
};
|
||||
|
||||
private:
|
||||
const BuiltInIcons* m_icons = nullptr;
|
||||
Frame m_frame = {};
|
||||
};
|
||||
|
||||
} // namespace XCEngine::UI::Editor::App
|
||||
Reference in New Issue
Block a user