#include <SceneInspect.hpp>
Public 成员函数 | |
| SceneInspect (const SceneInspect &)=delete | |
| SceneInspect & | operator= (const SceneInspect &)=delete |
| bool | setCameraPose (const glm::vec3 &eye, const glm::vec3 &rotYawPitch, float fov=0.f) |
| 以 pos + 欧拉角 rot 设置相机位姿。 rot = [yawDeg, pitchDeg](与 firstperson 约定一致,Y-up)。 fov <= 0 时保持当前 FOV。 | |
| bool | setCameraView (const InspectView &v) |
| InspectCapture | capture (const std::string &outDir={}, const std::string &tag="frame", const std::vector< std::string > &buffers={}) |
| 锁定当前相机 → 捕获渲染帧 PNG → 立刻导出配套可见实体几何 JSON。 两者共享同一相机位姿,杜绝图片与实体数据错位。 outDir 为空时使用缓存目录。返回文件路径与图像尺寸。 buffers 可选值:"color"(默认, 帧) | "depth" | "normal" | "id"(渲染 ID mask) | "shadow"(当前后端不支持, 记为 unsupported)。 | |
| std::string | visibleEntitiesJson (const glm::vec3 *eye=nullptr, const glm::vec3 *target=nullptr, float fov=0.f) |
| 生成当前视锥内可见实体的结构化 JSON: { camera, viewport, entities:[ { id, asset, world_aabb:{min,max}, screen_bbox:{x,y,w,h} } ] } 位姿可用 camera 指定,否则回退到当前激活相机。 | |
| std::string | currentPoseJson () |
| 当前激活相机位姿 JSON(eye/target/fov/viewport)。 | |
| void | setCacheDir (std::string dir) |
| const std::string & | cacheDir () const |
| std::string | defaultCacheDir () const |
| 默认缓存目录:<gameRoot>/eve_inspect_cache。 | |
| const std::string & | lastPngPath () const |
| 最近一次快照的 PNG / JSON 路径(供后续读取)。 | |
| const std::string & | lastJsonPath () const |
静态 Public 成员函数 | |
| static SceneInspect & | instance () |
| static std::vector< InspectView > | generateViews (const glm::vec3 ¢er, float fov=60.f) |
| 围绕 center 自动生成一组标准化巡检机位: | |
详细描述
在文件 SceneInspect.hpp 第 53 行定义.
构造及析构函数说明
◆ SceneInspect()
|
delete |
成员函数说明
◆ cacheDir()
|
inline |
在文件 SceneInspect.hpp 第 105 行定义.
被这些函数引用 capture().
◆ capture()
| InspectCapture eve::dev::SceneInspect::capture | ( | const std::string & | outDir = {}, |
| const std::string & | tag = "frame", |
||
| const std::vector< std::string > & | buffers = {} |
||
| ) |
锁定当前相机 → 捕获渲染帧 PNG → 立刻导出配套可见实体几何 JSON。 两者共享同一相机位姿,杜绝图片与实体数据错位。 outDir 为空时使用缓存目录。返回文件路径与图像尺寸。 buffers 可选值:"color"(默认, 帧) | "depth" | "normal" | "id"(渲染 ID mask) | "shadow"(当前后端不支持, 记为 unsupported)。
在文件 SceneInspect.cpp 第 126 行定义.
引用了 b, c, cacheDir(), defaultCacheDir(), eve::dev::InspectCapture::depthPngPath, dir, eve::dev::InspectCapture::entityCount, eve::dev::InspectCapture::error, eve::dev::InspectCapture::height, eve::dev::InspectCapture::idJsonPath, eve::dev::InspectCapture::idPngPath, eve::dev::InspectCapture::jsonPath, eve::dev::InspectCapture::normalPngPath, eve::dev::InspectCapture::ok, ok, eve::dev::InspectCapture::pngPath, pos, eve::dev::InspectCapture::unsupported, visibleEntitiesJson() , 以及 eve::dev::InspectCapture::width.
◆ currentPoseJson()
| std::string eve::dev::SceneInspect::currentPoseJson | ( | ) |
当前激活相机位姿 JSON(eye/target/fov/viewport)。
在文件 SceneInspect.cpp 第 217 行定义.
◆ defaultCacheDir()
| std::string eve::dev::SceneInspect::defaultCacheDir | ( | ) | const |
◆ generateViews()
|
static |
围绕 center 自动生成一组标准化巡检机位:
- along_road 沿路平视:低机位、贴近目标、视线水平略前倾
- bird_eye 高空俯拍:目标正上方垂直俯拍
- corner_close 拐角特写:贴近目标、斜向特写、较窄 FOV
- vista 远景视角:抬高拉远、广角俯览 fov 为基准 FOV(度),各机位在此基础上微调。
在文件 SceneInspect.cpp 第 62 行定义.
引用了 eve::dev::InspectView::name , 以及 v.
◆ instance()
|
static |
在文件 SceneInspect.cpp 第 48 行定义.
◆ lastJsonPath()
|
inline |
在文件 SceneInspect.hpp 第 110 行定义.
◆ lastPngPath()
|
inline |
最近一次快照的 PNG / JSON 路径(供后续读取)。
在文件 SceneInspect.hpp 第 109 行定义.
◆ operator=()
|
delete |
◆ setCacheDir()
|
inline |
在文件 SceneInspect.hpp 第 104 行定义.
引用了 dir.
◆ setCameraPose()
| bool eve::dev::SceneInspect::setCameraPose | ( | const glm::vec3 & | eye, |
| const glm::vec3 & | rotYawPitch, | ||
| float | fov = 0.f |
||
| ) |
以 pos + 欧拉角 rot 设置相机位姿。 rot = [yawDeg, pitchDeg](与 firstperson 约定一致,Y-up)。 fov <= 0 时保持当前 FOV。
在文件 SceneInspect.cpp 第 105 行定义.
引用了 eye.
◆ setCameraView()
| bool eve::dev::SceneInspect::setCameraView | ( | const InspectView & | v | ) |
在文件 SceneInspect.cpp 第 112 行定义.
引用了 v.
◆ visibleEntitiesJson()
| std::string eve::dev::SceneInspect::visibleEntitiesJson | ( | const glm::vec3 * | eye = nullptr, |
| const glm::vec3 * | target = nullptr, |
||
| float | fov = 0.f |
||
| ) |
生成当前视锥内可见实体的结构化 JSON: { camera, viewport, entities:[ { id, asset, world_aabb:{min,max}, screen_bbox:{x,y,w,h} } ] } 位姿可用 camera 指定,否则回退到当前激活相机。
在文件 SceneInspect.cpp 第 222 行定义.
被这些函数引用 capture().
该类的文档由以下文件生成:
- src/engine/devtools/SceneInspect.hpp
- src/engine/devtools/SceneInspect.cpp