载入中...
搜索中...
未找到
CollapseAnimation.h
浏览该文件的文档.
1#pragma once
2#include <memory>
3#include <string>
4#include <string_view>
5#include <vector>
6#include "common/Export.h"
7#include "common/Result.h"
9
10namespace eve::physics {
11class CollapseCaptureSource;
12class BakeRecipe;
14struct FractureGeometry;
28public:
33 [[nodiscard]] Result<void> beginBake(const CollapseBakeRecipe& recipe);
37 [[nodiscard]] std::shared_ptr<const CollapseBakeRecipe> recipe() const noexcept;
43 [[nodiscard]] static Result<CollapseAnimation> loadForRecipe(std::string_view path,
44 const CollapseBakeRecipe& expected);
52 [[nodiscard]] static std::string contentKey(std::string_view source);
58 [[nodiscard]] Result<void> capture(const CollapseCaptureSource& source, float seconds);
62 [[nodiscard]] Result<BonePresentation> sample(float seconds, int bone) const;
73 [[nodiscard]] Result<void> save(std::string_view path) const;
78 [[nodiscard]] static Result<CollapseAnimation> load(std::string_view path);
80 [[nodiscard]] float duration() const noexcept;
82 [[nodiscard]] int boneCount() const noexcept;
84 [[nodiscard]] int frameCount() const noexcept;
85
90 [[nodiscard]] std::shared_ptr<const FractureGeometry> fragmentGeometry() const noexcept;
91
92private:
93 struct Frame {
94 float seconds;
95 std::vector<BonePresentation> bones;
96 };
97 std::shared_ptr<const CollapseBakeRecipe> recipe_;
98 std::vector<Frame> frames_;
99 std::shared_ptr<const FractureGeometry> geometry_;
100};
101} // namespace eve::physics
float duration
#define EVENGINE_API_BACKENDS
Definition Export.h:108
std::vector< Bone > bones
std::uint32_t bone
BakeRecipe recipe
std::string path
Definition PlayHost.cpp:111
Move-only, checked operation results for the common layer.
std::string_view source
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
Owning, solver-independent baked rigid-fragment animation within Physics. @ownership Owns all samples...
Read-only source protocol for one atomic offline collapse sample. @ownership The caller owns the sour...
Optional physics backend for vehicle mobility and body attach.
Definition Climbing.h:36
Owning, typed mesh payload shared immutably by simulation, clip and renderer. @thread Read-only shari...