载入中...
搜索中...
未找到
SceneInspect.hpp
浏览该文件的文档.
1#pragma once
2
3#include "common/Export.h"
4
5#include <glm/glm.hpp>
6
7#include <string>
8#include <vector>
9
10namespace eve {
11class IRenderCapture;
12class ISceneQuery;
13} // namespace eve
14
15namespace eve::dev {
16
29 std::string name; // "along_road" | "bird_eye" | "corner_close" | "vista"
30 std::string kind; // 中文说明:沿路平视 / 高空俯拍 / 拐角特写 / 远景视角
31 glm::vec3 eye{0.f};
32 glm::vec3 target{0.f};
33 float fovYDeg = 60.f;
34};
35
38 bool ok = false;
39 std::string error;
40 std::string pngPath; // 渲染帧 PNG 的磁盘路径(color buffer)
41 std::string jsonPath; // 配套三维几何快照 JSON 的磁盘路径
42 int width = 0;
43 int height = 0;
44 int entityCount = 0;
45 // 可选附加缓冲区(按需生成)。
46 std::string depthPngPath; // depth buffer PNG(GBuffer 线性深度)
47 std::string normalPngPath; // normal buffer PNG(GBuffer 世界法线)
48 std::string idPngPath; // 渲染 ID mask PNG(逐像素实体 ID 颜色)
49 std::string idJsonPath; // 渲染 ID mask 的 id→实体 映射 JSON
50 std::vector<std::string> unsupported; // 请求但当前后端不支持的缓冲区
51};
52
54public:
55 static SceneInspect& instance();
56
57 SceneInspect(const SceneInspect&) = delete;
59
60 // ---------- 多机位自动采样 ----------
69 static std::vector<InspectView> generateViews(const glm::vec3& center, float fov = 60.f);
70
71 // ---------- 相机位姿 ----------
77 bool setCameraPose(const glm::vec3& eye, const glm::vec3& rotYawPitch, float fov = 0.f);
78 bool setCameraView(const InspectView& v);
79
80 // ---------- 原子快照(渲染帧 + 几何 JSON) ----------
88 InspectCapture capture(const std::string& outDir = {}, const std::string& tag = "frame",
89 const std::vector<std::string>& buffers = {});
90
91 // ---------- 可见实体三维几何快照 ----------
98 std::string visibleEntitiesJson(const glm::vec3* eye = nullptr,
99 const glm::vec3* target = nullptr, float fov = 0.f);
101 std::string currentPoseJson();
102
103 // ---------- 快照持久化 / 临时缓存 ----------
104 void setCacheDir(std::string dir) { cacheDir_ = std::move(dir); }
105 const std::string& cacheDir() const { return cacheDir_; }
107 std::string defaultCacheDir() const;
109 const std::string& lastPngPath() const { return lastPngPath_; }
110 const std::string& lastJsonPath() const { return lastJsonPath_; }
111
112private:
113 SceneInspect() = default;
114
115 eve::IRenderCapture* captureIface();
116 eve::ISceneQuery* scene();
117 bool ensureCamera();
118
119 std::string cacheDir_;
120 std::string lastPngPath_;
121 std::string lastJsonPath_;
122};
123
124} // namespace eve::dev
#define EVENGINE_API
宿主(eve / libmain)导出宏;插件从进程导入同一批符号。
Definition Export.h:16
float height
Definition Grass.cpp:235
int width
glm::vec3 eye
int v
V3 dir
Definition TreeMesh.cpp:121
Frame capture + camera + visible-entity inspection (graphics).
Scene graph query/mutation surface (provided by the scene module).
Definition SceneQuery.h:30
SceneInspect(const SceneInspect &)=delete
const std::string & lastPngPath() const
最近一次快照的 PNG / JSON 路径(供后续读取)。
SceneInspect & operator=(const SceneInspect &)=delete
const std::string & cacheDir() const
void setCacheDir(std::string dir)
const std::string & lastJsonPath() const
Definition Build.cpp:11
一次原子快照的结果:PNG 渲染帧 + 配套几何 JSON。
std::vector< std::string > unsupported
场景巡检工具集(MCP 底层数据底座)。