载入中...
搜索中...
未找到
eve::gpuagents::SurfaceCapture类 参考

Orthographic surface capture that rebuilds height + normals on a SurfaceField. 更多...

#include <SurfaceCapture.h>

静态 Public 成员函数

static Result< void > captureFromTriangles (SurfaceField &out, std::span< const glm::vec3 > positions, std::span< const std::uint32_t > indices, const glm::vec3 &originMin, float worldSize, int resolution, float baseHeight=0.f)
 Bake triangle positions into out over the given XZ domain.
 
static void rebuildNormals (SurfaceField &field)
 Rebuild normals from the current height grid (central differences).
 

详细描述

Orthographic surface capture that rebuilds height + normals on a SurfaceField.

P2 CPU path: project triangle meshes into an XZ heightfield (max height wins), then rebuild normals from central differences. Graphics depth-texture capture is a follow-up that writes the same SurfaceField layout.

在文件 SurfaceCapture.h 第 22 行定义.

成员函数说明

◆ captureFromTriangles()

Result< void > eve::gpuagents::SurfaceCapture::captureFromTriangles ( SurfaceField &  out,
std::span< const glm::vec3 >  positions,
std::span< const std::uint32_t >  indices,
const glm::vec3 &  originMin,
float  worldSize,
int  resolution,
float  baseHeight = 0.f 
)
static

Bake triangle positions into out over the given XZ domain.

参数
outDestination surface (reinitialized).
positionsVertex positions (world space).
indicesTriangle indices (3 per face).
originMinWorld-space corner of texel (0,0).
worldSizeSide length of the square domain on XZ.
resolutionTexel resolution (>= 2).
baseHeightHeight written where no triangle covers a texel. @ownership Borrowed spans; not retained. @lifetime Input spans valid only for the duration of the call.

在文件 SurfaceCapture.cpp 第 56 行定义.

引用了 a, b, c, cell, eve::Diagnostic::error(), eve::Result< T >::failure(), h, eve::gpuagents::SurfaceField::height, idx, indices, eve::gpuagents::SurfaceField::initFlat(), eve::InvalidArgument, p, positions, rebuildNormals(), eve::Result< T >::success(), t, x , 以及 z.

被这些函数引用 eve::gpuagents::GpuAgents::captureSurface().

◆ rebuildNormals()

void eve::gpuagents::SurfaceCapture::rebuildNormals ( SurfaceField &  field)
static

Rebuild normals from the current height grid (central differences).

参数
fieldSurface whose height samples are already populated.

在文件 SurfaceCapture.cpp 第 28 行定义.

引用了 cell, dx, dz, n, x , 以及 z.

被这些函数引用 captureFromTriangles().


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