载入中...
搜索中...
未找到
ActionGuidePack.h
浏览该文件的文档.
1#pragma once
2
12#include "common/Export.h"
13#include "common/Result.h"
14#include "common/Value.h"
15
16#include <array>
17#include <cstdint>
18#include <memory>
19#include <optional>
20#include <span>
21#include <string>
22#include <string_view>
23#include <vector>
24
25namespace eve {
26
27inline constexpr std::string_view kActionGuidePackSchemaId = "eve.action.guide-pack";
28inline constexpr std::uint64_t kActionGuidePackSchemaVersion = 1;
29
31enum class ActionGuideRootMode : std::uint8_t { InPlace, WorldRoot };
32
34enum class ActionGuideProjection : std::uint8_t { Orthographic, Perspective };
35
38 std::string domain;
39 std::uint64_t id = 0;
40 std::uint64_t generation = 0;
41};
42
45 std::int64_t width = 0;
46 std::int64_t height = 0;
47 double pixelsPerUnit = 1.0;
48 std::array<double, 4> backgroundRgba{0.0, 0.0, 0.0, 0.0};
49 bool transparent = true;
50};
51
55 double fovYDegrees = 45.0;
56 double orthoSize = 1.0;
57 double nearPlane = 0.1;
58 double farPlane = 100.0;
59 std::array<double, 3> eye{0.0, 0.0, 5.0};
60 std::array<double, 3> target{0.0, 0.0, 0.0};
61 std::array<double, 3> up{0.0, 1.0, 0.0};
62};
63
66 std::string shotId;
67 double timeSeconds = 0.0;
68 std::optional<std::int64_t> sampleIndex;
69 std::string view = "front";
70 std::vector<std::string> aovs;
71 std::vector<std::string> tags;
72};
73
76 std::string name;
77 double timeSeconds = 0.0;
78};
79
82 std::string abilityId;
83 std::string clipName;
84 double fps = 12.0;
85 bool loop = false;
86 std::vector<ActionGuidePhaseMark> phaseMarks;
87};
88
91 double minSilhouetteIoU = 0.85;
92 double maxJointErrorPx = 8.0;
93 std::int64_t maxRetries = 3;
94};
95
113
116 std::string boneId;
117 std::string name;
118 std::array<double, 3> position{};
119 std::optional<std::string> parentId;
120};
121
124 std::string boneId;
125 std::string name;
126 double x = 0.0;
127 double y = 0.0;
128 double depth = 0.0;
129 std::optional<std::string> parentId;
130};
131
140
148
158 const ActionGuidePack& pack, std::span<const ActionGuideBoneWorld> bones);
159
161enum class ActionGuideCapturePhase : std::uint8_t {
162 Queued,
163 Rendering,
164 Ready,
165 Failed,
166 Cancelled,
167 Released,
168};
169
172
178 std::string aov; // pack spelling: silhouette|depth|bone|…
179 std::uint32_t width = 0;
180 std::uint32_t height = 0;
181 std::shared_ptr<const std::vector<std::uint8_t>> rgba8;
182};
183
186 std::string shotId;
187 double timeSeconds = 0.0;
188 std::optional<std::int64_t> sampleIndex;
189 std::string view = "front";
190 std::vector<std::string> tags;
191 std::vector<ActionGuideAovBuffer> aovs;
192};
193
199 std::string token;
201 std::uint64_t revision = 0;
202 std::string backend;
203 std::string reason;
205 std::vector<ActionGuideShotArtifact> shots;
206};
207
214public:
215 static constexpr const char* capabilityName = "IActionGuideCapture";
216 virtual ~IActionGuideCapture() = default;
217
225 [[nodiscard]] virtual Result<std::string> requestCapture(std::string_view packJson,
226 std::span<const std::string> shotIds) = 0;
231 [[nodiscard]] virtual Result<ActionGuideCaptureSnapshot> captureSnapshot(std::string_view token) = 0;
233 [[nodiscard]] virtual Result<void> releaseCapture(std::string_view token) = 0;
234};
235
236} // namespace eve
#define EVENGINE_API_FOUNDATION_INLINE
仅供"只有内联成员"的类型使用的组宏:拥有者 dllexport,消费方不导入。
Definition Export.h:170
#define EVENGINE_API_FOUNDATION
每个链接组(link group)各自的导出宏。
Definition Export.h:106
std::vector< Bone > bones
ActionGuidePack pack
OceanGpuFrameToken token
Object::Ptr value
Move-only, checked operation results for the common layer.
float phase
Owning, renderer-independent dynamic values.
Optional GPU guide-capture provider (silhouette/depth/bone AOV export). @thread Engine owner thread o...
virtual ~IActionGuideCapture()=default
virtual Result< ActionGuideCaptureSnapshot > captureSnapshot(std::string_view token)=0
Poll without waiting; Ready includes lease-owned RGBA buffers for export. @cost O(1) metadata copy; b...
virtual Result< void > releaseCapture(std::string_view token)=0
Cancel/release; GPU resources survive until their fence completes.
virtual Result< std::string > requestCapture(std::string_view packJson, std::span< const std::string > shotIds)=0
Queue guide AOV capture for one pack revision / shot set; never block on GPU.
Move-only operation result carrying either a value or Status.
Definition Result.h:176
The canonical owning dynamic value used by data-facing protocols.
Definition Value.h:31
Build metadata (engine git commit, build time, third-party version).
Definition Build.cpp:16
Result< Value > encodeActionGuidePack(const ActionGuidePack &pack)
Encode one validated guide pack as canonical schema version 1 data.
Result< std::vector< ActionGuideLandmark > > projectActionGuideLandmarks(const ActionGuidePack &pack, std::span< const ActionGuideBoneWorld > bones)
Project world-space bones into guide-canvas landmarks using the pack camera/canvas.
ActionGuideRootMode
Root-motion handling when sampling the subject for guide shots.
std::string_view actionGuideCapturePhaseName(ActionGuideCapturePhase phase)
Stable protocol spelling of a guide-capture phase.
ActionGuideCapturePhase
Guide-capture job progress; Ready is published only after every requested AOV exists.
Result< ActionGuidePack > decodeActionGuidePack(const Value &value)
Decode schema version 1; unknown fields/versions and incomplete shots are rejected.
constexpr std::uint64_t kActionGuidePackSchemaVersion
ActionGuideProjection
Camera projection used for guide AOVs and landmark projection.
constexpr std::string_view kActionGuidePackSchemaId
One lease-owned CPU AOV buffer (always RGBA8 for PNG export). @ownership rgba8 is immutable shared st...
std::shared_ptr< const std::vector< std::uint8_t > > rgba8
Draft binding from guide clips into an ability/clip identity.
std::vector< ActionGuidePhaseMark > phaseMarks
World-space bone sample supplied by an animation/pose owner.
std::array< double, 3 > position
std::optional< std::string > parentId
Offscreen guide camera; never mutates the live gameplay camera.
std::array< double, 3 > eye
std::array< double, 3 > target
std::array< double, 3 > up
ActionGuideProjection projection
Output canvas contract for guide images and landmark pixels.
std::array< double, 4 > backgroundRgba
Immutable CPU snapshot for one guide-capture job. @lifetime Bytes remain valid until releaseCapture; ...
ActionGuideCapturePhase phase
std::vector< ActionGuideShotArtifact > shots
Projected joint in guide-canvas pixels (origin top-left) plus view depth.
std::optional< std::string > parentId
Authoritative guide-pack document (no pointers, GPU tokens, or ECS slots). @ownership Caller-owned va...
ActionGuideCamera camera
ActionGuideSubject subject
ActionGuideRootMode rootMode
ActionGuideCanvas canvas
std::vector< ActionGuideShot > shots
ActionGuideBinding actionBinding
Named phase marker for later Action/Ability timeline binding.
Acceptance thresholds for candidate ingest / verify.
std::int64_t maxRetries
Per-shot artifact set for a Ready capture.
std::vector< std::string > tags
std::optional< std::int64_t > sampleIndex
std::vector< ActionGuideAovBuffer > aovs
One guide shot: sample time, view label, and required AOV set.
std::optional< std::int64_t > sampleIndex
std::vector< std::string > aovs
std::vector< std::string > tags
Generation-qualified subject handle; domain-owned, not a universal actor.