载入中...
搜索中...
未找到
DeformTrackFile.cpp
浏览该文件的文档.
15 for (unsigned shift = 0; shift < 32; shift += 8) bytes.push_back(static_cast<char>((value >> shift) & 255));
29 for (unsigned i = 0; i < 4; ++i) value |= std::uint32_t(static_cast<unsigned char>(data[i])) << (i * 8);
84 Diagnostic::error(DiagnosticCode::HashMismatch, "deformation asset checksum mismatch", "deformTrack"));
89 const auto arity = reader.word(), vertices = reader.word(), indices = reader.word(), uvCount = reader.word();
91 if ((arity != 2 && arity != 3) || !vertices || vertices > 1048576 || !indices || indices > 6291456 ||
96 36ull + recipeSize + 4ull * indices + 8ull * uvCount + std::uint64_t(frames) * (4 + 12ull * vertices);
107 auto topology = DeformTopology::prepare(arity == 2 ? DeformPrimitive::Segments : DeformPrimitive::Triangles,
124Result<DeformTrack> DeformTrack::loadForRecipe(std::string_view path, const BakeRecipe& expected) {
133 Diagnostic::error(DiagnosticCode::HashMismatch, "deformation asset provenance mismatch", "deformTrack"));
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
Bounded provenance builder for explicit-coordinate baked recordings. @ownership Owns names and conten...
Definition BakeRecipe.h:21
Result< std::string > encode() const
Encode complete provenance canonically, sorting dependency and RNG names. @cost Linear in bounded met...
Definition BakeRecipe.cpp:104
static Result< BakeRecipe > decode(std::string_view bytes)
Parse a bounded canonical recipe record, rejecting duplicate names and trailing bytes....
Definition BakeRecipe.cpp:129
static Result< DeformTopology > prepare(DeformPrimitive primitive, std::size_t vertexCount, std::vector< std::uint32_t > indices, std::vector< DeformUV > uv)
Validate bounded connectivity and freeze it with a deterministic content identity.
Definition DeformTopology.cpp:16
std::span< const DeformUV > uv() const noexcept
Borrow immutable UVs; empty means no UV channel.
Definition DeformTopology.cpp:60
DeformPrimitive primitive() const noexcept
Primitive interpretation of the index stream.
Definition DeformTopology.cpp:57
std::size_t vertexCount() const noexcept
Number of stable vertex slots.
Definition DeformTopology.cpp:58
std::span< const std::uint32_t > indices() const noexcept
Borrow immutable ordered connectivity, bounded by this shared storage lifetime.
Definition DeformTopology.cpp:59
std::shared_ptr< const BakeRecipe > recipe() const noexcept
Return shared immutable provenance including explicit coordinates.
Definition DeformTrack.cpp:75
DeformTopology topology() const
Return a cheap owning copy of the fixed connectivity and UVs.
Definition DeformTrack.cpp:74
static Result< DeformTrack > loadForRecipe(std::string_view path, const BakeRecipe &expected)
Load and compare complete canonical expected provenance before cache admission. @cost Linear in asset...
Definition DeformTrackFile.cpp:124
static Result< DeformTrack > prepare(std::vector< DeformFrame > frames, const BakeRecipe &recipe)
Validate matching topology, positions, coordinates and fixed sample grid, then freeze all frames.
Definition DeformTrack.cpp:35
static Result< DeformTrack > load(std::string_view path)
Load bounded EVEDEFM1 v1 and validate all data before publishing a clip. @cost Linear in asset size p...
Definition DeformTrackFile.cpp:61
Result< void > save(std::string_view path) const
Publish EVEDEFM1 v1 with topology, provenance, frames and whole-file checksum; never overwrite....
Definition DeformTrackFile.cpp:35
@ Triangles
@ Segments
std::string bakedAssetContentKey(std::string_view source)
Stable noncryptographic 128-bit content digest, encoded as 32 lowercase hexadecimal bytes....
Definition BakedAssetFile.cpp:14
Result< void > publishBakedAsset(std::string_view path, std::string_view bytes)
Publish complete baked asset bytes atomically without replacing an existing path. @ownership Borrows ...
Definition BakedAssetFile.cpp:64
@ HashMismatch
@ NotFound
@ SerializationError
@ Failed
Owning snapshot with actual connectivity, stable indexed positions and explicit sample time.
Definition DeformTrack.h:15