载入中...
搜索中...
未找到

#include <SceneInspect.hpp>

Public 成员函数

 SceneInspect (const SceneInspect &)=delete
 
SceneInspectoperator= (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 SceneInspectinstance ()
 
static std::vector< InspectViewgenerateViews (const glm::vec3 &center, float fov=60.f)
 围绕 center 自动生成一组标准化巡检机位:
 

详细描述

在文件 SceneInspect.hpp53 行定义.

构造及析构函数说明

◆ SceneInspect()

eve::dev::SceneInspect::SceneInspect ( const SceneInspect )
delete

成员函数说明

◆ cacheDir()

const std::string & eve::dev::SceneInspect::cacheDir ( ) const
inline

在文件 SceneInspect.hpp105 行定义.

被这些函数引用 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.cpp126 行定义.

引用了 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.cpp217 行定义.

◆ defaultCacheDir()

std::string eve::dev::SceneInspect::defaultCacheDir ( ) const

默认缓存目录:<gameRoot>/eve_inspect_cache。

在文件 SceneInspect.cpp118 行定义.

引用了 c.

被这些函数引用 capture().

◆ generateViews()

std::vector< InspectView > eve::dev::SceneInspect::generateViews ( const glm::vec3 &  center,
float  fov = 60.f 
)
static

围绕 center 自动生成一组标准化巡检机位:

  • along_road 沿路平视:低机位、贴近目标、视线水平略前倾
  • bird_eye 高空俯拍:目标正上方垂直俯拍
  • corner_close 拐角特写:贴近目标、斜向特写、较窄 FOV
  • vista 远景视角:抬高拉远、广角俯览 fov 为基准 FOV(度),各机位在此基础上微调。

在文件 SceneInspect.cpp62 行定义.

引用了 eve::dev::InspectView::name , 以及 v.

◆ instance()

SceneInspect & eve::dev::SceneInspect::instance ( )
static

在文件 SceneInspect.cpp48 行定义.

◆ lastJsonPath()

const std::string & eve::dev::SceneInspect::lastJsonPath ( ) const
inline

在文件 SceneInspect.hpp110 行定义.

◆ lastPngPath()

const std::string & eve::dev::SceneInspect::lastPngPath ( ) const
inline

最近一次快照的 PNG / JSON 路径(供后续读取)。

在文件 SceneInspect.hpp109 行定义.

◆ operator=()

SceneInspect & eve::dev::SceneInspect::operator= ( const SceneInspect )
delete

◆ setCacheDir()

void eve::dev::SceneInspect::setCacheDir ( std::string  dir)
inline

在文件 SceneInspect.hpp104 行定义.

引用了 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.cpp105 行定义.

引用了 eye.

◆ setCameraView()

bool eve::dev::SceneInspect::setCameraView ( const InspectView v)

在文件 SceneInspect.cpp112 行定义.

引用了 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.cpp222 行定义.

引用了 eye , 以及 ok.

被这些函数引用 capture().


该类的文档由以下文件生成: