载入中...
搜索中...
未找到
SurfaceCapture.cpp
浏览该文件的文档.
12bool pointInTriangle2D(const glm::vec2& p, const glm::vec2& a, const glm::vec2& b, const glm::vec2& c, float& w0,
56Result<void> SurfaceCapture::captureFromTriangles(SurfaceField& out, std::span<const glm::vec3> positions,
61 DiagnosticCode::InvalidArgument, "surface capture resolution must be >= 2", "resolution", {}, "gpuagents"));
92 const int x0 = std::clamp(static_cast<int>(std::floor((minX - originMin.x) / cell)), 0, resolution - 1);
93 const int x1 = std::clamp(static_cast<int>(std::ceil((maxX - originMin.x) / cell)), 0, resolution - 1);
94 const int z0 = std::clamp(static_cast<int>(std::floor((minZ - originMin.z) / cell)), 0, resolution - 1);
95 const int z1 = std::clamp(static_cast<int>(std::ceil((maxZ - originMin.z) / cell)), 0, resolution - 1);
EVEngine assertion entry point, backed by zeroerr.
Stable, structured diagnostics shared by engine modules.
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={}, DiagnosticDetails details={}, std::string source={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.h:125
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:175
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.
Definition SurfaceCapture.cpp:56
static void rebuildNormals(SurfaceField &field)
Rebuild normals from the current height grid (central differences).
Definition SurfaceCapture.cpp:28
2.5D surface + life-field textures for Life Network.
Definition SurfaceField.h:16
std::vector< float > height
Height samples, resolution^2, row-major X then Z.
Definition SurfaceField.h:23
void initFlat(const glm::vec3 &originMin, float size, int res, float planeY=0.f)
Allocate grids and fill a flat plane at y = planeY.
Definition SurfaceField.cpp:10
Definition AgentInstanceRenderer.cpp:5
@ InvalidArgument