载入中...
搜索中...
未找到
RigidPoseTrack.h
浏览该文件的文档.
1#pragma once
2#include <cstddef>
3#include <memory>
4#include <string_view>
5#include <vector>
6#include "common/Export.h"
7#include "common/Identity.h"
8#include "common/Result.h"
9
10namespace eve::physics {
11class BakeRecipe;
16 float x = 0, y = 0, z = 0;
17 float qx = 0, qy = 0, qz = 0, qw = 1;
18};
26 float seconds = 0;
27 std::vector<RigidTrackSample> samples;
28};
37public:
42 [[nodiscard]] static Result<RigidPoseTrack> prepare(RigidTrackSpace space, std::vector<RigidTrackFrame> frames);
47 [[nodiscard]] static Result<RigidPoseTrack> prepare(RigidTrackSpace space, std::vector<RigidTrackFrame> frames,
48 const BakeRecipe& recipe);
50 [[nodiscard]] std::shared_ptr<const BakeRecipe> recipe() const noexcept;
55 [[nodiscard]] static Result<RigidPoseTrack> loadForRecipe(std::string_view path, const BakeRecipe& expected);
62 [[nodiscard]] Result<void> save(std::string_view path) const;
68 [[nodiscard]] static Result<RigidPoseTrack> load(std::string_view path);
72 [[nodiscard]] Result<RigidTrackPose> sample(float seconds, PersistentId id) const;
74 [[nodiscard]] RigidTrackSpace space() const noexcept;
76 [[nodiscard]] float duration() const noexcept;
78 [[nodiscard]] std::size_t trackCount() const noexcept;
80 [[nodiscard]] std::size_t frameCount() const noexcept;
82 [[nodiscard]] Result<PersistentId> trackId(std::size_t index) const;
83
84private:
85 struct Data;
86 static Result<RigidPoseTrack> prepareValidated(RigidTrackSpace space, std::vector<RigidTrackFrame> frames,
87 std::shared_ptr<const BakeRecipe> recipe);
88 explicit RigidPoseTrack(std::shared_ptr<const Data> data);
89 std::shared_ptr<const Data> data_;
90};
91} // namespace eve::physics
LogicalId trackId
float duration
#define EVENGINE_API_BACKENDS
Definition Export.h:108
Strong identity values shared by persistence, content and logical-name APIs.
BakeRecipe recipe
std::string path
Definition PlayHost.cpp:111
Move-only, checked operation results for the common layer.
uint32_t index
Move-only operation result carrying either a value or Status.
Definition Result.h:176
Id128 public API.
Definition Identity.h:111
Bounded provenance builder for explicit-coordinate baked recordings. @ownership Owns names and conten...
Definition BakeRecipe.h:21
Frozen fixed-roster rigid poses, independent of physics, graphics and script providers....
Optional physics backend for vehicle mobility and body attach.
Definition Climbing.h:36
RigidTrackSpace
Explicit sample coordinates; planar pixels preserve the producer's XY axes without implicit Y flip.
Owning frame at an explicit finite simulation time, starting at zero.
std::vector< RigidTrackSample > samples
Owning pose; XYZW quaternion, pixels or metres selected by the track. Planar poses require z=qx=qy=0.
Stable caller-supplied object identity paired with a pose; never a runtime body handle.