载入中...
搜索中...
未找到
DeformTrack.h
浏览该文件的文档.
1#pragma once
2#include <memory>
3#include <span>
4#include <vector>
5#include "common/Export.h"
6#include "common/Result.h"
8namespace eve::physics {
9class BakeRecipe;
12 float x = 0, y = 0, z = 0;
13};
16 float seconds;
18 std::vector<DeformPoint> positions;
19};
26public:
28 [[nodiscard]] bool isSameAsset(const DeformTrack& other) const noexcept { return data_ == other.data_; }
33 [[nodiscard]] static Result<DeformTrack> prepare(std::vector<DeformFrame> frames, const BakeRecipe& recipe);
38 [[nodiscard]] Result<void> save(std::string_view path) const;
43 [[nodiscard]] static Result<DeformTrack> load(std::string_view path);
48 [[nodiscard]] static Result<DeformTrack> loadForRecipe(std::string_view path, const BakeRecipe& expected);
54 [[nodiscard]] Result<void> sample(float seconds, std::span<DeformPoint> output) const;
56 [[nodiscard]] DeformTopology topology() const;
58 [[nodiscard]] std::shared_ptr<const BakeRecipe> recipe() const noexcept;
60 [[nodiscard]] float duration() const noexcept;
62 [[nodiscard]] std::size_t frameCount() const noexcept;
63
64private:
65 struct Data;
66 explicit DeformTrack(std::shared_ptr<const Data> data);
67 std::shared_ptr<const Data> data_;
68};
69} // namespace eve::physics
float duration
std::string output
#define EVENGINE_API_BACKENDS
Definition Export.h:108
BakeRecipe recipe
Topology topology
std::string path
Definition PlayHost.cpp:111
Move-only, checked operation results for the common layer.
Data public API.
Definition Data.h:8
Move-only operation result carrying either a value or Status.
Definition Result.h:176
Bounded provenance builder for explicit-coordinate baked recordings. @ownership Owns names and conten...
Definition BakeRecipe.h:21
Immutable connectivity and UV ownership for fixed-topology deformation playback. @ownership Copies sh...
Immutable fixed-topology deformation clip, independent of simulation and rendering providers....
Definition DeformTrack.h:25
bool isSameAsset(const DeformTrack &other) const noexcept
Whether both views share the same frozen asset; constant-time identity query.
Definition DeformTrack.h:28
Optional physics backend for vehicle mobility and body attach.
Definition Climbing.h:36
Owning snapshot with actual connectivity, stable indexed positions and explicit sample time.
Definition DeformTrack.h:15
DeformTopology topology
Definition DeformTrack.h:17
std::vector< DeformPoint > positions
Definition DeformTrack.h:18
Owning position in the explicit coordinates recorded by the recipe.
Definition DeformTrack.h:11