载入中...
搜索中...
未找到
EditorMaterialPreview.h
浏览该文件的文档.
1#pragma once
2
4
5#include <string>
6#include <unordered_map>
7#include <vector>
8
9namespace eve::editor {
10
13 std::string geometry = "sphere";
14 std::string customMeshAsset;
15 std::string environmentAsset;
16 int width = 512;
17 int height = 512;
18 double yawDegrees = 25.0;
19 double pitchDegrees = -15.0;
20 double distance = 3.0;
21};
22
31
34 EditorStatus status = EditorStatus::Failed;
35 std::string artifact;
36 std::vector<EditorDiagnostic> diagnostics;
37};
38
47
50public:
52 Result<TaskId> render(const DocumentId& document, const MaterialDocumentTarget& material,
55 Result<MaterialPreviewRenderResult> result(const TaskId& task) const;
57 Result<void> publish(const DocumentId& document, Revision currentRevision, const TaskId& task);
59 std::string publishedArtifact(const DocumentId& document) const;
60
61private:
62 struct Task {
63 DocumentId document;
66 };
67 std::unordered_map<TaskId, Task, StrongEditorIdHash<TaskId>> tasks_;
68 std::unordered_map<DocumentId, std::string, StrongEditorIdHash<DocumentId>> published_;
69 std::uint64_t sequence_ = 0;
70};
71
72} // namespace eve::editor
#define EVENGINE_API_EDITORS
Definition Export.h:112
const GltfImportRequest & request
std::uint64_t revision
Material * material
TerrainThermalSettings settings
Move-only operation result carrying either a value or Status.
Definition Result.h:155
UUID-backed identifier adapter for legacy textual boundaries.
Definition Identity.h:314
Deterministic owning value tree shared by authoring hosts.
Host boundary that owns creation and teardown of an isolated preview scene.
virtual ~IMaterialPreviewRenderer()=default
Releases IMaterialPreviewRenderer resources.
virtual MaterialPreviewRenderResult render(const MaterialPreviewRenderRequest &request)=0
Render one immutable request without reading or mutating the live game scene.
Revision-safe material preview request and publication service.
UI-neutral, serializable material authoring target.
eve::editing::Revision Revision
StatusCode
Stable outcome category for an operation.
Definition Status.h:27
Immutable request passed to a renderer-owned isolated preview scene.
Renderer output referenced by a stable artifact rather than GPU pointers.
std::vector< EditorDiagnostic > diagnostics
Camera, mesh and environment settings for an isolated material preview.