载入中...
搜索中...
未找到
RigidPoseTrack.cpp
浏览该文件的文档.
19 (roster.empty() && frame.seconds != 0) || frame.samples.empty() || frame.samples.size() > 16384 ||
44Result<RigidPoseTrack> RigidPoseTrack::prepare(RigidTrackSpace space, std::vector<RigidTrackFrame> frames) {
47Result<RigidPoseTrack> RigidPoseTrack::prepare(RigidTrackSpace space, std::vector<RigidTrackFrame> frames,
50 space == RigidTrackSpace::PlanarPixels ? BakeCoordinates::PlanarPixels : BakeCoordinates::MetresRightHandedYUp;
55 if (frames.size() > 2000000) return Result<RigidPoseTrack>::failure(invalidTrack("frame budget exceeded"));
62std::shared_ptr<const BakeRecipe> RigidPoseTrack::recipe() const noexcept { return data_->recipe; }
63Result<RigidPoseTrack> RigidPoseTrack::prepareValidated(RigidTrackSpace space, std::vector<RigidTrackFrame> frames,
83 RigidPoseTrack(std::make_shared<const Data>(Data{space, std::move(recipe), std::move(frames)})));
86 if (!std::isfinite(seconds)) return Result<RigidTrackPose>::failure(invalidTrack("nonfinite sample time"));
96 if (upper == data_->frames.begin()) return Result<RigidTrackPose>::success(upper->samples[index].pose);
105 const float sign = pose.qx * b.qx + pose.qy * b.qy + pose.qz * b.qz + pose.qw * b.qw < 0 ? -1.f : 1.f;
119std::size_t RigidPoseTrack::trackCount() const noexcept { return data_->frames.front().samples.size(); }
122 if (index >= trackCount()) return Result<PersistentId>::failure(invalidTrack("track index outside roster"));
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< RigidTrackPose > sample(float seconds, PersistentId id) const
Sample a known stable identity at finite seconds, clamping outside the recorded interval.
Definition RigidPoseTrack.cpp:85
RigidTrackSpace space() const noexcept
Coordinate contract of every pose in this track.
Definition RigidPoseTrack.cpp:117
static Result< RigidPoseTrack > prepare(RigidTrackSpace space, std::vector< RigidTrackFrame > frames)
Validate, normalize and freeze a bounded recording with stable sorted track identities....
Definition RigidPoseTrack.cpp:44
Result< PersistentId > trackId(std::size_t index) const
Stable identity at canonical sorted index; returns failure for an out-of-range index.
Definition RigidPoseTrack.cpp:121
std::shared_ptr< const BakeRecipe > recipe() const noexcept
Return shared immutable provenance; empty for explicit assets without verified origins.
Definition RigidPoseTrack.cpp:62
std::size_t trackCount() const noexcept
Number of identities in the frozen roster.
Definition RigidPoseTrack.cpp:119
Result< void > validateRigidFrame(RigidTrackSpace space, RigidTrackFrame &frame, std::span< const RigidTrackSample > roster, float previous)
Definition RigidPoseTrack.cpp:14
RigidTrackSpace
Explicit sample coordinates; planar pixels preserve the producer's XY axes without implicit Y flip.
Definition RigidPoseTrack.h:13
@ PlanarPixels
@ Metres3D
@ PlanarPixels
@ MetresRightHandedYUp
@ InvalidArgument
@ NotFound
Definition Container.h:602
Owning frame at an explicit finite simulation time, starting at zero.
Definition RigidPoseTrack.h:25