载入中...
搜索中...
未找到
AnimCurveLibrary.cpp
浏览该文件的文档.
29 for (unsigned i = 0; i < 4; ++i) result |= std::to_integer<std::uint32_t>(bytes[offset++]) << (8 * i);
57 return eve::Diagnostic::error(eve::DiagnosticCode::InvalidArgument, std::move(message), "animationCurves", {},
110bool AnimCurveLibrary::contains(std::string_view source) const { return impl_->clips.contains(source); }
112eve::Result<std::optional<float>> AnimCurveLibrary::sample(std::string_view source, std::string_view channel,
118 return Result::failure(eve::Diagnostic::error(eve::DiagnosticCode::NotFound, "animation curve source not found",
std::map< std::string, std::vector< Key >, std::less<> > channels
Definition AnimCurveLibrary.cpp:21
Strict allocation-free UTF-8 validation.
A structured explanation of a failed, degraded, or noteworthy result.
Definition Diagnostic.h:94
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 success(StatusCode code=StatusCode::Ok)
Construct a successful status with an explicit non-error outcome.
Definition Status.cpp:19
AnimCurveLibrary()
Construct an empty library with independent lifetime.
Definition AnimCurveLibrary.cpp:64
eve::Result< std::optional< float > > sample(std::string_view source, std::string_view channel, double seconds, bool loop) const
Evaluate one scalar channel with linear interpolation.
Definition AnimCurveLibrary.cpp:112
std::size_t size() const noexcept
Return the number of source records currently owned.
Definition AnimCurveLibrary.cpp:111
bool contains(std::string_view source) const
Query whether a source record exists, including records without channels.
Definition AnimCurveLibrary.cpp:110
eve::Result< void > load(std::span< const std::byte > bytes)
Atomically replace data from little-endian eve.animation-curves/1 bytes.
Definition AnimCurveLibrary.cpp:66
~AnimCurveLibrary()
Destroy owned curve data without accessing external objects.
Definition Animation.cpp:58
Status invalid(const char *message)
Definition OceanBindingInternal.h:21
@ InvalidArgument
@ NotFound
@ Applied
bool isValidUtf8(std::string_view text, Utf8NullPolicy nullPolicy) noexcept
Validate shortest-form UTF-8, Unicode scalar range and optional NUL exclusion.
Definition Utf8Validation.cpp:5
@ Reject
Definition Container.h:602
std::map< std::string, Clip, std::less<> > clips
Definition AnimCurveLibrary.cpp:62