载入中...
搜索中...
未找到
SdfField3D.cpp
浏览该文件的文档.
11 return Status::failure(Diagnostic::error(DiagnosticCode::InvalidArgument, message, "eve.sdf.field3d"));
20 if (blob.width < 2 || blob.height < 2 || blob.depth < 2 || blob.width > 512 || blob.height > 512 ||
24 !finiteScalar(blob.originY) || !finiteScalar(blob.originZ) || !finiteScalar(blob.outsideDistance))
25 return Result<void>::failure(invalidBlob("SDF grid metadata must be finite with positive cellSize"));
57 for (const char* key : {"schemaId", "schemaVersion", "kind", "width", "height", "depth", "cellSize", "origin",
74 if (!schema || *schema != SdfField3DBlob::schemaId || !version || *version != SdfField3DBlob::schemaVersion ||
76 return Result<SdfField3DBlob>::failure(invalidBlob("SDF blob schema or dimensions are invalid"));
Stable, structured diagnostics shared by engine modules.
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.cpp:21
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:196
static Status failure(StatusCode code, Diagnostic diagnostic)
Construct a failed status with one diagnostic.
Definition Status.cpp:28
@ InvalidArgument
SdfField3DSampleKind
Dense regular-grid sample layout used by the shared SDF interchange blob.
Definition SdfField3D.h:24
@ VertexGrid
Result< Value > encodeSdfField3DBlob(const SdfField3DBlob &blob)
Encode a validated SDF blob to a Value object. @cost Copies the distance sample buffer into the Value...
Definition SdfField3D.cpp:35
Result< void > validateSdfField3DBlob(const SdfField3DBlob &blob)
Validate dimensions, finiteness and sample count without encoding.
Definition SdfField3D.cpp:17
Result< SdfField3DBlob > decodeSdfField3DBlob(const Value &value)
Decode a Value object into an owning SDF blob. @cost Allocates and copies the distance sample buffer ...
Definition SdfField3D.cpp:54
Portable dense SDF asset blob (schema id + version + samples).
Definition SdfField3D.h:89