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()
|
static |
Bake triangle positions into out over the given XZ domain.
- 参数
-
out Destination surface (reinitialized). positions Vertex positions (world space). indices Triangle indices (3 per face). originMin World-space corner of texel (0,0). worldSize Side length of the square domain on XZ. resolution Texel resolution (>= 2). baseHeight Height 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.
◆ rebuildNormals()
|
static |
Rebuild normals from the current height grid (central differences).
- 参数
-
field Surface whose height samples are already populated.
在文件 SurfaceCapture.cpp 第 28 行定义.
引用了 cell, dx, dz, n, x , 以及 z.
被这些函数引用 captureFromTriangles().
该类的文档由以下文件生成:
- src/modules/gpuagents/SurfaceCapture.h
- src/modules/gpuagents/SurfaceCapture.cpp