载入中...
搜索中...
未找到
TerrainMeshStamp.cpp
浏览该文件的文档.
19 if (positions.empty() || positions.size() % 3 != 0 || positions.size() > maximumElements || indices.empty() ||
22 !std::all_of(indices.begin(), indices.end(), [&](std::uint32_t i) { return i < positions.size() / 3; }))
23 return invalid("terrain.meshStamp: finite triangle positions and in-range indices required (1M limit)");
31Result<int> TerrainMeshStampBuilder::bake(Heightmap& heights, Heightmap& coverage, double minX, double minZ,
33 if (&heights == &coverage || !validRaster(heights) || !validRaster(coverage) || heights.getWidth() < 2 ||
35 heights.getHeight() != coverage.getHeight() || heights.data().size() > 4U * 1024U * 1024U || indices_.empty() ||
36 !std::isfinite(minX) || !std::isfinite(minZ) || !std::isfinite(width) || !std::isfinite(depth) ||
37 !std::isfinite(feather) || width <= 0 || depth <= 0 || feather < 0 || !std::isfinite(minX + width) ||
39 return invalid("terrain.meshStamp: source and distinct matching finite rasters/bake bounds required");
69 const int x0 = static_cast<int>(std::clamp(std::floor((left - minX) / dx) - 1, 0.0, double(columns - 1)));
70 const int x1 = static_cast<int>(std::clamp(std::ceil((right - minX) / dx) + 1, 0.0, double(columns - 1)));
71 const int z0 = static_cast<int>(std::clamp(std::floor((bottom - minZ) / dz) - 1, 0.0, double(rows - 1)));
72 const int z1 = static_cast<int>(std::clamp(std::ceil((top - minZ) / dz) + 1, 0.0, double(rows - 1)));
80 const double ax = positions_[a], az = positions_[a + 2], bx = positions_[b], bz = positions_[b + 2],
In-memory terrain heightmap: a dense float grid (row-major, index = y * width + x) materialized from ...
Definition Heightmap.h:21
CPU triangle mesh from procedural mesh recipes (e.g. marching cubes). Positions/normals are xyz-packe...
Definition MeshBuild.h:20
Result< int > setSource(const MeshBuild &mesh)
Validate and copy a CPU triangle mesh; failure preserves the prior source.
Definition TerrainMeshStamp.cpp:15
Result< int > bake(Heightmap &heights, Heightmap &coverage, double minX, double minZ, double width, double depth, double feather) const
Bake the highest surface into two preallocated matching rasters, atomically.
Definition TerrainMeshStamp.cpp:31
Definition EvpackPointGraphLoader.h:12