载入中...
搜索中...
未找到
TerrainDetailCard.cpp
浏览该文件的文档.
8void appendQuad(TerrainDetailCardGeometry& geometry, float xx, float xz, float normalX, float normalZ) {
10 geometry.positions.insert(geometry.positions.end(), {-0.5f * xx, 0.f, -0.5f * xz, 0.5f * xx, 0.f, 0.5f * xz,
12 for (int vertex = 0; vertex < 4; ++vertex) geometry.normals.insert(geometry.normals.end(), {normalX, 0.f, normalZ});
14 geometry.indices.insert(geometry.indices.end(), {base, base + 2, base + 1, base, base + 3, base + 2});
19Result<TerrainDetailCardGeometry> buildTerrainDetailCard(const RuntimeInstancePrototype& prototype) {
22 Diagnostic::error(DiagnosticCode::InvalidArgument, "terrain Detail prototype identity is empty", {}, {},
26 Diagnostic::error(DiagnosticCode::Unsupported, "mesh-backed terrain Detail requires its authored mesh",
42 Diagnostic::error(DiagnosticCode::Unsupported, "terrain Detail render mode has no card representation",
48 Diagnostic::error(DiagnosticCode::Failed, "terrain Detail card allocation failed", prototype.prototype, {},
Canonical card geometry for texture-backed Unity terrain details.
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
Result< TerrainDetailCardGeometry > buildTerrainDetailCard(const RuntimeInstancePrototype &prototype)
Build bottom-anchored unit cards for a texture-backed terrain Detail prototype.
Definition TerrainDetailCard.cpp:19
@ InvalidArgument
@ Unsupported
@ Failed
Runtime vegetation prototype metadata retained from the source terrain.
Definition EvpackInstanceSetLoader.h:24
std::string prototype
Definition EvpackInstanceSetLoader.h:25
std::string renderMode
Definition EvpackInstanceSetLoader.h:26
bool usePrototypeMesh
Definition EvpackInstanceSetLoader.h:27
Owning unit geometry whose instance transform supplies Unity's exact width and height.
Definition TerrainDetailCard.h:13
bool cameraFacing
Definition TerrainDetailCard.h:18